3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { const PK = "B"; public function __construct() { $this->self = $this; } public function c() { $this->self::PK; } } $a = new A; $a->c();
based on n41iv
Output for 7.0.0 - 7.2.0
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/dE4hC on line 14
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/dE4hC on line 14
Process exited with code 255.