3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test($var) { echo "Testing: $var\n"; } class foo { var $arr = array("test"); function bar($str) { $v[0] = "test"; $this->arr[0]($str); $this->v[0]($str); } } $foo = new foo; $foo->bar("bla");
based on PGBL6
Output for 7.0.0 - 7.2.0
Testing: bla Notice: Undefined property: foo::$v in /in/7pFP4 on line 16 Fatal error: Uncaught Error: Function name must be a string in /in/7pFP4:16 Stack trace: #0 /in/7pFP4(22): foo->bar('bla') #1 {main} thrown in /in/7pFP4 on line 16
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Testing: bla Notice: Undefined property: foo::$v in /in/7pFP4 on line 16 Fatal error: Function name must be a string in /in/7pFP4 on line 16
Process exited with code 255.