Results of 1 - 1 of about 1 for fooStatic (0.001 sec.)
- static キーワード | PHP 8.3 9414
- static キーワード ヒント このページでは、 static キーワードを使って static メソッド や static プロパティを定義する方法を説明します。 static は、 static 変数 や static な無名関数 、そして 遅延静的束縛 にも使えます。これらの場合の static の使
... _static = 'foo' ; public function staticValue () { return self :: $my_static ; } } class Bar extends Foo { public function fooStatic () { return parent :: $my_static ; } } print Foo :: $my_static . "\n" ; $foo = new Foo (); print $foo -> staticValue () . ... ssname = 'Foo' ; print $classname :: $my_static . "\n" ; print Bar :: $my_static . "\n" ; $bar = new Bar (); print $bar -> fooStatic () . "\n" ; ?> 上の例の PHP 8 での出力は、たとえば以下のようになります。: foo foo Notice: Accessing static property Foo::$ ...
-
https://man.mtool.work/php/8.3/language.oop5.static.html
PREV
1
NEXT