MINOR Do not call a constructor if there aren't one.

This will fix a lot of unittests failing.
This commit is contained in:
Stig Lindqvist 2011-10-27 18:13:17 +02:00
parent cf408d766a
commit 3a11bb2f66

5
core/Object.php Normal file → Executable file
View File

@ -85,7 +85,10 @@ abstract class Object {
$args = func_get_args();
$class = self::getCustomClass(array_shift($args));
$reflector = new ReflectionClass($class);
return $reflector->newInstanceArgs($args);
if($reflector->getConstructor()) {
return $reflector->newInstanceArgs($args);
}
return new $class;
}
private static $_cache_inst_args = array();