3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace SomeNamespace; abstract class DictionaryKeepAliveIncrements{ CONST second = 1; CONST quarterminute = 15; CONST halfminute = 30; CONST minute = 60; } class A { public function getConst($name) { return constant('SomeNamespace\DictionaryKeepAliveIncrements::'.$name); } public function doSomething() { echo $this->getConst('minute'); } } $a = new A; $a->doSomething();

preferences:
28.79 ms | 402 KiB | 5 Q