3v4l.org

run code in 200+ php & hhvm versions
<?php class A { public $baz = 'baz'; public static $qux = 'qux'; public static function foobar() { echo 'foobar' . PHP_EOL; } public function foo() { echo 'foo' . PHP_EOL; return $this; } public function bar() { $this::foo()->foo()::foo(); $this::foobar(); $this->foo()::foo(); $this->foobar(); } } $a = new A(); $a->bar();
based on rWd5v
Output for 7.0.33 - 7.3.1
foo foo foo foobar foo foo foobar
Output for 5.6.38
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/1dTbq on line 21
Process exited with code 255.