c6d10ce255
Add support for PHP >=5.4 ReflectionClass::newInstanceWithoutConstructor
14 linhas
318 B
PHP
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();
|