3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class AbstractFoo { public $bar; public function __construct() { $this->bar = static::BAR; } } class Foo extends AbstractFoo { //const BAR = 'foobar'; } $foo = new Foo; //Fatal Error: Undefined class constant 'BAR' (uncomment const BAR = 'foobar';) echo $foo->bar;
based on MSND1
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Undefined class constant 'BAR' in /in/UJbip:8 Stack trace: #0 /in/UJbip(17): AbstractFoo->__construct() #1 {main} thrown in /in/UJbip on line 8
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Undefined class constant 'BAR' in /in/UJbip on line 8
Process exited with code 255.