search
HomeBackend DevelopmentPHP7php7.0.x deprecated features

php7.0.x deprecated features

May 27, 2020 pm 04:30 PM
php7

php7.0.x deprecated features

Deprecated feature in php 7.0.x

PHP4-style constructors

PHP4-style constructors (method names are the same as class names) are deprecated and will be removed in the future. PHP7 will generate an E_DEPRECATED warning if only PHP4-style constructors are used in a class. If the __construct() method is also defined, it will not be affected.

<?php
class foo {
    function foo() {
        echo &#39;I am the constructor&#39;;
    }
}
?>

The above routine will output:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in example .php on line 3

Static call to non-static method

Abandoned Static call is not declared into a static method, this feature may be completely removed in the future.

<?php
class foo {
    function bar() {
        echo &#39;I am not static!&#39;;
    }
}
foo::bar();
?>

The above routine will output:

Deprecated: Non-static method foo::bar() should not be called statically in - on line 8<br>I am not static!

password_hash() salt option

The salt option in the password_hash() function is obsolete. Prevent developers from generating their own salts (generally less secure). When the developer does not pass this value, the function itself will generate a cryptographically secure salt value. Therefore there is no need to pass in your own custom salt value.

capture_session_meta SSL context option

The SSL context option in capture_session_meta is obsolete. SSL metadata can now be obtained via stream_get_meta_data().

Deprecated in LDAP

The following functions have been deprecated:

ldap_sort()

Recommended Tutorial: "PHP7" "PHP Tutorial"

The above is the detailed content of php7.0.x deprecated features. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:php.net. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software