Arquivos
hhvm/hphp/test/vm/reflection_noconstuctor.php
T
seanc c6d10ce255 Add HPHP support for newInstanceWithoutConstructor
Add support for PHP >=5.4 ReflectionClass::newInstanceWithoutConstructor
2013-04-01 13:46:30 -07:00

14 linhas
318 B
PHP

<?php
class foo {
public function __construct() {
print "this should only be printed three times!\n";
}
}
$c1 = new foo();
$c2 = (new ReflectionClass('foo'))->newInstance();
$c3 = (new ReflectionClass('foo'))->newInstanceArgs(array());
$no_c = (new ReflectionClass('foo'))->newInstanceWithoutConstructor();