3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = ""; } $fooArr = [new Foo()]; function modifiesLocallyClonedFoo($fooArr) { $fooArr[0] = clone $fooArr[0]; $fooArr[0]->bar = "bar"; } modifiesLocallyClonedFoo($fooArr); var_dump($fooArr[0]); // Creating a reference to an array item changes the way the array behaves?!?!?!? $bar = &$fooArr[0]; modifiesLocallyClonedFoo($fooArr); var_dump($fooArr[0]);

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.5.00.0110.01220.16
8.4.150.0030.00014.05
8.4.140.0140.00717.62
8.4.130.0130.00818.85
8.4.120.0130.00724.18
8.4.110.0080.01222.68
8.4.100.0070.00417.83
8.4.90.0110.00918.44
8.4.80.0100.01019.59
8.4.70.0120.00817.95
8.4.60.0090.01219.05
8.4.50.0150.00520.68
8.4.40.0130.00717.43
8.4.30.0080.00820.51
8.4.20.0060.01317.94
8.4.10.0030.00617.49
8.3.280.0070.01318.25
8.3.270.0100.01316.52
8.3.260.0110.00616.42
8.3.250.0040.00418.84
8.3.240.0050.00417.02
8.3.230.0090.00816.42
8.3.220.0090.00917.30
8.3.210.0060.00216.40
8.3.200.0030.00616.58
8.3.190.0060.00316.79
8.3.180.0050.00418.82
8.3.170.0140.00417.41
8.3.160.0070.01118.41
8.3.150.0180.00016.71
8.3.140.0040.00716.54
8.3.130.0060.00918.38
8.3.120.0120.00619.08
8.3.110.0170.00020.94
8.3.100.0090.00624.06
8.3.90.0070.00326.77
8.3.80.0040.00418.21
8.3.70.0110.00716.58
8.3.60.0070.01316.63
8.3.50.0150.00319.77
8.3.40.0140.00020.46
8.3.30.0070.00718.71
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0100.00520.57
8.2.280.0140.00618.17
8.2.270.0110.00716.66
8.2.260.0110.00717.26
8.2.250.0030.00516.98
8.2.240.0090.00019.13
8.2.230.0040.00422.58
8.2.220.0080.00037.54
8.2.210.0130.00726.77
8.2.200.0060.00316.50
8.2.190.0070.00716.58
8.2.180.0060.00925.92
8.2.170.0090.00918.79
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0070.00026.16
8.2.110.0060.00319.23
8.2.100.0100.00317.75
8.2.90.0030.00517.63
8.2.80.0050.00318.77
8.2.70.0030.00517.75
8.2.60.0000.00817.50
8.2.50.0050.00317.98
8.2.40.0000.00817.91
8.2.30.0030.00518.10
8.2.20.0030.00520.32
8.2.10.0050.00217.88
8.2.00.0080.00019.30
8.1.330.0100.00822.05
8.1.320.0050.00416.15
8.1.310.0070.00716.64
8.1.300.0090.00618.14
8.1.290.0030.00618.88
8.1.280.0160.00025.92
8.1.270.0030.00524.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00319.13
8.1.230.0080.00317.77
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0040.00417.35
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0050.00317.62
8.1.160.0060.00318.84
8.1.150.0040.00418.70
8.1.140.0040.00417.46
8.1.130.0000.00718.85
8.1.120.0000.00717.44
8.1.110.0040.00417.50
8.1.100.0000.00817.46
8.1.90.0000.00817.37
8.1.80.0030.00617.41
8.1.70.0000.00717.36
8.1.60.0030.00517.61
8.1.50.0000.00817.47
8.1.40.0040.00417.45
8.1.30.0030.00517.67
8.1.20.0050.00317.58
8.1.10.0090.00017.54
8.1.00.0030.00617.54
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0000.00718.34
8.0.270.0030.00316.84
8.0.260.0000.00618.42
8.0.250.0050.00416.87
8.0.240.0040.00417.01
8.0.230.0030.00717.02
8.0.220.0030.00316.92
8.0.210.0070.00016.95
8.0.200.0030.00316.95
8.0.190.0060.00316.93
8.0.180.0040.00416.93
8.0.170.0030.00616.83
8.0.160.0080.00416.94
8.0.150.0040.00416.86
8.0.140.0050.00216.90
8.0.130.0000.00816.82
8.0.120.0000.00816.75
8.0.110.0040.00416.87
8.0.100.0040.00416.82
8.0.90.0080.00016.86
8.0.80.0020.00516.89
8.0.70.0030.00316.80
8.0.60.0070.00016.81
8.0.50.0040.00416.94
8.0.30.0070.00016.76
8.0.20.0000.00716.87
8.0.10.0040.00416.89
7.4.330.0030.00315.55
7.4.320.0000.00716.50
7.4.300.0000.00716.52
7.4.290.0000.00716.57
7.4.280.0040.00416.64
7.4.270.0000.00816.46
7.4.260.0000.00716.42
7.4.250.0030.00316.57
7.4.240.0030.00316.49
7.4.230.0050.00216.41
7.4.220.0030.00316.51
7.4.210.0000.00716.52
7.4.200.0070.00016.39
7.4.190.0070.00016.55
7.4.180.0030.00316.64
7.4.160.0040.00416.72
7.4.150.0040.00416.48
7.4.140.0070.00016.45
7.4.130.0040.00416.47
7.4.120.0000.00716.46
7.4.110.0030.00316.43
7.4.100.0040.00416.52
7.4.90.0040.00416.44
7.4.80.0070.00016.45
7.4.70.0000.00716.44
7.4.60.0040.00416.40
7.4.50.0070.00016.34
7.4.40.0070.00016.27
7.4.30.0030.00316.34
7.4.20.0030.00316.37
7.4.10.0000.00816.39
7.4.00.0030.00316.55

preferences:
151.72 ms | 403 KiB | 5 Q