3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function bar($new = null) { static $bar = 'foo'; if ($new !== null) { $bar = $new; } return bar(); } } $f = new Foo; echo $f->bar() . "\n"; $f->bar('bar'); echo $f->bar() . "\n";
based on DPGgs
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function bar() in /in/s3FE7:13 Stack trace: #0 /in/s3FE7(19): Foo->bar() #1 {main} thrown in /in/s3FE7 on line 13
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function bar() in /in/s3FE7 on line 13
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: bar() in /in/s3FE7 on line 13
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: bar() in /in/s3FE7 on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: bar() in /in/s3FE7 on line 13