3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { } class b extends a { protected $object; public function __construct() { $this->object = new stdClass(); $this->object->name = "default"; } public function setObject(a $object) { $this->object = $object; } public function getObject() { return $this->object; } public function __clone() { $this->object = clone $this->object; } } class runner { public $target; public function __construct() { parent::__construct(); $this->target = new b(); } public function run() { $object1 = new a(); $object1->name = "object1"; $object2 = new a(); $object2->name = "object2"; if (1 == 2) { // } elseif ($object1 instanceof $this->target->object) { $b2 = clone $this->target; $b2->object = $object1; echo $b2->getObject()->name; } } } $runner = new runner(); $runner->run();

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)
8.3.60.0080.01118.55
8.3.50.0100.00718.30
8.3.40.0140.00318.76
8.3.30.0100.00319.00
8.3.20.0070.00020.30
8.3.10.0050.00322.09
8.3.00.0070.00022.29
8.2.180.0170.00016.75
8.2.170.0190.00022.96
8.2.160.0100.00320.52
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0120.00626.16
8.2.120.0030.00619.23
8.2.110.0090.00021.98
8.2.100.0110.00317.53
8.2.90.0000.00718.96
8.2.80.0040.00417.97
8.2.70.0080.00017.38
8.2.60.0080.00017.93
8.2.50.0040.00418.07
8.2.40.0000.00918.09
8.2.30.0040.00417.77
8.2.20.0040.00417.59
8.2.10.0000.00719.34
8.2.00.0000.00717.47
8.1.270.0110.00421.93
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.82
8.1.230.0080.00319.16
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.23
8.1.190.0040.00417.28
8.1.180.0000.00918.10
8.1.170.0030.00618.51
8.1.160.0020.00521.89
8.1.150.0040.00418.44
8.1.140.0070.00017.38
8.1.130.0070.00017.80
8.1.120.0030.00317.36
8.1.110.0000.00717.21
8.1.100.0040.00417.23
8.1.90.0050.00217.33
8.1.80.0030.00317.24
8.1.70.0040.00417.36
8.1.60.0080.00017.45
8.1.50.0040.00417.40
8.1.40.0040.00417.29
8.1.30.0050.00217.45
8.1.20.0000.00817.49
8.1.10.0050.00217.35
8.1.00.0030.00617.21
8.0.300.0000.00718.77
8.0.290.0000.00717.05
8.0.280.0030.00318.18
8.0.270.0030.00317.15
8.0.260.0000.00716.70
8.0.250.0000.00716.86
8.0.240.0080.00016.78
8.0.230.0000.00716.81
8.0.220.0030.00316.75
8.0.210.0000.00716.84
8.0.200.0040.00416.91
8.0.190.0080.00016.82
8.0.180.0070.00016.87
8.0.170.0040.00416.86
8.0.160.0000.00716.82
8.0.150.0050.00216.81
8.0.140.0040.00416.78
8.0.130.0030.00313.23
8.0.120.0000.00716.75
8.0.110.0000.00816.81
8.0.100.0050.00316.79
8.0.90.0000.00716.88
8.0.80.0100.01316.82
8.0.70.0040.00316.68
8.0.60.0040.00416.70
8.0.50.0000.00816.71
8.0.30.0100.00917.04
8.0.20.0120.00617.40
8.0.10.0000.00716.83
8.0.00.0110.00716.52
7.4.330.0000.00515.07
7.4.320.0060.00016.49
7.4.300.0030.00316.55
7.4.290.0040.00416.57
7.4.280.0040.00416.54
7.4.270.0050.00316.52
7.4.260.0090.00016.52
7.4.250.0000.00716.47
7.4.240.0020.00516.45
7.4.230.0030.00316.38
7.4.220.0070.01816.63
7.4.210.0090.00716.48
7.4.200.0070.00016.53
7.4.190.0000.00816.59
7.4.160.0110.00416.54
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0110.00916.47
7.4.120.0080.01516.55
7.4.110.0060.01016.29
7.4.100.0120.00916.43
7.4.90.0130.00416.48
7.4.80.0190.00319.39
7.4.70.0110.01116.25
7.4.60.0080.00916.26
7.4.50.0090.00016.35
7.4.40.0070.00722.77
7.4.30.0100.00716.51
7.4.00.0070.01115.03
7.3.330.0020.00213.40
7.3.320.0060.00013.38
7.3.310.0000.00716.22
7.3.300.0070.00016.19
7.3.290.0060.01116.30
7.3.280.0110.00616.37
7.3.270.0080.00817.40
7.3.260.0090.00916.70
7.3.250.0050.01616.38
7.3.240.0030.01316.32
7.3.230.0040.01616.45
7.3.210.0180.00016.34
7.3.200.0040.01319.39
7.3.190.0170.00016.29
7.3.180.0060.00916.44
7.3.170.0100.00616.36
7.3.160.0090.00916.45
7.3.120.0060.01014.60
7.2.330.0060.01016.29
7.2.320.0140.00916.69
7.2.310.0130.00316.32
7.2.300.0120.01216.55
7.2.290.0070.00916.50
7.2.60.0040.00816.79
7.2.00.0000.01519.47
7.1.200.0120.00015.41
7.1.100.0080.00518.17
7.1.70.0070.00316.92
7.1.60.0130.01019.82
7.1.50.0070.01416.98
7.1.00.0030.07722.32
7.0.200.0030.00616.68
7.0.140.0030.07322.00
7.0.60.0070.08319.94
7.0.50.0030.04317.89
7.0.40.0030.04720.05
7.0.30.0230.05020.23
7.0.20.0400.07320.30
7.0.10.0230.08320.21
7.0.00.0100.04020.07
5.6.280.0000.07720.92
5.6.210.0170.02720.73
5.6.200.0030.05718.25
5.6.190.0030.09320.41
5.6.180.4200.03720.55
5.6.170.0470.07020.51
5.6.160.0130.07720.50
5.6.150.0100.03318.29
5.6.140.0030.04018.29
5.6.130.0100.03718.15
5.6.120.0070.08721.02
5.6.110.0030.08721.02
5.6.100.0100.06721.11
5.6.90.0130.05320.98
5.6.80.0030.03720.52
5.6.70.0230.07020.40
5.5.350.0170.07020.40
5.5.340.0030.05017.98
5.5.330.0030.07720.34
5.5.320.0170.05320.27
5.5.310.0300.07320.37
5.5.300.0070.06718.07
5.5.290.0070.09017.98
5.5.280.0030.09320.78
5.5.270.0100.07020.89
5.5.260.0070.04720.75
5.5.250.0100.06720.80
5.5.240.0030.08320.38
5.4.450.0070.06319.26
5.4.440.0170.05319.27
5.4.430.0100.06019.43
5.4.420.0100.05719.45
5.4.410.0100.05019.57
5.4.400.1670.00018.81
5.4.390.1900.00018.74
5.4.380.0200.05718.57
5.4.370.0130.05018.75
5.4.360.0200.04718.59
5.4.350.0200.05018.74
5.4.340.0100.05718.73
5.4.320.0090.03312.52
5.4.310.0050.04212.51
5.4.300.0050.04412.51
5.4.290.0100.03812.50
5.4.280.0100.03212.41
5.4.270.0170.06018.93
5.4.260.0070.06718.98
5.4.250.0170.07319.09
5.4.240.0270.06018.79
5.4.230.0170.07318.98
5.4.220.0230.04018.92
5.4.210.0170.07318.82
5.4.200.0200.06318.95
5.4.190.0230.06018.97
5.4.180.0030.06718.92
5.4.170.0100.07018.82
5.4.160.0170.06318.92
5.4.150.0070.07718.97
5.4.140.0130.07316.44
5.4.130.0100.07316.47
5.4.120.0030.05716.41
5.4.110.0100.07016.48
5.4.100.0100.06316.46
5.4.90.0070.05316.47
5.4.80.0100.05316.41
5.4.70.0130.05316.52
5.4.60.0100.05716.38
5.4.50.0070.05716.38
5.4.40.0070.06716.44
5.4.30.0100.07016.37
5.4.20.0170.05016.38
5.4.10.0130.06716.38
5.4.00.0030.07316.04
5.3.290.0090.04512.80
5.3.280.0100.06714.60
5.3.270.0070.07714.69
5.3.260.0070.07314.70
5.3.250.0070.08714.78
5.3.240.0130.06014.78
5.3.230.0170.04714.62
5.3.220.0100.05314.66
5.3.210.0130.06714.68
5.3.200.0130.07014.64
5.3.190.0130.06714.71
5.3.180.0100.05714.40
5.3.170.0070.07714.59
5.3.160.0130.06714.73
5.3.150.0270.05714.65
5.3.140.0070.06314.48
5.3.130.0070.08014.38
5.3.120.0030.06014.55
5.3.110.0200.06714.66
5.3.100.0070.07014.14
5.3.90.0070.05713.85
5.3.80.0170.06014.03
5.3.70.0070.05314.09
5.3.60.0230.04314.02
5.3.50.0100.06314.15
5.3.40.0070.06014.14
5.3.30.0100.07713.99
5.3.20.0170.05313.69
5.3.10.0030.05713.64
5.3.00.0070.07013.73
5.2.170.0170.05011.23
5.2.160.0100.05711.06
5.2.150.0170.04011.11
5.2.140.0200.04010.98
5.2.130.0170.05011.10
5.2.120.0170.04311.10
5.2.110.0170.04711.21
5.2.100.0030.06011.18
5.2.90.0100.04311.17
5.2.80.0000.05011.09
5.2.70.0070.06011.16
5.2.60.0130.05011.05
5.2.50.0170.05011.26
5.2.40.0070.05310.96
5.2.30.0070.06011.06
5.2.20.0230.05310.95
5.2.10.0130.05310.87
5.2.00.0130.04710.75
5.1.60.0070.0479.84
5.1.50.0000.0439.84
5.1.40.0070.0339.99
5.1.30.0100.05010.41
5.1.20.0070.05310.43
5.1.10.0230.0239.91
5.1.00.0000.04010.05
5.0.50.0030.0408.80
5.0.40.0030.0338.51
5.0.30.0000.0578.19
5.0.20.0030.0278.04
5.0.10.0070.0378.12
5.0.00.0030.0408.27
4.4.90.0000.0335.84
4.4.80.0070.0275.89
4.4.70.0070.0235.95
4.4.60.0070.0235.81
4.4.50.0100.0235.87
4.4.40.0030.0435.85
4.4.30.0000.0305.85
4.4.20.0070.0275.90
4.4.10.0100.0235.87
4.4.00.0030.0405.89
4.3.110.0030.0335.89
4.3.100.0000.0335.78
4.3.90.0130.0205.73
4.3.80.0000.0375.75
4.3.70.0030.0205.66
4.3.60.0070.0275.77
4.3.50.0070.0235.66
4.3.40.0130.0335.68
4.3.30.0030.0235.63
4.3.20.0030.0275.63
4.3.10.0070.0235.63
4.3.00.0000.0235.96

preferences:
54.89 ms | 400 KiB | 5 Q