Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
別の関数を呼び出すクラスで単体テストを実行するために、PHP4 で関数を再宣言、上書き、または名前変更する方法を探しています。代わりに、この関数をテスト関数にしたいです。
いくつかの制約があります。
関数を上書きするために、関数が使用して終了するかどうかを確認できますがfunction_exists、関数を再宣言できます
function_exists
if (!function_exists('function_name')) { // ... proceed to declare your function }