3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { public int $i; } $array = [new x, new x, new x]; $array[0]->i = 0; $array[1]->i = 1; $array[2]->i = 2; function foo(array $array) { $array[] = new x; $array[2]->i = 12; $array[3]->i = 3; print count($array)." elements in foo\n"; } print count($array)." elements before foo\n"; foo($array); print count($array)." elements after foo\n"; print_r($array[2]);

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.70.0080.00516.99
8.5.60.0050.00916.99
8.5.50.0110.00418.62
8.5.30.0300.00716.59
8.5.20.0300.00916.68
8.5.10.0240.01116.67
8.5.00.0110.00518.43
8.4.220.0060.00624.09
8.4.210.0030.00619.75
8.4.180.0320.00719.55
8.4.170.0310.01019.62
8.4.160.0270.00919.71
8.4.150.0330.00819.55
8.4.140.0370.00617.53
8.4.130.0340.00817.53
8.4.120.0390.01117.47
8.4.110.0290.00717.65
8.4.100.0390.00617.91
8.4.90.0340.01017.82
8.4.80.0340.01017.98
8.4.70.0310.00517.96
8.4.60.0160.00417.77
8.4.50.0150.00617.89
8.4.40.0260.00817.45
8.4.30.0210.00117.66
8.4.20.0200.00217.39
8.4.10.0140.00817.54
8.3.310.0060.00420.14
8.3.300.0180.00418.22
8.3.290.0150.00518.43
8.3.280.0120.00618.25
8.3.270.0150.00416.61
8.3.260.0280.01016.73
8.3.250.0300.00816.73
8.3.240.0380.00716.52
8.3.230.0350.00716.71
8.3.220.0310.00616.95
8.3.210.0310.00716.64
8.3.200.0350.00816.49
8.3.190.0340.00816.70
8.3.180.0280.01216.49
8.3.170.0360.00916.74
8.3.160.0340.00416.69
8.3.150.0350.00516.64
8.3.140.0340.00716.55
8.3.130.0190.00616.70
8.3.120.0140.00416.63
8.3.110.0310.00516.70
8.3.100.0320.01316.77
8.3.90.0380.00716.49
8.3.80.0350.00916.79
8.3.70.0320.01116.64
8.3.60.0380.00816.49
8.3.50.0400.00916.67
8.3.40.0330.01018.02
8.3.30.0250.00418.02
8.3.20.0230.00717.85
8.3.10.0240.01117.84
8.3.00.0250.00817.96
8.2.310.0090.00818.00
8.2.300.0460.00817.71
8.2.290.0320.00516.70
8.2.280.0290.01016.54
8.2.270.0300.01116.70
8.2.260.0220.00416.52
8.2.250.0270.01016.67
8.2.240.0320.00716.49
8.2.230.0300.00716.49
8.2.220.0270.01016.49
8.2.210.0340.00616.49
8.2.200.0290.01116.56
8.2.190.0280.00516.52
8.2.180.0290.00916.71
8.2.170.0200.00918.13
8.2.160.0130.00318.00
8.2.150.0140.00217.95
8.2.140.0110.00517.95
8.2.130.0330.00817.93
8.2.120.0310.00817.89
8.2.110.0260.00517.91
8.2.100.0280.00717.95
8.2.90.0250.01017.96
8.2.80.0310.00717.88
8.2.70.0300.00517.81
8.2.60.0220.00717.95
8.2.50.0240.01117.90
8.2.40.0320.00617.71
8.2.30.0290.00617.84
8.2.20.0350.01017.91
8.2.10.0300.00717.78
8.2.00.0300.00617.68
8.1.340.0290.01017.34
8.1.330.0280.00516.49
8.1.320.0260.00616.49
8.1.310.0250.00916.49
8.1.300.0290.01016.49
8.1.290.0290.00916.49
8.1.280.0300.00716.49
8.1.270.0290.00817.70
8.1.260.0330.00517.50
8.1.250.0300.00917.71
8.1.240.0280.00617.72
8.1.230.0260.00717.71
8.1.220.0310.00617.66
8.1.210.0300.00517.64
8.1.200.0280.00717.65
8.1.190.0260.00917.54
8.1.180.0290.00817.43
8.1.170.0300.00717.66
8.1.160.0240.01117.73
8.1.150.0290.00617.63
8.1.140.0280.00717.60
8.1.130.0220.00917.72
8.1.120.0270.00817.79
8.1.110.0220.00617.71
8.1.100.0140.00217.72
8.1.90.0130.00217.74
8.1.80.0110.00517.75
8.1.70.0160.00817.75
8.1.60.0150.00817.80
8.1.50.0200.01017.66
8.1.40.0140.00317.88
8.1.30.0380.00617.95
8.1.20.0280.00717.91
8.1.10.0250.01017.94
8.1.00.0260.00617.69
8.0.300.0200.00717.09
8.0.290.0100.00517.10
8.0.280.0130.00516.99
8.0.270.0210.00417.00
8.0.260.0200.00416.58
8.0.250.0210.00916.94
8.0.240.0240.00417.02
8.0.230.0200.00717.08
8.0.220.0170.00317.09
8.0.210.0180.00716.97
8.0.200.0280.00816.98
8.0.190.0270.00817.01
8.0.180.0240.01117.03
8.0.170.0340.00916.75
8.0.160.0220.00916.95
8.0.150.0150.00516.59
8.0.140.0130.00316.93
8.0.130.0190.00516.75
8.0.120.0180.00916.67
8.0.110.0270.01016.75
8.0.100.0140.01016.86
8.0.90.0110.00417.00
8.0.80.0120.00517.07
8.0.70.0180.00917.02
8.0.60.0190.00616.91
8.0.50.0240.00616.80
8.0.30.0230.00716.52
8.0.20.0130.00216.97
8.0.10.0130.00316.85
8.0.00.0190.00617.04
7.4.330.0270.00916.70
7.4.320.0350.00616.61
7.4.300.0270.00716.64
7.4.290.0250.00816.77
7.4.280.0250.00816.77
7.4.270.0220.01216.63
7.4.260.0270.00716.77
7.4.250.0310.00716.52
7.4.240.0300.00716.64
7.4.230.0230.00916.49
7.4.220.0240.00716.59
7.4.210.0230.00716.50
7.4.200.0250.00816.71
7.4.190.0260.00716.65
7.4.180.0280.01116.49
7.4.160.0290.00516.75
7.4.150.0190.01416.65
7.4.140.0160.00516.49
7.4.130.0130.00316.54
7.4.120.0180.00716.54
7.4.110.0170.00416.49
7.4.100.0250.00516.51
7.4.90.0250.00816.49
7.4.80.0230.01116.58
7.4.70.0220.00916.49
7.4.60.0250.00816.60
7.4.50.0280.00616.49
7.4.40.0260.00716.49
7.4.30.0240.00816.49
7.4.20.0260.00716.49
7.4.10.0290.00416.52
7.4.00.0240.00916.53
7.3.330.0210.01016.49
7.3.320.0300.00616.49
7.3.310.0250.00516.49
7.3.300.0230.00716.49
7.3.290.0120.00316.49
7.3.280.0200.00716.49
7.3.270.0250.00516.49
7.3.260.0200.00416.49
7.3.250.0270.00516.49
7.3.240.0260.00516.49
7.3.230.0270.00416.49
7.3.220.0210.00716.49
7.3.210.0200.00616.49
7.3.200.0200.00716.49
7.3.190.0190.00816.49
7.3.180.0220.00316.49
7.3.170.0220.00416.49
7.3.160.0250.00516.49
7.3.150.0250.00516.49
7.3.140.0290.00316.49
7.3.130.0230.00516.49
7.3.120.0260.00916.49
7.3.110.0230.00716.49
7.3.100.0260.00516.49
7.3.90.0240.01016.63
7.3.80.0230.00916.49
7.3.70.0280.00716.49
7.3.60.0290.00216.49
7.3.50.0220.00516.49
7.3.40.0230.00416.49
7.3.30.0190.00616.49
7.3.20.0250.00318.29
7.3.10.0260.00618.32
7.3.00.0260.00618.19
7.2.340.0240.00516.49
7.2.330.0230.00716.49
7.2.320.0240.00816.49
7.2.310.0240.01016.49
7.2.300.0220.01116.49
7.2.290.0210.00616.49
7.2.280.0200.00916.49
7.2.270.0230.00816.49
7.2.260.0220.00916.49
7.2.250.0280.00516.49
7.2.240.0330.00516.49
7.2.230.0240.00916.49
7.2.220.0240.01016.49
7.2.210.0240.00816.49
7.2.200.0230.00716.49
7.2.190.0240.00716.49
7.2.180.0260.00516.49
7.2.170.0250.00616.49
7.2.160.0260.00516.49
7.2.150.0230.01018.12
7.2.140.0240.00718.19
7.2.130.0260.00618.47
7.2.120.0280.00618.29
7.2.110.0210.00718.18
7.2.100.0260.00418.41
7.2.90.0270.00718.29
7.2.80.0240.00818.18
7.2.70.0260.00818.26
7.2.60.0230.00718.18
7.2.50.0250.01118.14
7.2.40.0240.00918.23
7.2.30.0200.00618.32
7.2.20.0230.00718.42
7.2.10.0190.00818.40
7.2.00.0230.00418.43
7.1.330.0180.00617.29
7.1.320.0250.00717.18
7.1.310.0270.00617.32
7.1.300.0240.00917.34
7.1.290.0240.00717.21
7.1.280.0220.00717.16
7.1.270.0260.00617.06
7.1.260.0180.01017.24
7.1.250.0230.00617.29
7.1.240.0210.00917.13
7.1.230.0220.00717.11
7.1.220.0260.00517.25
7.1.210.0250.01017.15
7.1.200.0230.00617.16
7.1.190.0240.00517.23
7.1.180.0220.00717.17
7.1.170.0240.00517.12
7.1.160.0240.00617.18
7.1.150.0240.00717.20
7.1.140.0210.00817.32
7.1.130.0250.00417.12
7.1.120.0240.00417.27
7.1.110.0160.00817.18
7.1.100.0190.00617.13
7.1.90.0250.00517.25
7.1.80.0210.00917.04
7.1.70.0220.00617.00
7.1.60.0110.00417.21
7.1.50.0220.00817.21
7.1.40.0220.00717.02
7.1.30.0260.00616.99
7.1.20.0250.00416.90
7.1.10.0240.00517.10
7.1.00.0230.00816.98
7.0.330.0230.00616.84
7.0.320.0240.00516.94
7.0.310.0230.00616.85
7.0.300.0230.00616.86
7.0.290.0190.00916.99
7.0.280.0220.00816.89
7.0.270.0290.00017.01
7.0.260.0220.00817.17
7.0.250.0190.00717.22
7.0.240.0260.00316.91
7.0.230.0240.00517.22
7.0.220.0230.00516.90
7.0.210.0200.00817.14
7.0.200.0230.00616.96
7.0.190.0200.00917.03
7.0.180.0240.00316.73
7.0.170.0210.00917.12
7.0.160.0270.00816.87
7.0.150.0330.00717.00
7.0.140.0220.00417.13
7.0.130.0210.00717.22
7.0.120.0270.00317.06
7.0.110.0190.00916.82
7.0.100.0180.01017.09
7.0.90.0250.00316.83
7.0.80.0260.00416.85
7.0.70.0280.00316.66
7.0.60.0190.00916.88
7.0.50.0230.00616.75
7.0.40.0160.00717.02
7.0.30.0160.00616.84
7.0.20.0230.00616.90
7.0.10.0210.00716.92
7.0.00.0240.00516.82
5.6.400.0250.00416.49
5.6.390.0230.00916.49
5.6.380.0270.00416.49
5.6.370.0250.00516.49
5.6.360.0270.00416.49
5.6.350.0250.00716.49
5.6.340.0250.00416.49
5.6.330.0270.00416.49
5.6.320.0230.00616.49
5.6.310.0210.00816.49
5.6.300.0220.00816.49
5.6.290.0220.00916.49
5.6.280.0220.00916.49
5.6.270.0260.00416.49
5.6.260.0220.00716.49
5.6.250.0210.00316.49
5.6.240.0190.00516.49
5.6.230.0180.00916.49
5.6.220.0270.00316.49
5.6.210.0200.00816.49
5.6.200.0250.00616.49
5.6.190.0270.00416.49
5.6.180.0240.00816.49
5.6.170.0230.00616.49
5.6.160.0210.00416.49
5.6.150.0200.00616.49
5.6.140.0290.00516.49
5.6.130.0230.00816.49
5.6.120.0280.00616.49
5.6.110.0260.00916.49
5.6.100.0230.00916.49
5.6.90.0190.00816.49
5.6.80.0180.00616.49
5.6.70.0190.00416.49
5.6.60.0210.00716.49
5.6.50.0210.01016.49
5.6.40.0170.00816.49
5.6.30.0160.00716.49
5.6.20.0290.00116.49
5.6.10.0240.00516.49
5.6.00.0180.00516.49
5.5.380.0190.00516.49
5.5.370.0250.00516.49
5.5.360.0260.00516.49
5.5.350.0210.00916.49
5.5.340.0240.00516.49
5.5.330.0230.00716.49
5.5.320.0270.00316.49
5.5.310.0230.00616.49
5.5.300.0250.00616.49
5.5.290.0260.00416.49
5.5.280.0160.00716.49
5.5.270.0160.00316.49
5.5.260.0240.00916.49
5.5.250.0230.00816.49
5.5.240.0190.00716.49
5.5.230.0140.00916.49
5.5.220.0130.00116.49
5.5.210.0140.00616.49
5.5.200.0200.00716.49
5.5.190.0240.00516.49
5.5.180.0210.00716.49
5.5.170.0220.00716.49
5.5.160.0230.00616.49
5.5.150.0180.00916.49
5.5.140.0230.00516.49
5.5.130.0230.00616.49
5.5.120.0230.00616.49
5.5.110.0260.00516.49
5.5.100.0240.00716.49
5.5.90.0220.00916.49
5.5.80.0210.00816.49
5.5.70.0220.00616.49
5.5.60.0220.00716.49
5.5.50.0210.00316.49
5.5.40.0230.00516.49
5.5.30.0210.00716.49
5.5.20.0220.00916.49
5.5.10.0220.00716.49
5.5.00.0190.00716.49
5.4.450.0160.00416.49
5.4.440.0190.00416.49
5.4.430.0170.00616.49
5.4.420.0180.00516.49
5.4.410.0160.00616.49
5.4.400.0170.00616.49
5.4.390.0190.00516.49
5.4.380.0200.00416.49
5.4.370.0170.00516.49
5.4.360.0120.00116.49
5.4.350.0090.00216.49
5.4.340.0100.00116.49
5.4.330.0090.00216.49
5.4.320.0090.00116.49
5.4.310.0080.00216.49
5.4.300.0160.00616.49
5.4.290.0100.00416.49
5.4.280.0090.00216.49
5.4.270.0170.00416.49
5.4.260.0200.00316.49
5.4.250.0200.00316.49
5.4.240.0190.00316.49
5.4.230.0180.00616.49
5.4.220.0150.00616.49
5.4.210.0200.00316.49
5.4.200.0100.00316.49
5.4.190.0140.00416.49
5.4.180.0090.00216.49
5.4.170.0100.00116.49
5.4.160.0220.00216.49
5.4.150.0190.00416.49
5.4.140.0200.00516.49
5.4.130.0190.00716.49
5.4.120.0180.00216.49
5.4.110.0150.00616.49
5.4.100.0140.00416.49
5.4.90.0100.00116.49
5.4.80.0110.00416.49
5.4.70.0090.00116.49
5.4.60.0080.00316.49
5.4.50.0140.00416.49
5.4.40.0180.00616.49
5.4.30.0170.00516.49
5.4.20.0170.00516.49
5.4.10.0160.00616.49
5.4.00.0170.00516.49
5.3.290.0160.00616.49
5.3.280.0170.00716.49
5.3.270.0170.00516.49
5.3.260.0160.00616.49
5.3.250.0190.00416.49
5.3.240.0190.00416.49
5.3.230.0190.00316.49
5.3.220.0180.00516.49
5.3.210.0170.00616.49
5.3.200.0150.00316.49
5.3.190.0130.00516.49
5.3.180.0090.00216.49
5.3.170.0090.00216.49
5.3.160.0170.00616.49
5.3.150.0180.00516.49
5.3.140.0170.00616.49
5.3.130.0180.00616.49
5.3.120.0160.00916.49
5.3.110.0180.00516.49
5.3.100.0130.00916.49
5.3.90.0160.00716.49
5.3.80.0180.00416.49
5.3.70.0190.00616.49
5.3.60.0170.00516.49
5.3.50.0160.00616.49
5.3.40.0160.00616.49
5.3.30.0170.00716.49
5.3.20.0190.00216.49
5.3.10.0160.00616.49
5.3.00.0160.00616.49
5.2.170.0130.00616.49
5.2.160.0130.00516.49
5.2.150.0140.00416.49
5.2.140.0130.00616.49
5.2.130.0120.00616.49
5.2.120.0120.00716.49
5.2.110.0110.00716.49
5.2.100.0150.00716.49
5.2.90.0180.00516.49
5.2.80.0140.00416.49
5.2.70.0110.00716.49
5.2.60.0150.00316.49
5.2.50.0080.00616.49
5.2.40.0160.00316.49
5.2.30.0100.00716.49
5.2.20.0150.00316.49
5.2.10.0140.00816.49
5.2.00.0150.00416.49
5.1.60.0130.00416.49
5.1.50.0100.00316.49
5.1.40.0090.00416.49
5.1.30.0110.00216.49
5.1.20.0130.00216.49
5.1.10.0130.00516.49
5.1.00.0100.00316.49
5.0.50.0090.00316.49
5.0.40.0100.00516.49
5.0.30.0090.00516.49
5.0.20.0090.00516.49
5.0.10.0090.00416.49
5.0.00.0100.00416.49
4.4.90.0080.00116.49
4.4.80.0060.00416.49
4.4.70.0060.00316.49
4.4.60.0070.00216.49
4.4.50.0080.00216.49
4.4.40.0080.00116.49
4.4.30.0050.00416.49
4.4.20.0090.00116.49
4.4.10.0070.00216.49
4.4.00.0060.00316.49
4.3.110.0060.00316.49
4.3.100.0070.00216.49
4.3.90.0050.00416.49
4.3.80.0070.00216.49
4.3.70.0050.00416.49
4.3.60.0060.00316.49
4.3.50.0070.00216.49
4.3.40.0080.00116.49
4.3.30.0050.00316.49
4.3.20.0050.00316.49
4.3.10.0040.00316.49
4.3.00.0050.00316.49

preferences:
65.68 ms | 2756 KiB | 5 Q