3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo; function __construct($foo) { $this->foo = $foo; } function modify($foo) { $o = clone $this; if (is_callable(array($o, '__construct'))) { $o->__construct($foo); } return $o; } function getFoo() { return $this->foo; } } $f = new Foo("foo"); var_dump($f->getFoo()); var_dump($f->modify("bar"));

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.40.0130.00318.81
8.3.30.0070.00718.67
8.3.20.0040.00418.78
8.3.10.0000.00818.66
8.3.00.0040.00419.38
8.2.170.0070.00722.96
8.2.160.0100.00320.35
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.48
8.2.110.0000.00922.26
8.2.100.0040.00817.78
8.2.90.0040.00419.22
8.2.80.0000.00917.97
8.2.70.0120.00017.50
8.2.60.0040.00417.80
8.2.50.0000.00817.92
8.2.40.0060.00319.23
8.2.30.0040.00717.57
8.2.20.0050.00317.67
8.2.10.0040.00417.59
8.2.00.0060.00317.59
8.1.270.0000.00724.66
8.1.260.0080.00026.35
8.1.250.0070.00428.09
8.1.240.0060.00323.91
8.1.230.0080.00319.15
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0030.00617.35
8.1.180.0080.00018.10
8.1.170.0000.00917.62
8.1.160.0000.00718.93
8.1.150.0040.00718.57
8.1.140.0000.00817.41
8.1.130.0000.00717.49
8.1.120.0030.00417.52
8.1.110.0000.00817.49
8.1.100.0040.00317.46
8.1.90.0030.00517.44
8.1.80.0030.00317.46
8.1.70.0030.00317.48
8.1.60.0000.00717.57
8.1.50.0000.00717.39
8.1.40.0060.00317.45
8.1.30.0040.00417.48
8.1.20.0060.00317.52
8.1.10.0000.00917.63
8.1.00.0080.00017.52
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0050.00318.50
8.0.270.0040.00417.14
8.0.260.0030.00316.77
8.0.250.0050.00316.93
8.0.240.0030.00616.97
8.0.230.0030.00516.95
8.0.220.0040.00316.83
8.0.210.0000.00716.91
8.0.200.0030.00316.92
8.0.190.0000.00817.00
8.0.180.0000.00816.81
8.0.170.0040.00416.78
8.0.160.0070.00016.86
8.0.150.0040.00416.88
8.0.140.0030.00616.89
8.0.130.0000.00613.31
8.0.120.0030.00616.79
8.0.110.0040.00416.92
8.0.100.0000.00716.89
8.0.90.0000.00716.96
8.0.80.0060.01016.95
8.0.70.0050.00316.78
8.0.60.0040.00416.94
8.0.50.0000.00816.72
8.0.30.0100.01317.14
8.0.20.0150.00317.16
8.0.10.0060.00317.04
8.0.00.0090.01016.87
7.4.330.0050.00013.00
7.4.320.0030.00316.56
7.4.300.0030.00316.62
7.4.290.0000.00716.63
7.4.280.0000.00816.48
7.4.270.0030.00316.44
7.4.260.0050.00013.30
7.4.250.0030.00516.44
7.4.240.0000.00716.48
7.4.230.0000.00716.63
7.4.220.0130.01416.59
7.4.210.0030.01016.47
7.4.200.0050.00216.36
7.4.190.0050.00316.67
7.4.160.0060.00916.50
7.4.150.0130.00316.55
7.4.140.0040.01417.86
7.4.130.0070.01316.48
7.4.120.0070.01016.40
7.4.110.0120.00616.47
7.4.100.0130.00516.57
7.4.90.0300.01316.48
7.4.80.0060.01219.39
7.4.70.0060.00916.62
7.4.60.0130.00316.45
7.4.50.0060.00016.53
7.4.40.0070.00716.63
7.4.30.0130.00716.54
7.4.00.0000.01715.05
7.3.330.0030.00313.33
7.3.320.0030.00513.24
7.3.310.0000.00716.21
7.3.300.0000.00616.32
7.3.290.0100.00516.30
7.3.280.0090.00916.25
7.3.270.0130.00416.21
7.3.260.0090.00916.37
7.3.240.0160.00616.57
7.3.230.0090.00916.36
7.3.210.0150.00416.55
7.3.200.0090.01216.64
7.3.190.0060.01016.22
7.3.180.0130.00316.29
7.3.170.0160.00616.31
7.3.160.0130.00316.55
7.3.120.0030.01414.87
7.2.330.0090.01316.52
7.2.320.0140.00916.73
7.2.310.0140.00416.78
7.2.300.0120.00616.32
7.2.290.0140.01116.27
7.2.00.0070.00719.17
7.1.100.0060.00617.95
7.1.70.0040.00416.78
7.1.60.0030.02019.21
7.1.50.0100.01416.93
7.1.00.0030.07322.41
7.0.200.0040.00416.96
7.0.140.0070.07022.09
7.0.120.0100.07022.13
7.0.60.0100.07719.94
7.0.50.0130.03017.96
7.0.40.0030.04017.75
7.0.30.0030.04017.79
7.0.20.0070.03717.73
7.0.10.0030.04017.78
7.0.00.0030.04017.75
5.6.280.0030.07321.12
5.6.210.0100.07720.51
5.6.200.0070.03718.31
5.6.190.0130.03018.19
5.6.180.0070.03718.18
5.6.170.0000.04718.23
5.6.160.0070.03718.23
5.6.150.0070.05018.14
5.6.140.0030.04318.21
5.6.130.0100.06718.18
5.6.120.0030.08318.18
5.6.110.0100.08018.13
5.6.100.0100.07718.26
5.6.90.0030.08718.16
5.6.80.0070.04717.56
5.6.70.0000.07017.55
5.6.60.0000.04717.66
5.6.50.0070.07017.58
5.6.40.0130.08017.55
5.6.30.0130.07317.53
5.6.20.0070.07717.54
5.6.10.0000.07017.50
5.6.00.0000.07317.63
5.5.350.0100.03320.36
5.5.340.0100.03318.09
5.5.330.0070.03718.07
5.5.320.0000.04317.98
5.5.310.0070.03718.02
5.5.300.0070.04317.96
5.5.290.0170.03318.08
5.5.280.0070.07717.98
5.5.270.0100.07317.98
5.5.260.0130.06718.07
5.5.250.0100.04717.76
5.5.240.0000.06717.40
5.5.230.0100.06017.39
5.5.220.0070.04717.32
5.5.210.0100.04317.32
5.5.200.0030.07017.30
5.5.190.0030.04717.36
5.5.180.0070.04317.42
5.5.160.0000.08317.39
5.5.150.0170.07017.30
5.5.140.0030.05317.33
5.5.130.0130.04717.36
5.5.120.0070.07717.38
5.5.110.0070.05317.32
5.5.100.0030.04017.18
5.5.90.0170.05017.17
5.5.80.0100.07317.20
5.5.70.0100.07717.17
5.5.60.0070.06017.19
5.5.50.0100.07017.19
5.5.40.0130.05717.31
5.5.30.0100.06017.19
5.5.20.0000.05317.20
5.5.10.0100.07317.31
5.5.00.0070.05717.21
5.4.450.0170.07019.45
5.4.440.0070.08019.36
5.4.430.0070.04019.35
5.4.420.0070.07319.37
5.4.410.0000.04719.32
5.4.400.0100.07719.11
5.4.390.0100.07319.02
5.4.380.0030.06019.05
5.4.370.0100.07719.02
5.4.360.0000.06319.01
5.4.350.0030.08718.89
5.4.340.0230.05319.04
5.4.320.0030.05719.05
5.4.310.0100.04319.10
5.4.300.0070.08018.88
5.4.290.0070.06319.09
5.4.280.0070.06019.03
5.4.270.0000.08319.01
5.4.260.0070.04719.07
5.4.250.0030.08019.02
5.4.240.0000.04719.05
5.4.230.0100.03319.13
5.4.220.0100.07319.06
5.4.210.0070.08019.02
5.4.200.0100.06719.02
5.4.190.0170.07019.11
5.4.180.0030.07319.05
5.4.170.0030.05319.08
5.4.160.0070.06319.07
5.4.150.0070.07318.95
5.4.140.0100.06716.41
5.4.130.0100.04716.54
5.4.120.0030.05016.43
5.4.110.0100.07316.23
5.4.100.0070.06716.55
5.4.90.0030.04716.35
5.4.80.0070.05316.37
5.4.70.0000.06716.62
5.4.60.0000.08316.45
5.4.50.0000.08016.53
5.4.40.0000.04016.36
5.4.30.0070.07316.29
5.4.20.0070.07016.45
5.4.10.0030.07716.61
5.4.00.0100.06015.98
5.3.290.0030.05714.68
5.3.280.0030.05014.65
5.3.270.0200.05714.66
5.3.260.0170.06714.63
5.3.250.0070.06714.60
5.3.240.0070.06014.82
5.3.230.0030.04714.61
5.3.220.0030.04014.65
5.3.210.0170.07014.61
5.3.200.0070.05314.64
5.3.190.0130.03014.60
5.3.180.0000.04014.65
5.3.170.0130.05314.53
5.3.160.0030.04314.41
5.3.150.0100.07314.61
5.3.140.0130.05014.63
5.3.130.0000.04714.59
5.3.120.0030.08014.60
5.3.110.0000.08014.55
5.3.100.0070.06714.09
5.3.90.0030.08014.02
5.3.80.0100.05013.98
5.3.70.0030.06314.06
5.3.60.0070.04314.05
5.3.50.0070.07714.00
5.3.40.0170.06713.95
5.3.30.0070.06013.97
5.3.20.0070.05313.77
5.3.10.0100.06313.66
5.3.00.0030.05013.63
5.2.170.0030.06011.00
5.2.160.0030.06311.04
5.2.150.0030.06711.14
5.2.140.0070.06011.19
5.2.130.0070.04711.12
5.2.120.0100.04011.07
5.2.110.0030.06011.14
5.2.100.0070.05711.14
5.2.90.0100.04010.95
5.2.80.0070.06011.20
5.2.70.0100.04311.06
5.2.60.0070.04311.06
5.2.50.0100.06311.09
5.2.40.0030.06011.22
5.2.30.0170.05010.86
5.2.20.0100.03310.96
5.2.10.0070.04010.76
5.2.00.0000.06310.82
5.1.60.0030.0239.95
5.1.50.0030.0379.84
5.1.40.0000.0579.95
5.1.30.0070.04710.40
5.1.20.0030.05710.37
5.1.10.0000.03310.29
5.1.00.0030.05710.05
5.0.50.0030.0408.86
5.0.40.0100.0378.86
5.0.30.0070.0338.86
5.0.20.0070.0338.86
5.0.10.0070.0238.86
5.0.00.0000.0438.86
4.4.90.0030.0308.86
4.4.80.0030.0338.86
4.4.70.0000.0208.86
4.4.60.0030.0178.86
4.4.50.0070.0308.86
4.4.40.0030.0378.86
4.4.30.0030.0308.86
4.4.20.0030.0338.86
4.4.10.0070.0278.86
4.4.00.0030.0538.86
4.3.110.0000.0378.86
4.3.100.0000.0378.86
4.3.90.0030.0238.86
4.3.80.0000.0278.86
4.3.70.0000.0208.86
4.3.60.0000.0278.86
4.3.50.0030.0178.86
4.3.40.0030.0478.86
4.3.30.0000.0378.86
4.3.20.0030.0308.86
4.3.10.0030.0378.86
4.3.00.0000.0378.86

preferences:
66.1 ms | 400 KiB | 5 Q