3v4l.org

run code in 300+ PHP versions simultaneously
<?php class b { 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 extends b { public $target; public function __construct() { parent::__construct(); $this->target = new b(); } public function run() { $object1 = new stdClass(); $object1->name = "object1"; $object2 = new stdClass(); $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.0090.00918.21
8.3.50.0140.00921.97
8.3.40.0040.01118.96
8.3.30.0030.01019.22
8.3.20.0040.00420.29
8.3.10.0060.00322.09
8.3.00.0060.00322.45
8.2.180.0100.01016.88
8.2.170.0130.00622.96
8.2.160.0110.00420.32
8.2.150.0000.00724.18
8.2.140.0050.00324.66
8.2.130.0070.01026.16
8.2.120.0040.00421.07
8.2.110.0060.00322.12
8.2.100.0130.00717.59
8.2.90.0000.00819.22
8.2.80.0000.00917.97
8.2.70.0040.00417.63
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0040.00418.22
8.2.30.0040.00418.08
8.2.20.0000.00817.63
8.2.10.0000.00819.56
8.2.00.0050.00217.70
8.1.280.0120.00625.92
8.1.270.0080.00022.24
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0060.00323.99
8.1.230.0110.00019.17
8.1.220.0090.00017.79
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0000.00817.53
8.1.180.0030.00518.10
8.1.170.0040.00418.49
8.1.160.0000.00821.95
8.1.150.0040.00418.46
8.1.140.0040.00417.38
8.1.130.0030.00317.82
8.1.120.0040.00417.34
8.1.110.0000.00717.45
8.1.100.0040.00417.41
8.1.90.0000.00717.36
8.1.80.0030.00317.45
8.1.70.0000.00717.36
8.1.60.0000.00917.47
8.1.50.0000.00717.53
8.1.40.0060.00317.53
8.1.30.0000.00817.68
8.1.20.0050.00317.62
8.1.10.0090.00017.54
8.1.00.0040.00417.37
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0000.00718.39
8.0.270.0030.00317.19
8.0.260.0060.00016.76
8.0.250.0000.00717.09
8.0.240.0080.00016.88
8.0.230.0040.00416.98
8.0.220.0040.00416.84
8.0.210.0040.00316.90
8.0.200.0050.00216.91
8.0.190.0030.00516.93
8.0.180.0000.00716.88
8.0.170.0030.00516.84
8.0.160.0070.00016.91
8.0.150.0000.00716.82
8.0.140.0000.00716.88
8.0.130.0030.00313.37
8.0.120.0040.00416.85
8.0.110.0040.00416.90
8.0.100.0030.00316.92
8.0.90.0000.00816.81
8.0.80.0210.00316.93
8.0.70.0000.00816.79
8.0.60.0000.00716.95
8.0.50.0000.00716.85
8.0.30.0100.01017.30
8.0.20.0120.00817.40
8.0.10.0090.00017.03
8.0.00.0080.00916.67
7.4.330.0000.00515.13
7.4.320.0060.00016.44
7.4.300.0000.00616.52
7.4.290.0090.00016.45
7.4.280.0070.00016.54
7.4.270.0030.00316.62
7.4.260.0060.00316.52
7.4.250.0040.00416.43
7.4.240.0050.00216.63
7.4.230.0030.00316.68
7.4.220.0090.00916.55
7.4.210.0100.00716.54
7.4.200.0030.00316.42
7.4.190.0030.00316.75
7.4.160.0090.00616.60
7.4.150.0040.01417.40
7.4.140.0120.00917.86
7.4.130.0150.00616.56
7.4.120.0140.00516.45
7.4.110.0090.00616.54
7.4.100.0100.01416.55
7.4.90.0090.00916.39
7.4.80.0090.01219.39
7.4.70.0140.00316.59
7.4.60.0110.00616.44
7.4.50.0040.00016.31
7.4.40.0070.00722.77
7.4.30.0130.00316.58
7.4.00.0030.01414.77
7.3.330.0020.00313.26
7.3.320.0000.00513.44
7.3.310.0030.00316.43
7.3.300.0070.00016.30
7.3.290.0130.00616.42
7.3.280.0080.01216.44
7.3.270.0130.00317.40
7.3.260.0120.01216.39
7.3.250.0130.00416.39
7.3.240.0090.00816.31
7.3.230.0030.01416.42
7.3.210.0100.00616.56
7.3.200.0030.01319.39
7.3.190.0100.01016.35
7.3.180.0080.00816.46
7.3.170.0030.01316.46
7.3.160.0140.00316.30
7.3.120.0040.01214.93
7.2.330.0110.00616.70
7.2.320.0140.01016.83
7.2.310.0030.01316.83
7.2.300.0170.00016.82
7.2.290.0130.01016.48
7.2.60.0090.00616.88
7.2.50.0060.00817.06
7.2.00.0030.01019.38
7.1.200.0070.00715.64
7.1.100.0030.01417.96
7.1.70.0000.01016.77
7.1.60.0160.01019.82
7.1.50.0090.01216.93
7.1.00.0030.07322.32
7.0.200.0040.00416.80
7.0.140.0070.07022.04
7.0.60.0200.07020.09
7.0.50.0030.04017.85
7.0.40.0030.07020.20
7.0.30.0230.03720.11
7.0.20.0370.05720.20
7.0.10.0230.07720.30
7.0.00.0070.04020.32
5.6.280.0030.07321.11
5.6.210.0030.04020.71
5.6.200.0100.06718.25
5.6.190.0030.06720.57
5.6.180.4230.04020.77
5.6.170.0330.07020.43
5.6.160.0070.07720.71
5.6.150.0070.04018.29
5.6.140.0030.04018.11
5.6.130.0030.05018.18
5.6.120.0130.05321.00
5.6.110.0030.09020.97
5.6.100.0030.08720.99
5.6.90.0070.07320.89
5.6.80.0030.03720.42
5.6.70.0370.07320.37
5.5.350.0000.04320.51
5.5.340.0100.04717.99
5.5.330.0130.06320.43
5.5.320.0200.05720.36
5.5.310.0230.08720.42
5.5.300.0000.06717.96
5.5.290.0070.07717.94
5.5.280.0030.08720.90
5.5.270.0130.03720.88
5.5.260.0070.04320.73
5.5.250.0270.05320.55
5.5.240.0100.06020.38
5.4.450.0130.06019.10
5.4.440.0100.06019.34
5.4.430.0130.05319.51
5.4.420.0130.05019.51
5.4.410.0130.06319.52
5.4.400.0800.00018.82
5.4.390.0900.00018.75
5.4.380.0330.07318.82
5.4.370.0100.05718.75
5.4.360.0130.05318.74
5.4.350.0170.05318.67
5.4.340.0170.05018.51
5.4.320.0070.03612.51
5.4.310.0050.04112.50
5.4.300.0060.03612.51
5.4.290.0040.04112.51
5.4.280.0030.03712.40
5.4.270.0030.06718.96
5.4.260.0070.07318.96
5.4.250.0170.07018.99
5.4.240.0200.06318.75
5.4.230.0100.06019.07
5.4.220.0100.07318.80
5.4.210.0130.06019.05
5.4.200.0100.06018.91
5.4.190.0070.06018.95
5.4.180.0200.06718.75
5.4.170.0100.05718.94
5.4.160.0130.05718.80
5.4.150.0100.06318.95
5.4.140.0030.06316.61
5.4.130.0100.06016.42
5.4.120.0070.07316.43
5.4.110.0130.06016.39
5.4.100.0070.06716.50
5.4.90.0070.07016.64
5.4.80.0200.05716.65
5.4.70.0100.05716.39
5.4.60.0070.05016.36
5.4.50.0030.07016.36
5.4.40.0230.05716.47
5.4.30.0130.04716.35
5.4.20.0030.05316.41
5.4.10.0200.06016.54
5.4.00.0130.06715.80
5.3.290.0050.04212.80
5.3.280.0100.06714.74
5.3.270.0170.06714.59
5.3.260.0130.07314.62
5.3.250.0170.06714.70
5.3.240.0070.06314.59
5.3.230.0100.05014.69
5.3.220.0100.06014.71
5.3.210.0200.06014.58
5.3.200.0130.06314.80
5.3.190.0100.06714.74
5.3.180.0100.05314.67
5.3.170.0130.05014.73
5.3.160.0130.06714.66
5.3.150.0100.05014.62
5.3.140.0170.05314.55
5.3.130.0170.06014.70
5.3.120.0030.06014.70
5.3.110.0170.06714.72
5.3.100.0070.06714.22
5.3.90.0130.06714.00
5.3.80.0100.04714.11
5.3.70.0170.05714.01
5.3.60.0200.04714.19
5.3.50.0070.07014.03
5.3.40.0100.07013.96
5.3.30.0170.05313.75
5.3.20.0270.05013.71
5.3.10.0130.06013.89
5.3.00.0030.07713.55
5.2.170.0070.04711.05
5.2.160.0170.05011.21
5.2.150.0070.04311.23
5.2.140.0070.05311.32
5.2.130.0100.04311.09
5.2.120.0030.04711.18
5.2.110.0030.05711.17
5.2.100.0130.05011.29
5.2.90.0100.05011.20
5.2.80.0000.04711.18
5.2.70.0130.04011.19
5.2.60.0100.05311.14
5.2.50.0070.05711.26
5.2.40.0070.04011.04
5.2.30.0000.06010.95
5.2.20.0130.03710.93
5.2.10.0100.04310.87
5.2.00.0030.05710.72
5.1.60.0070.0509.97
5.1.50.0130.0409.98
5.1.40.0000.0539.83
5.1.30.0070.04010.32
5.1.20.0200.03310.35
5.1.10.0100.04010.32
5.1.00.0030.0579.91
5.0.50.0030.0408.39
5.0.40.0070.0408.48
5.0.30.0100.0408.32
5.0.20.0030.0278.16
5.0.10.0070.0378.25
5.0.00.0070.0538.23
4.4.90.0030.0305.91
4.4.80.0000.0335.95
4.4.70.0300.0275.84
4.4.60.0000.0305.82
4.4.50.0100.0275.82
4.4.40.0100.0335.78
4.4.30.0100.0135.86
4.4.20.0030.0275.86
4.4.10.0070.0175.89
4.4.00.0000.0506.02
4.3.110.0070.0235.78
4.3.100.0100.0275.79
4.3.90.0030.0275.78
4.3.80.0070.0305.78
4.3.70.0070.0235.78
4.3.60.0100.0235.82
4.3.50.0100.0235.78
4.3.40.0030.0375.78
4.3.30.0070.0275.78
4.3.20.0030.0275.78
4.3.10.0030.0235.78
4.3.00.0000.0306.02

preferences:
51.9 ms | 401 KiB | 5 Q