Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /proc/self/root/usr/local/src/php72/php-7.2.12/php-7.2.12/ext/reflection/tests/ |
Current File : //proc/self/root/usr/local/src/php72/php-7.2.12/php-7.2.12/ext/reflection/tests/parameters_001.phpt |
--TEST-- ReflectionParameter Check for parameter being optional --FILE-- <?php class Test { function func($x, $y = NULL){ } } $f = new ReflectionMethod('Test', 'func'); var_dump($f->getNumberOfParameters()); var_dump($f->getNumberOfRequiredParameters()); $p = new ReflectionParameter(array('Test', 'func'), 'x'); var_dump($p->isOptional()); $p = new ReflectionParameter(array('Test', 'func'), 'y'); var_dump($p->isOptional()); try { $p = new ReflectionParameter(array('Test', 'func'), 'z'); var_dump($p->isOptional()); } catch (Exception $e) { var_dump($e->getMessage()); } ?> ===DONE=== --EXPECT-- int(2) int(1) bool(false) bool(true) string(54) "The parameter specified by its name could not be found" ===DONE===
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare