« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for echoit (0.000 sec.)
可変関数 | PHP 8.3 9414
可変関数 PHP は可変関数(variable functions)の概念をサポートします。 これにより、変数名の後に括弧が付いている場合、その値が何であろうと PHPは、同名の関数を探し実行を試みます。 この機能は、コールバック、関数テーブル等を実装するために使用可能で ... } function bar ( $arg = '' ) { echo "In bar(); argument was ' $arg '.\n" ; } // これは、echo のラッパー関数です。 function echoit ( $string ) { echo $string ; } $func = 'foo' ; $func (); // This calls foo() $func = 'bar' ; $func ( 'test' ); // This cal ... ls bar() $func = 'echoit' ; $func ( 'test' ); // This calls echoit() オブジェクトのメソッドを可変関数を使ってコールすることもできます。 例2 可変メソ ...
https://man.mtool.work/php/8.3/functions.variable-functions.html
PREV 1 NEXT