3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "id" => 54, "type" => 5, "content" => [ ["id" => 99, "type" => 516], ["id" => 88, "type" => 464], ["id" => 41, "type" => 845] ] ], [ "id" => 54, "type" => 55, "content" => [ ["id" => 54, "type" => 578], ["id" => 54, "type" => 354], ["id" => 75, "type" => 458] ] ], [ "id" => 65, "type" => 59, "content" => [ ["id" => 87, "type" => 5454], ["id" => 65, "type" => 245], ["id" => 65, "type" => 24525] ] ] ]; $id = 54; $type = 55; foreach ($array as &$row) { if ($row["id"] == $id && $row["type"] == $type) { $ref = &$row["content"]; } } $ref = 'this has been changed'; var_export($array);

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.30.0100.00920.83
8.5.20.0080.00819.42
8.5.10.0030.00418.57
8.5.00.0140.00820.25
8.4.180.0120.01120.66
8.4.170.0100.01123.93
8.4.160.0110.01022.97
8.4.150.0080.00516.88
8.4.140.0120.01017.61
8.4.130.0120.00919.47
8.4.120.0110.00920.59
8.4.110.0140.00922.29
8.4.100.0150.00520.39
8.4.90.0110.00918.84
8.4.80.0040.00418.75
8.4.70.0100.01017.92
8.4.60.0090.01118.90
8.4.50.0050.00320.29
8.4.40.0130.00617.49
8.4.30.0140.00320.35
8.4.20.0140.00719.73
8.4.10.0040.00419.49
8.3.300.0140.00818.29
8.3.290.0110.00920.54
8.3.280.0130.01018.38
8.3.270.0110.01216.64
8.3.260.0120.00816.52
8.3.250.0100.01018.94
8.3.240.0130.00618.71
8.3.230.0060.00316.69
8.3.220.0120.00618.93
8.3.210.0100.01016.74
8.3.200.0040.00516.86
8.3.190.0110.01117.16
8.3.180.0100.00816.80
8.3.170.0130.00617.31
8.3.160.0060.01218.39
8.3.150.0130.00320.87
8.3.140.0080.00017.36
8.3.130.0050.00318.57
8.3.120.0090.00918.71
8.3.110.0130.00320.94
8.3.100.0070.00424.06
8.3.90.0080.00026.77
8.3.80.0060.00320.37
8.3.70.0080.01118.31
8.3.60.0120.00316.75
8.3.50.0040.01118.28
8.3.40.0140.00021.88
8.3.30.0090.00618.84
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0050.00326.16
8.2.300.0120.00918.11
8.2.290.0080.01120.54
8.2.280.0140.00519.05
8.2.270.0140.00417.16
8.2.260.0150.00316.62
8.2.250.0050.00316.78
8.2.240.0090.00619.04
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0000.00826.77
8.2.200.0060.00316.63
8.2.190.0110.01116.58
8.2.180.0140.00425.92
8.2.170.0090.00619.04
8.2.160.0160.00022.96
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0090.00020.43
8.2.100.0040.00817.91
8.2.90.0000.00717.75
8.2.80.0020.00518.09
8.2.70.0030.00517.63
8.2.60.0050.00317.63
8.2.50.0080.00017.98
8.2.40.0000.00718.28
8.2.30.0040.00419.54
8.2.20.0030.00320.44
8.2.10.0040.00417.68
8.2.00.0040.00419.18
8.1.340.0100.01017.30
8.1.330.0120.00621.98
8.1.320.0090.00923.81
8.1.310.0080.00016.80
8.1.300.0080.00018.52
8.1.290.0060.00330.84
8.1.280.0100.00725.92
8.1.270.0060.00323.99
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0050.00322.16
8.1.230.0040.00819.16
8.1.220.0090.00017.88
8.1.210.0030.00518.77
8.1.200.0090.00017.36
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0030.00820.18
8.1.150.0000.00818.69
8.1.140.0000.00717.45
8.1.130.0030.00518.80
8.1.120.0040.00417.32
8.1.110.0000.00817.47
8.1.100.0030.00517.31
8.1.90.0040.00417.39
8.1.80.0040.00417.39
8.1.70.0000.00717.51
8.1.60.0080.00017.48
8.1.50.0000.00917.51
8.1.40.0040.00417.50
8.1.30.0040.00417.64
8.1.20.0030.00617.64
8.1.10.0180.01417.48
8.1.00.0200.01217.27
8.0.300.0070.00319.61
8.0.290.0040.00416.75
8.0.280.0040.00418.45
8.0.270.0000.00716.73
8.0.260.0030.00318.43
8.0.250.0030.00316.99
8.0.240.0030.00616.83
8.0.230.0030.00316.83
8.0.220.0090.00016.77
8.0.210.0030.00316.93
8.0.200.0040.00416.91
8.0.190.0000.00716.94
8.0.180.0040.00416.84
8.0.170.0060.00316.82
8.0.160.0040.00416.77
8.0.150.0040.00416.84
8.0.140.0180.00516.80
8.0.130.0240.00016.88
8.0.120.0150.01016.89
8.0.110.0170.00916.82
8.0.100.0150.00816.93
8.0.90.0190.00616.86
8.0.80.0190.00716.79
8.0.70.0270.00016.70
8.0.60.0240.00416.88
8.0.50.0180.00516.77
8.0.30.0180.00516.69
8.0.20.0240.00316.91
8.0.10.0240.00217.02
8.0.00.0040.00917.00
7.4.330.0000.00415.55
7.4.320.0000.00716.49
7.4.300.0060.00016.64
7.4.290.0000.00816.45
7.4.280.0000.00716.37
7.4.270.0200.00816.56
7.4.260.0230.00716.48
7.4.250.0160.01016.40
7.4.240.0180.00316.47
7.4.230.0140.00916.55
7.4.220.0180.00016.36
7.4.210.0170.00316.35
7.4.200.0170.00216.52
7.4.190.0160.00516.54
7.4.180.0170.00216.57
7.4.160.0130.00616.42
7.4.150.0160.00316.47
7.4.140.0080.00316.48
7.4.130.0110.00416.42
7.4.120.0170.00316.52
7.4.110.0170.00316.50
7.4.100.0050.01316.52
7.4.90.0040.01116.42
7.4.80.0170.00316.52
7.4.70.0070.00316.41
7.4.60.0200.00016.41
7.4.50.0140.00616.26
7.4.40.0140.00916.48
7.4.30.0180.00516.29
7.4.20.0180.00316.27
7.4.10.0210.00016.39
7.4.00.0220.00016.35
7.3.330.0140.00616.39
7.3.320.0220.00016.16
7.3.310.0200.00016.41
7.3.300.0120.00616.28
7.3.290.0180.00016.35
7.3.280.0150.00716.29
7.3.270.0110.00816.24
7.3.260.0190.00316.36
7.3.250.0180.00516.24
7.3.240.0090.00916.23
7.3.230.0190.00016.26
7.3.220.0110.01116.08
7.3.210.0130.00616.05
7.3.200.0120.00416.30
7.3.190.0090.00516.10
7.3.180.0080.00216.14
7.3.170.0050.00816.23
7.3.160.0080.00816.09
7.3.150.0130.00316.38
7.3.140.0120.00916.33
7.3.130.0110.00516.32

preferences:
58.21 ms | 1492 KiB | 5 Q