3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object)[ "id" => 54, "type" => 5, "content" => [ ["id" => 99, "type" => 516], ["id" => 88, "type" => 464], ["id" => 41, "type" => 845] ] ], (object)[ "id" => 54, "type" => 55, "content" => [ ["id" => 54, "type" => 578], ["id" => 54, "type" => 354], ["id" => 75, "type" => 458] ] ], (object)[ "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.0110.00620.89
8.5.20.0110.00719.57
8.5.10.0030.00418.64
8.5.00.0070.01420.23
8.4.180.0140.00819.70
8.4.170.0100.01123.92
8.4.160.0090.01323.80
8.4.150.0060.00616.89
8.4.140.0100.01117.51
8.4.130.0100.01017.57
8.4.120.0130.00720.59
8.4.110.0100.00918.98
8.4.100.0110.01017.60
8.4.90.0120.00917.64
8.4.80.0140.00717.88
8.4.70.0110.00917.88
8.4.60.0100.01018.39
8.4.50.0110.00919.46
8.4.40.0130.00717.71
8.4.30.0120.00920.37
8.4.20.0030.01617.92
8.4.10.0170.00319.63
8.3.300.0160.00618.50
8.3.290.0120.00820.76
8.3.280.0080.00416.25
8.3.270.0100.00916.86
8.3.260.0120.00616.85
8.3.250.0130.00619.18
8.3.240.0130.00616.54
8.3.230.0100.00816.68
8.3.220.0030.00518.91
8.3.210.0040.00416.86
8.3.200.0040.00416.66
8.3.190.0050.00317.14
8.3.180.0150.00416.78
8.3.170.0030.01119.07
8.3.160.0070.01116.50
8.3.150.0160.00318.85
8.3.140.0070.00720.54
8.3.130.0040.00418.72
8.3.120.0160.00318.71
8.3.110.0030.00520.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0060.00316.63
8.3.70.0120.00418.30
8.3.60.0120.00916.48
8.3.50.0000.01419.96
8.3.40.0100.00322.03
8.3.30.0040.01118.79
8.3.20.0000.00724.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.300.0090.01118.25
8.2.290.0130.00520.50
8.2.280.0100.00818.44
8.2.270.0070.01017.24
8.2.260.0000.00816.43
8.2.250.0090.00016.59
8.2.240.0030.00518.86
8.2.230.0060.00322.58
8.2.220.0040.00437.54
8.2.210.0130.00326.77
8.2.200.0060.00316.50
8.2.190.0150.00816.75
8.2.180.0090.00625.92
8.2.170.0070.00719.04
8.2.160.0110.00422.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00326.16
8.2.110.0030.00619.21
8.2.100.0060.00619.63
8.2.90.0080.00017.88
8.2.80.0030.00517.97
8.2.70.0000.00817.50
8.2.60.0080.00017.75
8.2.50.0030.00517.98
8.2.40.0000.00817.91
8.2.30.0040.00419.60
8.2.20.0030.00320.44
8.2.10.0000.00717.70
8.2.00.0000.00719.30
8.1.340.0120.01017.69
8.1.330.0080.01118.34
8.1.320.0070.01216.17
8.1.310.0120.00618.32
8.1.300.0030.00618.14
8.1.290.0030.00618.88
8.1.280.0040.01125.92
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00919.13
8.1.230.0090.00319.16
8.1.220.0050.00317.79
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0000.00817.65
8.1.160.0040.00420.11
8.1.150.0070.00018.52
8.1.140.0000.00917.50
8.1.130.0040.00418.89
8.1.120.0030.00517.52
8.1.110.0000.00717.45
8.1.100.0000.00717.49
8.1.90.0080.00017.45
8.1.80.0040.00417.34
8.1.70.0030.00317.47
8.1.60.0030.00617.55
8.1.50.0060.00317.48
8.1.40.0080.00017.39
8.1.30.0030.00617.54
8.1.20.0040.00417.55
8.1.10.0100.00517.51
8.1.00.0170.00017.35
8.0.300.0080.00018.77
8.0.290.0070.00316.75
8.0.280.0000.00718.36
8.0.270.0040.00416.88
8.0.260.0030.00318.32
8.0.250.0000.00817.04
8.0.240.0040.00417.02
8.0.230.0070.00017.06
8.0.220.0030.00316.92
8.0.210.0050.00217.01
8.0.200.0000.00717.06
8.0.190.0090.00017.04
8.0.180.0050.00316.98
8.0.170.0000.00817.02
8.0.160.0050.00317.02
8.0.150.0000.00716.78
8.0.140.0060.00916.80
8.0.130.0200.00016.92
8.0.120.0200.00016.95
8.0.110.0160.00516.96
8.0.100.0160.00416.74
8.0.90.0170.00216.86
8.0.80.0150.00416.96
8.0.70.0120.00916.94
8.0.60.0140.00316.91
8.0.50.0100.00816.97
8.0.30.0080.00816.89
8.0.20.0140.00616.96
8.0.10.0140.00417.06
8.0.00.0060.00617.01
7.4.330.0000.00515.55
7.4.320.0060.00016.61
7.4.300.0030.00316.61
7.4.290.0000.00716.48
7.4.280.0030.00616.50
7.4.270.0120.00316.46
7.4.260.0080.00816.50
7.4.250.0210.00016.49
7.4.240.0200.00316.59
7.4.230.0170.00416.57
7.4.220.0180.00016.59
7.4.210.0150.00416.51
7.4.200.0110.00716.55
7.4.190.0150.00516.52
7.4.180.0190.00216.64
7.4.160.0180.00316.62
7.4.150.0070.01516.61
7.4.140.0130.00516.36
7.4.130.0090.00916.45
7.4.120.0120.00816.54
7.4.110.0120.00616.43
7.4.100.0030.00616.52
7.4.90.0100.00416.41
7.4.80.0030.00716.33
7.4.70.0120.00616.36
7.4.60.0130.00816.38
7.4.50.0140.00616.24
7.4.40.0210.00016.32
7.4.30.0160.00416.33
7.4.20.0190.00016.57
7.4.10.0180.00416.44
7.4.00.0120.00916.46
7.3.330.0190.00416.45
7.3.320.0170.00416.35
7.3.310.0130.00816.20
7.3.300.0170.00416.41
7.3.290.0200.00016.14
7.3.280.0150.00416.27
7.3.270.0170.00016.11
7.3.260.0190.00016.26
7.3.250.0110.00816.25
7.3.240.0140.00316.19
7.3.230.0180.00316.37
7.3.220.0140.00516.12
7.3.210.0140.00316.06
7.3.200.0150.00316.29
7.3.190.0150.00416.34
7.3.180.0120.00316.27
7.3.170.0120.00316.07
7.3.160.0110.00416.29
7.3.150.0150.00616.16
7.3.140.0100.00816.18
7.3.130.0100.00816.37

preferences:
45.21 ms | 1500 KiB | 5 Q