3v4l.org

run code in 300+ PHP versions simultaneously
<?php class XYZ{ static $mama = 1; var $papa = 1; } class ABCD extends XYZ { const girl = 2; static $boy = 3; function xyz($a) { $this->hello = self::girl + ABCD::girl + $a*2 + self::$boy + ABCD::$boy + parent::$mama; return $this->hello; } } $me = new ABCD(); echo $me->xyz(1) + $me->papa;
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.26, 7.4.0 - 7.4.14, 8.0.0 - 8.0.3
14