3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { static $bar; if ( !$bar ) { $bar = 123; } var_dump($bar); } foo(); $refl = new ReflectionFunction( 'foo' ); $statics = $refl->getStaticVariables(); $statics['bar'] = 456; foo();
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(123) int(123)
Output for 4.3.2 - 4.4.9
int(123) Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/7hgsU on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
int(123) Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/7hgsU on line 12