PHP 7 obsolete feature
PHP4 style constructor
In PHP4, the function in the class can have the same name as the class name. This feature is Deprecated in PHP7 and will issue an E_DEPRECATED error. When the method name is the same as the class name, the class is not in the namespace, and the PHP5 constructor (__construct) does not exist, an E_DEPRECATED error will be generated.
Example
Example
<?php class A { function A() { print('Style Constructor'); } } ?>
The execution output of the above program is:
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...
##Call non-static methods in a static wayWith Calling non-static methods in a static way is no longer supported: Instance
Instance
The output result of the above program execution is: <?php
class A {
function b() {
print('Non-static call');
}
}
A::b();
?>
Deprecated: Non-static method A::b() should not be called statically in...
##password_hash() random factor OptionsNon-static call