严重性:8192消息:与类同名的方法在未来版本的PHP;中不会是构造函数;


Severity: 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

严重性:8192

消息:在PHP的未来版本中,与类同名的方法将不会是构造函数;CI_Pagination有一个不推荐使用的构造函数

文件名:librarys/Pagination.php

行号:27

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';

以前我们使用类名本身来声明类构造函数

Class A
{
public function a(){
}
}

现在你需要改变a((来构造,就像这个

public function __construct(){
}

错误就会消失。

这是在新版本的php中发生的,所以如果你想删除这个错误,请使用_construct((而不是相同的类名函数。

所以这里你必须使用

class CI_Pagination {
 public function  __construct() {
 }
}

而不是

class CI_Pagination {
 public function CI_Pagination () {
 }
}

严重性:8192

消息:CI_Session_files_driver::open($save_path, $name)的返回类型应与SessionHandlerInterface::open(string $path, string $name): bool兼容,或者#['ReturnTypeWillChange]属性应用于临时抑制通知

Filename: drivers/Session_files_driver.php
Line Number: 132
Backtrace:
File: C:'xampp'htdocs'amd_login'index.php
Line: 315
Function: require_once
class NewClass{
}
function __construct(){
} //is used inplace of a function named NewClass for constructor

将和类同名的函数名更改为__construct,它就可以工作了。在谷歌地图api v3 中面临这样的问题

对于代码点火器

第一步:

class MyClass{
 function __construct(){
    // copy your old constructor function code here
 }
}

下一步(如果第一步不起作用(:打开application''config''autoload.php并编辑

$autoload['libraries'] = array('database', 'session','browser');

$autoload['libraries'] = array('database', 'session');

删除"浏览器">

Loader.php 414行,我删除了Ampersend。

$CI->dbutil =& new $class();

$CI->dbutil = new $class();

它在php5.x中运行良好。