PHP 7 の非推奨の機(jī)能
PHP4 スタイルのコンストラクター
PHP4 では、クラス內(nèi)の関數(shù)はクラス名と同じ名前を持つことができます。この機(jī)能は PHP7 で廃止され、E_DEPRECATED エラーが発行されます。メソッド名がクラス名と同じで、クラスが名前空間に存在せず、PHP5 コンストラクター (__construct) が存在しない場(chǎng)合、E_DEPRECATED エラーが生成されます。
Instance
<?php class A { function A() { print('Style Constructor'); } } ?>上記のプログラム実行の出力結(jié)果は次のとおりです:
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...
靜的方法で非靜的メソッドを呼び出す
靜的方法で非靜的メソッドを呼び出す、サポートされなくなりました:
Instance
<?php class A { function b() { print('Non-static call'); } } A::b(); ?>
上記のプログラム 実行出力結(jié)果は次のとおりです:
Deprecated: Non-static method A::b() should not be called statically in... Non-static call
password_hash() ランダム係數(shù)オプションの元のソルト量
関數(shù)は開(kāi)発者によって提供される必要がなくなりました。この関數(shù)にはデフォルトでソルト機(jī)能があり、開(kāi)発者はソルト値を指定する必要はありません。
capture_session_meta SSL コンテキスト オプション
「capture_session_meta」SSL コンテキスト オプションは非推奨になりました。 ストリーム リソース上でアクティブな暗號(hào)化関連のメタデータには、stream_get_meta_data() の戻り値を通じてアクセスできます。