« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 2 of about 2 for DerivedClass (0.001 sec.)
このクラスがイテレーション可能かを調べる 9357
« ReflectionClass::isInternal ReflectionClass::isIterateable » PHP Manual ReflectionClass このクラスがイテレーション可能かを調べる 検索 ReflectionClass::isIterable (PHP 7 >= 7.2.0, PHP 8) ReflectionClass::isIterable — このクラスがイテレーシ ... (): mixed {} public function next (): void {} public function valid (): bool {} public function rewind (): void {} } class DerivedClass extends IteratorClass {} class NonIterator {} function dump_iterable ( $class ) { $reflection = new ReflectionClass ( $cla ... ss ); var_dump ( $reflection -> isIterable ()); } $classes = [ "ArrayObject" , "IteratorClass" , "DerivedClass" , "NonIterator" ,]; foreach ( $classes as $class ) { echo "Is $class iterable? " ; dump_iterable ( $class ); } ?> 上の例の ... 出力は以下となります。 Is ArrayObject iterable? bool(true) Is IteratorClass iterable? bool(true) Is DerivedClass iterable? bool(true) Is NonIterator iterable? bool(false) 参考 ReflectionClass::__construct() - ReflectionClass を作成する ...
https://man.mtool.work/php/8.3/reflectionclass.isiterable.html
このクラスがイテレーション可能かを調べる 9357
« ReflectionClass::isInternal ReflectionClass::isIterateable » PHP Manual ReflectionClass このクラスがイテレーション可能かを調べる 検索 ReflectionClass::isIterable (PHP 7 >= 7.2.0, PHP 8) ReflectionClass::isIterable — このクラスがイテレーシ ... (): mixed {} public function next (): void {} public function valid (): bool {} public function rewind (): void {} } class DerivedClass extends IteratorClass {} class NonIterator {} function dump_iterable ( $class ) { $reflection = new ReflectionClass ( $cla ... ss ); var_dump ( $reflection -> isIterable ()); } $classes = [ "ArrayObject" , "IteratorClass" , "DerivedClass" , "NonIterator" ,]; foreach ( $classes as $class ) { echo "Is $class iterable? " ; dump_iterable ( $class ); } ?> 上の例の ... 出力は以下となります。 Is ArrayObject iterable? bool(true) Is IteratorClass iterable? bool(true) Is DerivedClass iterable? bool(true) Is NonIterator iterable? bool(false) 参考 ReflectionClass::__construct() - ReflectionClass を作成する ...
https://man.mtool.work/php/8.3/reflectionclass.isiterable.html
PREV 1 NEXT