Permalink
Browse files

Merge pull request #81 from stojg/release/object-create

MINOR Object::create should not call a constructor if there aren't one.
  • Loading branch information...
2 parents 244f070 + 3a11bb2 commit d88b39f292981fe4b03295bf33f6064d839d6eb7 @sminnee sminnee committed Oct 28, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/Object.php
View
5 core/Object.php 100644 → 100755
@@ -85,7 +85,10 @@ public static function create() {
$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();

0 comments on commit d88b39f

Please sign in to comment.