3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class SampleClass { const MASS_Donkey_Bollocks = 1; public function __construct() { } } class AnotherClass { private $sampleClass; public function __construct() { $this->sampleClass = new SampleClass(); } public function doSomething() { echo 'hello'; var_export($this->sampleClass::MASS_Donkey_Bollocks); echo 'hello2'; } }
based on EL17u
Output for 7.0.0 - 7.2.0
Output for 5.4.12 - 5.6.28
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/n5NoF on line 27
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/n5NoF on line 27
Process exited with code 255.