Results of 1 - 1 of about 1 for staticmethodStr (0.001 sec.)
- 第一級callableを生成する記法 | PHP 8.3 9414
- 第一級callableを生成する記法 第一級callableを生成する記法 (First class callable syntax) とは、PHP 8.1.0 で追加された、 callable から 無名関数 を生成する記法です。 この記法は、 文字列や配列を使って callable を生成するやり方を置き換えるもので
... nction staticmethod () {} public function __invoke () {} } $obj = new Foo (); $classStr = 'Foo' ; $methodStr = 'method' ; $staticmethodStr = 'staticmethod' ; $f1 = strlen (...); $f2 = $obj (...); // 呼び出し可能オブジェクト $f3 = $obj -> method (...); $f4 = $ob ... j -> $methodStr (...); $f5 = Foo :: staticmethod (...); $f6 = $classStr :: $staticmethodStr (...); // 文字列や配列を使った、古い記法 $f7 = 'strlen' (...); $f8 = [ $obj , 'method' ](...); $f9 = [ Foo ::class, 'stati ...
-
https://man.mtool.work/php/8.3/functions.first_class_callable_syntax.html
PREV
1
NEXT