3v4l.org

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