3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &getRowReference($array, $fn) { foreach ($array as $row) { if ($fn($row)) { return $row->content; } } } function qualifyingRow($row) { global $id; global $type; return $row->id == $id && $row->type == $type; } $id = 54; $type = 55; $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] ] ] ]; $ref = &getRowReference($array, 'qualifyingRow'); $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.00720.53
8.5.20.0050.00319.52
8.5.10.0070.01118.88
8.5.00.0120.01020.34
8.4.180.0100.01319.55
8.4.170.0100.01021.81
8.4.160.0080.01223.80
8.4.150.0080.00516.89
8.4.140.0090.01417.48
8.4.130.0140.00617.77
8.4.120.0120.00620.38
8.4.110.0050.00317.98
8.4.100.0130.00818.01
8.4.90.0050.00420.66
8.4.80.0100.00619.03
8.4.70.0100.00920.53
8.4.60.0090.01119.10
8.4.50.0080.00418.75
8.4.40.0160.00317.89
8.4.30.0030.00620.46
8.4.20.0200.00017.98
8.4.10.0100.00619.89
8.3.300.0040.00620.74
8.3.290.0120.00920.95
8.3.280.0120.00918.57
8.3.270.0130.00716.71
8.3.260.0100.00716.46
8.3.250.0130.00618.86
8.3.240.0100.00916.65
8.3.230.0050.00216.79
8.3.220.0120.00519.08
8.3.210.0040.00416.83
8.3.200.0070.00216.85
8.3.190.0090.01017.40
8.3.180.0110.00616.62
8.3.170.0090.00917.27
8.3.160.0000.01517.15
8.3.150.0060.01319.19
8.3.140.0180.00017.14
8.3.130.0030.00618.38
8.3.120.0130.00618.75
8.3.110.0110.00420.94
8.3.100.0100.00024.06
8.3.90.0060.00326.77
8.3.80.0090.00020.28
8.3.70.0110.00716.75
8.3.60.0120.00316.88
8.3.50.0040.01118.12
8.3.40.0040.01121.68
8.3.30.0080.00618.96
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0000.00826.16
8.2.300.0110.00922.20
8.2.290.0120.00916.98
8.2.280.0120.00820.39
8.2.270.0070.01117.36
8.2.260.0150.00318.47
8.2.250.0100.01017.07
8.2.240.0070.00719.03
8.2.230.0030.00622.58
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0060.00316.63
8.2.190.0100.01016.58
8.2.180.0110.00725.92
8.2.170.0100.01019.02
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00826.16
8.2.110.0070.00320.52
8.2.100.0080.00417.90
8.2.90.0030.00617.75
8.2.80.0080.00017.97
8.2.70.0080.00017.75
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0040.00418.14
8.2.20.0050.00220.32
8.2.10.0050.00317.80
8.2.00.0070.00019.19
8.1.340.0110.01017.86
8.1.330.0100.00816.35
8.1.320.0100.00918.06
8.1.310.0120.00618.37
8.1.300.0030.01518.52
8.1.290.0060.00318.88
8.1.280.0140.00425.92
8.1.270.0070.00023.99
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0060.00319.44
8.1.230.0070.00417.64
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0030.00618.10
8.1.170.0080.00018.45
8.1.160.0040.00418.77
8.1.150.0030.00518.65
8.1.140.0000.00817.47
8.1.130.0030.00319.03
8.1.120.0040.00417.49
8.1.110.0030.00517.45
8.1.100.0050.00317.50
8.1.90.0000.00717.47
8.1.80.0100.00017.46
8.1.70.0080.00017.51
8.1.60.0030.00617.43
8.1.50.0000.00817.54
8.1.40.0040.00417.41
8.1.30.0100.00017.50
8.1.20.0040.00417.60
8.1.10.0110.00217.54
8.1.00.0090.00017.50
8.0.300.0030.00518.77
8.0.290.0040.00416.75
8.0.280.0060.00320.22
8.0.270.0040.00418.04
8.0.260.0060.00018.37
8.0.250.0070.00017.04
8.0.240.0000.00817.02
8.0.230.0000.00817.02
8.0.220.0050.00216.86
8.0.210.0000.00816.85
8.0.200.0070.00017.05
8.0.190.0040.00416.91
8.0.180.0000.00716.89
8.0.170.0050.00316.94
8.0.160.0030.00616.84
8.0.150.0000.00816.90
8.0.140.0080.00516.83
8.0.130.0090.00616.85
8.0.120.0150.00516.92
8.0.110.0190.00016.82
8.0.100.0170.00316.95
8.0.90.0130.00916.88
8.0.80.0150.00616.95
8.0.70.0160.00316.80
8.0.60.0170.00316.88
8.0.50.0140.00616.92
8.0.30.0200.00016.83
8.0.20.0150.00517.02
8.0.10.0060.01317.10
8.0.00.0140.00017.11
7.4.330.0020.00215.55
7.4.320.0070.00016.51
7.4.300.0040.00416.49
7.4.290.0000.00816.57
7.4.280.0000.00816.51
7.4.270.0250.00016.42
7.4.260.0120.01216.59
7.4.250.0230.00016.51
7.4.240.0100.01016.49
7.4.230.0200.00416.55
7.4.220.0150.00616.56
7.4.210.0190.00016.51
7.4.200.0090.00916.58
7.4.190.0140.00616.51
7.4.180.0170.00316.54
7.4.160.0070.01116.58
7.4.150.0070.00716.45
7.4.140.0180.00016.45
7.4.130.0130.00316.50
7.4.120.0210.00016.38
7.4.110.0150.00016.48
7.4.100.0130.00516.53
7.4.90.0130.00516.41
7.4.80.0140.00316.54
7.4.70.0110.00516.53
7.4.60.0140.00016.51
7.4.50.0140.00216.43
7.4.40.0020.01016.43
7.4.30.0030.01016.26
7.4.20.0080.00416.46
7.4.10.0080.00816.48
7.4.00.0140.00216.49
7.3.330.0150.00516.18
7.3.320.0170.00316.47
7.3.310.0150.00316.25
7.3.300.0190.00016.46
7.3.290.0200.00016.36
7.3.280.0130.00816.21
7.3.270.0140.00516.35
7.3.260.0000.01416.19
7.3.250.0100.00316.21
7.3.240.0120.00016.18
7.3.230.0030.00716.38
7.3.220.0090.00016.21
7.3.210.0110.00316.47
7.3.200.0090.00916.41
7.3.190.0130.00316.33
7.3.180.0150.00016.46
7.3.170.0050.00316.20
7.3.160.0090.00016.26
7.3.150.0040.00416.35
7.3.140.0090.00216.45
7.3.130.0040.00416.39

preferences:
108.3 ms | 1504 KiB | 5 Q