3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $showError = false; class SomeClass { function SomeFunction($foo) { } } $foo[] = 'SomeClass'; $foo[] = 'SomeFunction'; var_dump($foo); if ($showError == true) { $bar[] = 'SomeClass'; $bar[] = &$foo[1]; } $reflection = new ReflectionParameter($foo, 'foo'); if ($showError) { //$reflection = new ReflectionParameter($bar, 'foo'); }
based on 6bJ2i
Output for 5.0.0 - 7.2.0
array(2) { [0]=> string(9) "SomeClass" [1]=> string(12) "SomeFunction" }
Output for 4.3.2 - 4.4.9
array(2) { [0]=> string(9) "SomeClass" [1]=> string(12) "SomeFunction" } Fatal error: Cannot instantiate non-existent class: reflectionparameter in /in/A18vh on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
array(2) { [0]=> string(9) "SomeClass" [1]=> string(12) "SomeFunction" } Fatal error: Cannot instantiate non-existent class: reflectionparameter in /in/A18vh on line 20