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

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

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