3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public function __get( $property ) { if ( 'bla' === $property ) { echo 'Initializing Text->bla' . PHP_EOL; $this->bla = 'Value'; return $this->bla; } trigger_error( 'Undefined property via __get(): ' . $property E_USER_NOTICE); return null; } } $test = new Test(); echo $test->bla . PHP_EOL; echo $test->bla . PHP_EOL; echo $test->bla . PHP_EOL; echo $test->kaka . PHP_EOL; echo $test->bla . PHP_EOL;
based on pGlHn
Output for 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'E_USER_NOTICE' (T_STRING), expecting ',' or ')' in /in/VvTj4 on line 13
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING, expecting ')' in /in/VvTj4:13 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'E_USER_NOTICE' (T_STRING) in /in/VvTj4 on line 13
Process exited with code 255.