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 s3FE7
Output for 4.3.0 - 7.1.0
foo bar