3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(version_compare(PHP_VERSION, '5.0') < 0) { die(); } class Concrete5_Helper_Date { const CONST1 = 'core1'; const CONST2 = 'core2'; public static function test1() { echo "test1.self: ", self::CONST1, ", ", self::CONST2, "\n"; echo "test1.static: ", static::CONST1, ", ", static::CONST2, "\n"; } } class DateHelper extends Concrete5_Helper_Date { const CONST2 = 'override2'; public static function test2() { echo "test2.self: ", self::CONST1, ", ", self::CONST2, "\n"; echo "test2.static: ", static::CONST1, ", ", static::CONST2, "\n"; } } DateHelper::test1(); DateHelper::test2();

preferences:
43.66 ms | 402 KiB | 5 Q