« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for printPHP (0.001 sec.)
オブジェクトの継承 | PHP 8.3 9414
オブジェクトの継承 プログラミング言語の原則としてよくみられるものに継承があります。 PHP はオブジェクトモデルにおいてこの継承を利用しています。 多くのクラスとオブジェクトとの連携に継承は関係しています。 例えば、クラスを拡張するとき、サブクラ ... 例1 継承の例 <?php class Foo { public function printItem ( $string ) { echo 'Foo: ' . $string . PHP_EOL ; } public function printPHP () { echo 'PHP is great.' . PHP_EOL ; } } class Bar extends Foo { public function printItem ( $string ) { echo 'Bar: ' . $ ... string . PHP_EOL ; } } $foo = new Foo (); $bar = new Bar (); $foo -> printItem ( 'baz' ); // 出力: 'Foo: baz' $foo -> printPHP (); // 出力: 'PHP is great.' $bar -> printItem ( 'baz' ); // 出力: 'Bar: baz' $bar -> printPHP (); // 出力: 'PHP is great. ...
https://man.mtool.work/php/8.3/language.oop5.inheritance.html
PREV 1 NEXT