3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function bar() { $x = array(); echo constant( 'self:' . ':xx' ); } } $a = new foo; $a->bar();
Output for 4.3.2 - 5.2.17, 5.3.3 - 7.1.0
Warning: constant(): Couldn't find constant self::xx in /in/7tD24 on line 5
Output for 5.3.0 - 5.3.2
Fatal error: Undefined class constant 'self::xx' in /in/7tD24 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: constant() [http://www.php.net/function.constant]: Couldn't find constant self::xx in /in/7tD24 on line 5