@ 2015-09-19T07:42:53Z <?php
namespace Wl\A;
class B {
public function get() {
return "BBBBB";
}
}
$b = new B();
$funct = function (B $b) { print_r($b::get()); };
$closure = &$funct;
$reflection = new \ReflectionFunction($closure);
$arguments = $reflection->getParameters();
echo "ARGS:\n";
var_dump($arguments);
try {
$funct("");
} catch (\Exception $e) {
echo "catched";
} catch (\TypeError $e) {
echo "subidubi";
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.16 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.19 , 8.3.0 - 8.3.7 ARGS:
array(1) {
[0]=>
object(ReflectionParameter)#4 (1) {
["name"]=>
string(1) "b"
}
}
subidubi Output for 5.4.8 - 5.4.45 , 5.5.24 - 5.5.35 , 5.6.7 - 5.6.28 ARGS:
array(1) {
[0]=>
&object(ReflectionParameter)#4 (1) {
["name"]=>
string(1) "b"
}
}
Catchable fatal error: Argument 1 passed to Wl\A\{closure}() must be an instance of Wl\A\B, string given, called in /in/DV3QV on line 22 and defined in /in/DV3QV on line 12
Process exited with code 255 . preferences:dark mode live preview
202.16 ms | 402 KiB | 223 Q