3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct (&$arr) { $this->arr = &$arr; } function createInstance () { $reflectionClass = new ReflectionClass("Bar"); return $reflectionClass->newInstanceArgs(array($this, $this->arr)); } function mod($key, $val) { $this->arr[$key] = $val; } } class Bar { function __construct (&$foo, &$arr) { $this->foo = &$foo; $this->arr = &$arr; } function mod($key, $val) { $this->arr[$key] = $val; } } $arr = array(); $foo = new Foo($arr); $arr["x"] = 1; $foo->mod("y", 2); $bar = $foo->createInstance(); $bar->mod("z", 3); var_dump($arr,$foo,$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.60.0070.01518.55
8.3.50.0040.01421.90
8.3.40.0070.01118.97
8.3.30.0100.00719.22
8.3.20.0040.00420.30
8.3.10.0080.00023.36
8.3.00.0050.00322.34
8.2.180.0100.00716.38
8.2.170.0070.00722.96
8.2.160.0110.00422.08
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0030.00626.16
8.2.120.0040.00419.35
8.2.110.0100.00019.37
8.2.100.0070.00417.84
8.2.90.0040.00419.21
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0030.00517.93
8.2.50.0050.00318.07
8.2.40.0080.00018.16
8.2.30.0040.00418.14
8.2.20.0080.00017.84
8.2.10.0040.00419.52
8.2.00.0000.00817.80
8.1.280.0110.01125.92
8.1.270.0040.00421.95
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0000.01022.62
8.1.230.0060.00617.95
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0040.00717.38
8.1.190.0060.00317.53
8.1.180.0030.00518.10
8.1.170.0080.00018.72
8.1.160.0040.00421.98
8.1.150.0040.00418.62
8.1.140.0070.00017.34
8.1.130.0030.00317.69
8.1.120.0040.00417.39
8.1.110.0030.00617.37
8.1.100.0000.00717.38
8.1.90.0000.00717.48
8.1.80.0000.00717.49
8.1.70.0000.00717.36
8.1.60.0040.00417.51
8.1.50.0050.00317.49
8.1.40.0040.00417.52
8.1.30.0000.00817.60
8.1.20.0030.00617.70
8.1.10.0090.00017.61
8.1.00.0030.00617.52
8.0.300.0070.00018.77
8.0.290.0040.00416.80
8.0.280.0040.00418.48
8.0.270.0070.00017.19
8.0.260.0000.00816.80
8.0.250.0070.00017.05
8.0.240.0030.00416.90
8.0.230.0040.00417.06
8.0.220.0070.00016.85
8.0.210.0070.00017.00
8.0.200.0070.00016.91
8.0.190.0040.00417.03
8.0.180.0000.00716.97
8.0.170.0050.00317.02
8.0.160.0030.00516.92
8.0.150.0000.00716.86
8.0.140.0040.00416.91
8.0.130.0030.00313.42
8.0.120.0040.00416.96
8.0.110.0040.00416.82
8.0.100.0030.00616.99
8.0.90.0000.00716.75
8.0.80.0040.01116.94
8.0.70.0080.00016.95
8.0.60.0070.00017.02
8.0.50.0050.00316.84
8.0.30.0110.01117.07
8.0.20.0090.01417.40
8.0.10.0040.00417.02
8.0.00.0120.00716.87
7.4.330.0000.00515.15
7.4.320.0030.00316.62
7.4.300.0000.00616.61
7.4.290.0040.00416.59
7.4.280.0040.00416.56
7.4.270.0030.00316.52
7.4.260.0000.00716.54
7.4.250.0080.00016.61
7.4.240.0020.00516.57
7.4.230.0000.00716.60
7.4.220.0040.01516.47
7.4.210.0070.00816.55
7.4.200.0040.00416.69
7.4.190.0040.00416.65
7.4.160.0080.00816.46
7.4.150.0110.01117.40
7.4.140.0110.01017.86
7.4.130.0090.00916.49
7.4.120.0090.01016.53
7.4.110.0160.01016.43
7.4.100.0100.00616.50
7.4.90.0110.00716.55
7.4.80.0160.00316.41
7.4.70.0120.00616.49
7.4.60.0130.00316.48
7.4.50.0030.00316.50
7.4.40.0090.00622.77
7.4.30.0080.00816.35
7.4.00.0050.00914.99
7.3.330.0050.00013.25
7.3.320.0050.00013.29
7.3.310.0030.00316.39
7.3.300.0070.00016.44
7.3.290.0090.01016.38
7.3.280.0100.01116.42
7.3.270.0090.00917.40
7.3.260.0040.01416.49
7.3.250.0140.00716.54
7.3.240.0080.01116.43
7.3.230.0090.01116.48
7.3.210.0130.01016.48
7.3.200.0130.00719.39
7.3.190.0110.00716.50
7.3.180.0070.01016.41
7.3.170.0090.01216.48
7.3.160.0130.00316.63
7.3.120.0070.01114.79
7.3.110.0140.00314.90
7.3.100.0100.00715.01
7.3.90.0040.01114.87
7.3.80.0060.00914.95
7.3.70.0000.00914.73
7.3.60.0030.01414.95
7.3.50.0120.00014.92
7.3.40.0030.00914.80
7.3.30.0040.01114.95
7.3.20.0070.00716.45
7.3.10.0080.00516.64
7.3.00.0070.00716.59
7.2.330.0100.01416.57
7.2.320.0110.01116.58
7.2.310.0140.00416.68
7.2.300.0090.01316.47
7.2.290.0140.00716.53
7.2.250.0130.00714.93
7.2.240.0100.01014.88
7.2.230.0030.01215.26
7.2.220.0000.01214.76
7.2.210.0130.00314.98
7.2.200.0070.00714.98
7.2.190.0130.00315.03
7.2.180.0030.01015.12
7.2.170.0040.00815.05
7.2.130.0070.00716.56
7.2.120.0070.00716.59
7.2.110.0060.00716.61
7.2.100.0220.00016.73
7.2.90.0090.00616.66
7.2.80.0060.00616.54
7.2.70.0000.01216.53
7.2.60.0150.00716.57
7.2.50.0120.00716.68
7.2.40.0040.01216.55
7.2.30.0040.01116.48
7.2.20.0160.00216.25
7.2.10.0090.00616.39
7.2.00.0070.00817.97
7.1.330.0070.00715.71
7.1.320.0040.00415.91
7.1.310.0080.00415.97
7.1.300.0100.00715.59
7.1.290.0030.01015.88
7.1.280.0060.00615.77
7.1.270.0030.00615.44
7.1.260.0090.00615.95
7.1.250.0100.00715.56
7.1.200.0070.00715.53
7.1.100.0080.00418.25
7.1.70.0000.00817.04
7.1.60.0090.01619.24
7.1.50.0000.02217.11
7.1.00.0070.07322.43
7.0.200.0060.00616.82
7.0.140.0030.07322.11
7.0.100.0370.05320.02
7.0.90.0070.08019.95
7.0.80.0030.08019.98
7.0.70.0230.05719.88
7.0.60.0270.07021.72
7.0.50.0030.09322.16
7.0.40.0100.06720.14
7.0.30.0130.04320.18
7.0.20.0070.08720.14
7.0.10.0230.06020.11
7.0.00.0100.06720.22
5.6.280.0070.07020.82
5.6.250.0030.06320.61
5.6.240.0030.07020.73
5.6.230.0130.08320.52
5.6.220.0200.05320.63
5.6.210.0100.08020.76
5.6.200.0070.05020.95
5.6.190.0070.07721.09
5.6.180.0130.07721.06
5.6.170.0100.06721.05
5.6.160.0070.09021.01
5.6.150.0170.06321.09
5.6.140.0170.04021.18
5.6.130.0100.08020.94
5.6.120.0070.06020.97
5.6.110.0100.04021.04
5.6.100.0000.08021.00
5.6.90.0030.05321.00
5.6.80.0030.04020.44
5.6.70.0030.08320.39
5.6.60.0070.06320.46
5.6.50.0200.04020.43
5.6.40.0170.06720.50
5.6.30.0130.07020.38
5.6.20.0070.08720.48
5.6.10.0070.08020.43
5.6.00.0000.05320.43
5.5.380.0100.05320.35
5.5.370.0030.09020.42
5.5.360.0030.09320.36
5.5.350.0030.06320.43
5.5.340.0170.07320.95
5.5.330.0030.08020.88
5.5.320.0100.08020.90
5.5.310.0100.07720.74
5.5.300.0030.08720.77
5.5.290.0100.06720.80
5.5.280.0000.06020.78
5.5.270.0100.06720.89
5.5.260.0070.08720.80
5.5.250.0070.07720.58
5.5.240.0030.04020.13
5.5.230.0130.04320.16
5.5.220.0070.08020.16
5.5.210.0030.04320.31
5.5.200.0100.07319.99
5.5.190.0130.05020.16
5.5.180.0030.07720.24
5.5.160.0170.06720.17
5.5.150.0170.06720.00
5.5.140.0030.06720.22
5.5.130.0170.06320.18
5.5.120.0070.04320.22
5.5.110.0070.04020.00
5.5.100.0100.07320.17
5.5.90.0200.05019.95
5.5.80.0100.05720.10
5.5.70.0130.07320.10
5.5.60.0070.08020.11
5.5.50.0070.04720.16
5.5.40.0100.07020.04
5.5.30.0100.07020.06
5.5.20.0130.06320.09
5.5.10.0070.07719.98
5.5.00.0000.08320.05
5.4.450.0130.04719.46
5.4.440.0070.07719.51
5.4.430.0070.07719.35
5.4.420.0100.07719.30
5.4.410.0030.07319.04
5.4.400.0030.04718.91
5.4.390.0070.07019.04
5.4.380.0100.04319.09
5.4.370.0070.04019.23
5.4.360.0030.08018.99
5.4.350.0030.08018.88
5.4.340.0030.06718.90
5.4.320.0130.06719.04
5.4.310.0070.08019.05
5.4.300.0100.04019.07
5.4.290.0100.06719.03
5.4.280.0030.07319.12
5.4.270.0070.07019.16
5.4.260.0030.08319.16
5.4.250.0100.04719.12
5.4.240.0030.07718.94
5.4.230.0000.08018.86
5.4.220.0030.08318.93
5.4.210.0100.08718.96
5.4.200.0070.04019.15
5.4.190.0100.07019.17
5.4.180.0070.07318.96
5.4.170.0170.04019.18
5.4.160.0170.06319.02
5.4.150.0100.07718.92
5.4.140.0070.04316.40
5.4.130.0100.05016.49
5.4.120.0070.04716.46
5.4.110.0070.04316.50
5.4.100.0130.06016.37
5.4.90.0070.07016.48
5.4.80.0030.07316.38
5.4.70.0130.05016.43
5.4.60.0070.04016.37
5.4.50.0030.06716.44
5.4.40.0130.06316.38
5.4.30.0070.07316.43
5.4.20.0030.04316.47
5.4.10.0030.07016.51
5.4.00.0100.07015.83
5.3.290.0200.07014.71
5.3.280.0130.03714.74
5.3.270.0100.08014.57
5.3.260.0000.04314.57
5.3.250.0070.04014.63
5.3.240.0070.07314.73
5.3.230.0070.05314.54
5.3.220.0070.07314.51
5.3.210.0100.07314.64
5.3.200.0130.06714.66
5.3.190.0100.07014.70
5.3.180.0070.08014.63
5.3.170.0070.07314.64
5.3.160.0000.04014.71
5.3.150.0030.03714.55
5.3.140.0070.06714.54
5.3.130.0130.07314.53
5.3.120.0070.04714.62
5.3.110.0100.05014.50
5.3.100.0030.07714.11
5.3.90.0100.04314.02
5.3.80.0100.07714.12
5.3.70.0070.07314.11
5.3.60.0070.07314.01
5.3.50.0030.08013.98
5.3.40.0030.07714.02
5.3.30.0130.05013.93
5.3.20.0070.05013.77
5.3.10.0030.07313.73
5.3.00.0030.05013.73
5.2.170.0030.05311.27
5.2.160.0030.05711.24
5.2.150.0070.06011.01
5.2.140.0000.04711.21
5.2.130.0000.03711.21
5.2.120.0100.04011.01
5.2.110.0170.03011.14
5.2.100.0030.03711.14
5.2.90.0000.06711.13
5.2.80.0070.03310.96
5.2.70.0000.06711.04
5.2.60.0070.05011.05
5.2.50.0100.05711.04
5.2.40.0070.05310.82
5.2.30.0030.05710.60
5.2.20.0000.07010.80
5.2.10.0100.04710.76
5.2.00.0070.06010.68
5.1.60.0070.0309.90
5.1.50.0070.0539.76
5.1.40.0000.0509.89
5.1.30.0130.04310.07
5.1.20.0030.03310.27
5.1.10.0030.0579.96
5.1.00.0030.03710.09
5.0.50.0100.0438.57
5.0.40.0030.0438.27
5.0.30.0070.0308.19
5.0.20.0030.0378.20
5.0.10.0000.0478.25
5.0.00.0000.0438.24
4.4.90.0030.0377.57
4.4.80.0070.0307.57
4.4.70.0070.0337.57
4.4.60.0000.0337.57
4.4.50.0030.0237.57
4.4.40.0000.0537.57
4.4.30.0000.0337.57
4.4.20.0000.0237.57
4.4.10.0100.0177.57
4.4.00.0070.0507.57
4.3.110.0000.0377.57
4.3.100.0030.0177.57
4.3.90.0070.0307.57
4.3.80.0030.0307.57
4.3.70.0070.0307.57
4.3.60.0000.0337.57
4.3.50.0070.0337.57
4.3.40.0000.0537.57
4.3.30.0030.0277.57
4.3.20.0000.0207.57
4.3.10.0070.0337.57
4.3.00.0000.0337.57

preferences:
51.24 ms | 401 KiB | 5 Q