1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/reflection/tests/ReflectionClass_isInstantiable_variation.phpt
2020-02-03 22:52:20 +01:00

33 lines
712 B
PHP

--TEST--
ReflectionClass::IsInstantiable()
--FILE--
<?php
class noCtor {
}
class publicCtorNew {
public function __construct() {}
}
class protectedCtorNew {
protected function __construct() {}
}
class privateCtorNew {
private function __construct() {}
}
$classes = array("noCtor", "publicCtorNew", "protectedCtorNew", "privateCtorNew");
foreach ($classes as $class) {
$reflectionClass = new ReflectionClass($class);
echo "Is $class instantiable? ";
var_dump($reflectionClass->IsInstantiable());
}
?>
--EXPECT--
Is noCtor instantiable? bool(true)
Is publicCtorNew instantiable? bool(true)
Is protectedCtorNew instantiable? bool(false)
Is privateCtorNew instantiable? bool(false)