3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); class Msg { var $x = array(); function a() { echo "CONSTRUCTOR CALLED\r\n"; } function setValue($name, $vaue) { $this->x[$name] = $value; } function getValue($name) { return $this->x[$name]; } } Msg::setValue("ERROR", 'Hello World!'); echo Msg::getValue("ERROR"); $a = new Msg(); echo $a->getValue("ERROR");

preferences:
62.47 ms | 402 KiB | 5 Q