3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Call a static method on a string class or object returned by // an instance method call $foo->bar()::baz(); class bla { static function bar(){ static $flag = 1; $flag++; if ($flag == 2 ) { return 'blee'; } if ($flag == 3){ return new blee; } } } class blee { static function $baz() { echo "Oh, for the baz of it!\n"; } } /**********************************/ $foo = new bla; echo $foo::bar()::$baz();
based on vjtV5
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '$baz' (T_VARIABLE) in /in/SF4ZQ on line 23
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/SF4ZQ on line 4
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/SF4ZQ on line 4
Process exited with code 255.