3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Animal { protected $what = "nothing"; protected $born; public function __construct() {} public function __construct($info) { $this->born = $info; } function sound() { echo get_class($this)." says {$this->what}"; } function getBorn() { return $this->born; } } class Cow extends Animal { protected $what = "moo"; protected $owner; public function __construct($owner,$b) { $this->owner = $owner; if ($b == 'Born') { parent::__construct(); } } } $a = new Cow("Old McDonald","Born"); $a->sound(); echo "Cow was born on ",date("M j, Y",$a->getBorn());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.340.0060.03612.03
5.4.320.0080.04812.51
5.4.310.0070.05312.51
5.4.300.0130.06212.51
5.4.290.0070.04412.51
5.4.280.0060.04412.40
5.4.270.0130.03812.40
5.4.260.0070.04812.40
5.4.250.0090.05212.41
5.4.240.0060.05612.41
5.4.230.0100.04412.40
5.4.220.0180.06912.40
5.4.210.0090.04912.40
5.4.200.0050.04812.39
5.4.190.0140.05212.39
5.4.180.0050.05112.39
5.4.170.0090.05812.41
5.4.160.0070.03912.40
5.4.150.0080.04712.40
5.4.140.0070.04112.08
5.4.130.0060.03812.07
5.4.120.0080.04712.03
5.4.110.0100.03512.03
5.4.100.0110.04612.02
5.4.90.0080.03912.03
5.4.80.0080.05012.02
5.4.70.0080.03712.02
5.4.60.0070.04712.02
5.4.50.0040.04012.02
5.4.40.0100.05512.00
5.4.30.0070.04112.00
5.4.20.0130.05012.00
5.4.10.0090.05812.00
5.4.00.0050.04211.50
5.3.290.0090.04112.80
5.3.280.0070.04412.71
5.3.270.0120.04612.72
5.3.260.0060.05412.72
5.3.250.0090.03812.72
5.3.240.0090.04412.72
5.3.230.0120.03712.71
5.3.220.0080.03912.68
5.3.210.0060.04412.68
5.3.200.0070.04112.68
5.3.190.0130.05912.67
5.3.180.0090.04012.68
5.3.170.0050.05112.67
5.3.160.0060.05212.67
5.3.150.0080.05112.68
5.3.140.0080.04712.66
5.3.130.0070.04612.66
5.3.120.0060.04712.66
5.3.110.0060.04612.66
5.3.100.0080.03512.12
5.3.90.0080.03412.10
5.3.80.0050.03712.09
5.3.70.0050.04012.09
5.3.60.0020.04212.08
5.3.50.0090.03612.03
5.3.40.0070.03812.03
5.3.30.0090.03511.98
5.3.20.0080.04211.77
5.3.10.0040.04911.73
5.3.00.0090.04111.71
5.2.170.0090.0439.23
5.2.160.0040.0309.22
5.2.150.0100.0269.22
5.2.140.0050.0339.22
5.2.130.0050.0319.18
5.2.120.0060.0279.18
5.2.110.0060.0279.18
5.2.100.0050.0299.18
5.2.90.0070.0289.18
5.2.80.0060.0319.17
5.2.70.0070.0299.17
5.2.60.0040.0329.13
5.2.50.0060.0299.09
5.2.40.0050.0289.07
5.2.30.0030.0319.05
5.2.20.0070.0339.04
5.2.10.0060.0348.94
5.2.00.0070.0288.81
5.1.60.0020.0278.09
5.1.50.0040.0258.09
5.1.40.0070.0258.07
5.1.30.0080.0248.42
5.1.20.0060.0298.45
5.1.10.0030.0368.16
5.1.00.0070.0368.16
5.0.50.0040.0266.64
5.0.40.0040.0276.50
5.0.30.0030.0396.32
5.0.20.0040.0196.28
5.0.10.0030.0216.26
5.0.00.0050.0316.25
4.4.90.0030.0164.78
4.4.80.0020.0164.75
4.4.70.0030.0164.76
4.4.60.0020.0184.76
4.4.50.0040.0274.77
4.4.40.0040.0264.71
4.4.30.0020.0184.75
4.4.20.0030.0164.85
4.4.10.0030.0164.85
4.4.00.0020.0284.76
4.3.110.0020.0184.67
4.3.100.0030.0154.66
4.3.90.0040.0154.63
4.3.80.0040.0234.58
4.3.70.0020.0154.63
4.3.60.0040.0284.63
4.3.50.0050.0174.63
4.3.40.0020.0244.54
4.3.30.0020.0183.30
4.3.20.0020.0173.28
4.3.10.0030.0143.23
4.3.00.0070.0206.86

preferences:
143.82 ms | 1394 KiB | 7 Q