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 extends b { 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.0140.00718.43
8.3.50.0120.00821.93
8.3.40.0110.00718.72
8.3.30.0150.00019.09
8.3.20.0040.00420.34
8.3.10.0040.00422.09
8.3.00.0040.00422.48
8.2.180.0090.00618.41
8.2.170.0070.00722.96
8.2.160.0200.00020.38
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.01126.16
8.2.120.0060.00319.23
8.2.110.0070.00320.90
8.2.100.0090.00317.91
8.2.90.0000.00817.91
8.2.80.0050.00317.97
8.2.70.0070.00217.50
8.2.60.0000.00918.04
8.2.50.0000.01018.07
8.2.40.0000.00818.16
8.2.30.0070.00017.88
8.2.20.0000.00817.65
8.2.10.0040.00419.46
8.2.00.0040.00417.75
8.1.280.0110.01125.92
8.1.270.0060.00322.01
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0000.01121.90
8.1.230.0110.00020.88
8.1.220.0040.00417.74
8.1.210.0000.00818.90
8.1.200.0030.00617.35
8.1.190.0040.00417.17
8.1.180.0040.00418.10
8.1.170.0030.00518.49
8.1.160.0060.00321.83
8.1.150.0040.00418.43
8.1.140.0040.00417.34
8.1.130.0000.00717.34
8.1.120.0000.00717.24
8.1.110.0050.00217.29
8.1.100.0000.00817.36
8.1.90.0000.00717.25
8.1.80.0000.00717.24
8.1.70.0070.00017.31
8.1.60.0080.00017.39
8.1.50.0040.00417.36
8.1.40.0030.00617.50
8.1.30.0050.00217.52
8.1.20.0040.00417.50
8.1.10.0040.00417.50
8.1.00.0050.00317.42
8.0.300.0000.00719.98
8.0.290.0050.00217.04
8.0.280.0030.00318.39
8.0.270.0000.00716.83
8.0.260.0040.00416.78
8.0.250.0000.00716.85
8.0.240.0000.00717.00
8.0.230.0000.00716.80
8.0.220.0030.00316.79
8.0.210.0000.00616.81
8.0.200.0060.00016.91
8.0.190.0000.00816.96
8.0.180.0060.00516.82
8.0.170.0030.00516.93
8.0.160.0050.00316.81
8.0.150.0030.00316.86
8.0.140.0000.00716.91
8.0.130.0060.00013.32
8.0.120.0050.00316.92
8.0.110.0040.00416.73
8.0.100.0040.00416.84
8.0.90.0000.00716.92
8.0.80.0030.01716.94
8.0.70.0040.00416.89
8.0.60.0040.00416.93
8.0.50.0050.00216.72
8.0.30.0100.00817.08
8.0.20.0130.00617.40
8.0.10.0000.00717.03
8.0.00.0090.01016.79
7.4.330.0000.00615.00
7.4.320.0030.00316.48
7.4.300.0070.00016.53
7.4.290.0040.00416.44
7.4.280.0040.00416.55
7.4.270.0000.00716.61
7.4.260.0040.00416.49
7.4.250.0000.00716.57
7.4.240.0050.00316.62
7.4.230.0000.00616.64
7.4.220.0070.01116.57
7.4.210.0090.00716.51
7.4.200.0000.00816.20
7.4.190.0040.00416.41
7.4.160.0070.01016.49
7.4.150.0070.01117.40
7.4.140.0130.00517.86
7.4.130.0090.00916.55
7.4.120.0050.01316.45
7.4.110.0040.01216.27
7.4.100.0060.01216.57
7.4.90.0150.00416.45
7.4.80.0030.02119.39
7.4.70.0070.01116.47
7.4.60.0030.01316.53
7.4.50.0000.00516.34
7.4.40.0090.00922.77
7.4.30.0060.01016.41
7.4.00.0060.01014.95
7.3.330.0000.00513.38
7.3.320.0050.00013.36
7.3.310.0000.00716.36
7.3.300.0030.00316.25
7.3.290.0070.01316.35
7.3.280.0120.00416.36
7.3.270.0090.00917.40
7.3.260.0120.00916.38
7.3.250.0090.00816.62
7.3.240.0100.00716.54
7.3.230.0060.01616.58
7.3.210.0090.00916.58
7.3.200.0070.01019.39
7.3.190.0070.01016.58
7.3.180.0130.00316.49
7.3.170.0060.00916.32
7.3.160.0090.01216.47
7.3.120.0120.00314.81
7.3.110.0070.01114.83
7.3.100.0000.01014.99
7.3.90.0090.00014.81
7.3.80.0040.00814.88
7.3.70.0030.01014.64
7.3.60.0090.00614.60
7.3.50.0100.00714.95
7.3.40.0080.00414.71
7.3.30.0080.00614.83
7.3.20.0030.01216.69
7.3.10.0040.01116.78
7.3.00.0070.00716.64
7.2.330.0000.01616.47
7.2.320.0130.01016.27
7.2.310.0110.00616.32
7.2.300.0160.00716.47
7.2.290.0100.00616.41
7.2.250.0030.01214.64
7.2.240.0070.01314.76
7.2.230.0070.00714.83
7.2.220.0120.00314.91
7.2.210.0070.01114.63
7.2.200.0100.00714.82
7.2.190.0000.01715.03
7.2.180.0080.00314.86
7.2.170.0070.00714.62
7.2.60.0040.00816.69
7.2.00.0000.01519.45
7.1.330.0070.01015.55
7.1.320.0040.00815.55
7.1.310.0090.00615.30
7.1.300.0080.00415.69
7.1.290.0080.00415.73
7.1.280.0060.00815.50
7.1.270.0080.00515.45
7.1.260.0070.00715.02
7.1.200.0060.00915.53
7.1.100.0030.01017.57
7.1.70.0000.01016.99
7.1.60.0070.01719.82
7.1.50.0100.01016.70
7.1.00.0070.07322.48
7.0.200.0040.00416.68
7.0.140.0070.07022.10
7.0.60.0070.08019.88
7.0.50.0100.08017.91
7.0.40.0030.04320.09
7.0.30.0230.06720.07
7.0.20.0170.05020.21
7.0.10.0130.03720.25
7.0.00.0130.04720.23
5.6.280.0000.07721.03
5.6.210.0130.07320.68
5.6.200.0100.06718.19
5.6.190.0100.07320.41
5.6.180.0470.07320.63
5.6.170.0370.07720.71
5.6.160.0030.07320.54
5.6.150.0070.07018.27
5.6.140.0100.04018.21
5.6.130.0070.08318.17
5.6.120.0070.07021.15
5.6.110.0100.05721.08
5.6.100.0100.04721.14
5.6.90.0100.04320.89
5.6.80.0070.03720.40
5.5.350.0400.04020.37
5.5.340.0070.08018.08
5.5.330.0030.04020.42
5.5.320.0030.04320.24
5.5.310.0300.07320.25
5.5.300.0030.04017.93
5.5.290.0130.07018.01
5.5.280.0100.08320.89
5.5.270.0070.04720.96
5.5.260.0070.08320.80
5.5.250.0100.07720.79
5.5.240.0100.03720.05
5.4.450.0970.05019.59
5.4.440.0100.06019.31
5.4.430.0130.05019.63
5.4.420.0030.06319.42
5.4.410.0070.05719.42
5.4.400.1630.00018.77
5.4.390.1970.00018.74
5.4.380.0200.06018.59
5.4.370.0200.04718.57
5.4.360.0200.06318.79
5.4.350.0230.04718.59
5.4.340.0170.04718.59
5.4.320.0080.03612.51
5.4.310.0040.04012.51
5.4.300.0100.03512.51
5.4.290.0090.04812.51
5.4.280.0080.04612.40
5.4.270.0070.07718.95
5.4.260.0200.05318.82
5.4.250.0030.06018.96
5.4.240.0130.06019.02
5.4.230.0170.06318.64
5.4.220.0100.05718.78
5.4.210.0170.07018.64
5.4.200.0200.06018.76
5.4.190.0200.06718.98
5.4.180.0070.05718.99
5.4.170.0130.07318.92
5.4.160.0100.07318.91
5.4.150.0170.06718.95
5.4.140.0030.06016.52
5.4.130.0100.06016.66
5.4.120.0170.06716.50
5.4.110.0030.08016.45
5.4.100.0130.05016.51
5.4.90.0170.06716.56
5.4.80.0170.04716.41
5.4.70.0070.06016.68
5.4.60.0200.05716.39
5.4.50.0070.06016.30
5.4.40.0130.06016.50
5.4.30.0100.06716.46
5.4.20.0130.06316.38
5.4.10.0070.07016.34
5.4.00.0230.05315.98
5.3.290.0150.03412.80
5.3.280.0130.06314.59
5.3.270.0170.07014.63
5.3.260.0070.06014.84
5.3.250.0230.03714.70
5.3.240.0100.06014.69
5.3.230.0170.05014.57
5.3.220.0170.06714.59
5.3.210.0200.05014.48
5.3.200.0100.05314.59
5.3.190.0030.07714.66
5.3.180.0230.05714.63
5.3.170.0030.05714.75
5.3.160.0070.05314.66
5.3.150.0100.05714.66
5.3.140.0130.06714.66
5.3.130.0130.05714.54
5.3.120.0070.05714.63
5.3.110.0030.06014.54
5.3.100.0100.05014.18
5.3.90.0030.06314.05
5.3.80.0000.07713.86
5.3.70.0070.06714.02
5.3.60.0170.04314.01
5.3.50.0070.06714.05
5.3.40.0170.04714.03
5.3.30.0070.05013.75
5.3.20.0130.06013.78
5.3.10.0030.07013.74
5.3.00.0130.06713.72
5.2.170.0130.04011.32
5.2.160.0070.04711.07
5.2.150.0030.05311.25
5.2.140.0070.05711.22
5.2.130.0030.05311.02
5.2.120.0170.04710.94
5.2.110.0030.06011.20
5.2.100.0100.03711.06
5.2.90.0130.04011.11
5.2.80.0030.06311.08
5.2.70.0200.03711.19
5.2.60.0070.05711.29
5.2.50.0070.04711.21
5.2.40.0170.04711.01
5.2.30.0070.05311.05
5.2.20.0100.03710.92
5.2.10.0130.04710.96
5.2.00.0030.04710.91
5.1.60.0070.0409.96
5.1.50.0130.0379.98
5.1.40.0100.0339.98
5.1.30.0100.03310.43
5.1.20.0000.05710.34
5.1.10.0030.04710.23
5.1.00.0100.03310.14
5.0.50.0170.0208.39
5.0.40.0030.0338.66
5.0.30.0100.0408.39
5.0.20.0000.0308.24
5.0.10.0030.0438.34
5.0.00.0100.0378.18
4.4.90.0000.0275.87
4.4.80.0100.0205.79
4.4.70.0100.0205.80
4.4.60.0030.0275.80
4.4.50.0100.0175.82
4.4.40.0030.0505.85
4.4.30.0000.0275.82
4.4.20.0000.0275.95
4.4.10.0030.0235.89
4.4.00.0030.0335.80
4.3.110.0070.0205.76
4.3.100.0000.0235.89
4.3.90.0000.0305.79
4.3.80.0000.0375.77
4.3.70.0070.0235.76
4.3.60.0000.0205.76
4.3.50.0070.0235.82
4.3.40.0030.0375.75
4.3.30.0000.0235.75
4.3.20.0030.0205.75
4.3.10.0030.0305.65
4.3.00.0000.0236.99

preferences:
57.33 ms | 400 KiB | 5 Q