We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51b6af9 commit aaa05aeCopy full SHA for aaa05ae
core/Base/Singleton.class.php
@@ -31,13 +31,17 @@ final public static function getInstance(
31
if (2 < func_num_args()) {
32
$args = func_get_args();
33
array_shift($args);
34
-
35
- // can't call protected constructor through reflection
36
- eval(
37
- '$object = new '.$class
38
- .'($args['.implode('],$args[', array_keys($args)).']);'
+
+ // emulation of ReflectionClass->newInstanceWithoutConstructor
+ $object =
+ unserialize(
+ sprintf('O:%d:"%s":0:{}', strlen($class), $class)
39
+ );
40
41
+ call_user_func_array(
42
+ array($object, '__construct'),
43
+ $args
44
);
45
} else {
46
$object =
47
$args
0 commit comments