<?php class Foo { private $foo; private function __construct($spam){ $this->foo = $spam; } public function getFoo() { return $this->foo; } } $args = 'bacon'; $class = 'Foo'; $reflClass = new \ReflectionClass($class); $instance = call_user_func(\Closure::bind(function () use ($args) { return new static($args); }, $reflClass->newInstanceWithoutConstructor(), $class)); echo $instance->getFoo();
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`