Reputation: 57
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Pagination has a deprecated constructor
Filename: libraries/Pagination.php
class CI_Pagination {
var $base_url = ''; // The page we are linking to
var $total_rows = ''; // Total number of items (database results)
var $per_page = 10; // Max number of items you want shown per page
var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
var $cur_page = 0; // The current page being viewed
var $first_link = '‹ First';
var $next_link = '>';
var $prev_link = '<';
var $last_link = 'Last ›';
var $uri_segment = 3;
var $full_tag_open = '';
var $full_tag_close = '';
var $first_tag_open = '';
var $first_tag_close = ' ';
var $last_tag_open = ' ';
var $last_tag_close = '';
var $cur_tag_open = ' ';
var $cur_tag_close = '';
var $next_tag_open = ' ';
var $next_tag_close = ' ';
var $prev_tag_open = ' ';
var $prev_tag_close = '';
var $num_tag_open = ' ';
var $num_tag_close = '';
var $page_query_string = FALSE;
var $query_string_segment = 'per_page';
Upvotes: 4
Views: 50872
Reputation: 11
Severity: 8192
Message: Return type of CI_Session_files_driver::open($save_path, $name)
should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool
, or the #[\ReturnTypeWillChange]
attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 132
Backtrace:
File: C:\xampp\htdocs\amd_login\index.php
Line: 315
Function: require_once
Upvotes: 1
Reputation: 2007
For Codeigniter
First Step:
class MyClass{
function __construct(){
// copy your old constructor function code here
}
}
Next Step(if first step not working): Open application\config\autoload.php and edit
$autoload['libraries'] = array('database', 'session','browser');
to
$autoload['libraries'] = array('database', 'session');
remove 'browser'
Upvotes: 0
Reputation: 29
class NewClass{
}
function __construct(){
} //is used inplace of a function named NewClass for constructor
change function name having same name as class to __construct and it will work. Faced such problem in google maps api v3
Upvotes: 0
Reputation: 41
It is occur with new version of php ,So if you want to remove this error please use _construct() instead of same class name function.
So here you have to user
class CI_Pagination {
public function __construct() {
}
}
instead of
class CI_Pagination {
public function CI_Pagination () {
}
}
Upvotes: 4
Reputation: 1
Loader.php 414 line, I have removed Ampersent.
$CI->dbutil =& new $class();
to
$CI->dbutil = new $class();
It works fine in php5.x.
Upvotes: -2
Reputation: 13588
Previously we used to declare class constructor using the class name itself
Class A
{
public function a(){
}
}
Now you need to change a() to construct, like this
public function __construct(){
}
And the error will disappear.
Upvotes: 9