不推荐使用以下函数,并且可以从以后的PHP版本中删除这些函数。
PHP 4样式构造函数是与定义它们的类同名的方法,现在已弃用,并且将来会删除。如果PHP 4构造函数是类中唯一定义的构造函数,则PHP 7将发出E_DEPRECATED,实现__construct()方法的类不受影响。
<?php class A { function A() { print('Style Constructor'); } } ?>
它产生以下浏览器输出-
链接:https://www.learnfk.comhttps://www.learnfk.com/php7+/php7-deprecated-features.html
来源:LearnFk无涯教程网
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in...
不建议使用对非静态方法的静态调用,以后可能会删除它。
<?php class A { function b() { print('Non-static call'); } } A::b(); ?>
它产生以下浏览器输出-
链接:https://www.learnfk.comhttps://www.learnfk.com/php7+/php7-deprecated-features.html
来源:LearnFk无涯教程网
Deprecated: Non-static method A::b() should not be called statically in... Non-static call
password_hash()函数的salt选项已被弃用,以使开发人员不会生成自己的salt。当开发人员不提供salt时,该函数本身会生成密码安全的salt-因此不再需要自定义salt生成。
capture_session_meta SSL Context 选项已被弃用。现在,通过 stream_get_meta_data()函数使用SSL元数据。
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)