3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total = array(); $total[] = array( "id" => 1, "account" => "hello world", "item" => "package", "quantity" => 10 ); $total[] = array( "id" => 2, "account" => "foo", "item" => "world", "quantity" => 100 ); $maxtotal; foreach ($total as $key => $value) { // $value is an array() with id, account, item, quantity $maxtotal = array_search( max($value), $value); // doesn't work } print_r( $maxtotal ); // should print out the array with id=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.3.70.0040.01218.30
8.3.60.0100.01016.63
8.3.50.0100.01017.39
8.3.40.0140.00018.58
8.3.30.0120.00618.77
8.3.20.0080.00018.63
8.3.10.0030.00520.54
8.3.00.0090.00019.38
8.2.180.0040.01116.32
8.2.170.0100.01022.96
8.2.160.0130.00321.05
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00520.82
8.2.110.0100.00021.00
8.2.100.0090.00317.72
8.2.90.0000.00919.41
8.2.80.0080.00019.28
8.2.70.0000.00817.63
8.2.60.0040.00418.03
8.2.50.0070.00418.07
8.2.40.0040.00418.29
8.2.30.0040.00418.03
8.2.20.0070.00017.59
8.2.10.0060.00317.75
8.2.00.0070.00317.60
8.1.280.0070.00725.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00322.57
8.1.230.0090.00320.92
8.1.220.0040.00417.74
8.1.210.0060.00318.97
8.1.200.0030.00617.35
8.1.190.0000.00717.41
8.1.180.0090.00018.10
8.1.170.0040.00420.50
8.1.160.0040.00418.88
8.1.150.0040.00418.62
8.1.140.0040.00417.45
8.1.130.0030.00317.80
8.1.120.0030.00317.42
8.1.110.0040.00417.34
8.1.100.0070.00017.43
8.1.90.0000.00717.45
8.1.80.0000.00817.42
8.1.70.0030.00717.45
8.1.60.0090.00017.54
8.1.50.0030.00617.43
8.1.40.0040.00417.44
8.1.30.0060.00317.63
8.1.20.0000.00817.55
8.1.10.0050.00217.46
8.1.00.0020.00517.39
8.0.300.0000.00720.03
8.0.290.0030.00516.75
8.0.280.0070.00018.49
8.0.270.0070.00017.27
8.0.260.0000.00816.82
8.0.250.0030.00716.89
8.0.240.0050.00216.85
8.0.230.0040.00416.96
8.0.220.0000.00816.89
8.0.210.0000.00816.91
8.0.200.0030.00316.96
8.0.190.0040.00416.86
8.0.180.0040.00416.89
8.0.170.0040.00416.94
8.0.160.0000.00816.90
8.0.150.0050.00516.85
8.0.140.0090.00316.85
8.0.130.0030.00313.38
8.0.120.0040.00416.85
8.0.110.0000.00716.74
8.0.100.0070.00016.79
8.0.90.0070.00016.98
8.0.80.0060.00916.92
8.0.70.0040.00416.93
8.0.60.0030.00516.66
8.0.50.0040.00416.75
8.0.30.0110.01016.92
8.0.20.0110.01017.20
8.0.10.0050.00316.88
8.0.00.0090.00816.75
7.4.330.0060.00013.10
7.4.320.0060.00016.46
7.4.300.0040.00416.49
7.4.290.0030.00316.47
7.4.280.0050.00316.45
7.4.270.0030.00416.52
7.4.260.0000.00513.32
7.4.250.0000.00716.59
7.4.240.0030.00316.59
7.4.230.0070.00016.53
7.4.220.0130.00616.48
7.4.210.0100.00416.58
7.4.200.0000.00916.48
7.4.190.0000.00816.38
7.4.160.0040.01216.63
7.4.150.0130.00316.66
7.4.140.0080.00916.50
7.4.130.0100.00616.45
7.4.120.0130.00616.48
7.4.110.0190.00316.51
7.4.100.0160.00616.54
7.4.90.0130.00416.53
7.4.80.0070.01019.39
7.4.70.0000.01616.53
7.4.60.0060.01216.45
7.4.50.0110.00016.32
7.4.40.0070.00716.60
7.4.30.0060.00916.64
7.4.00.0050.01114.87
7.3.330.0030.00312.94
7.3.320.0000.00513.03
7.3.310.0000.00816.20
7.3.300.0000.00716.20
7.3.290.0060.01316.29
7.3.280.0110.00616.30
7.3.270.0000.01816.38
7.3.260.0160.00316.66
7.3.250.0180.00616.46
7.3.240.0080.00816.56
7.3.230.0130.00316.39
7.3.210.0140.00816.49
7.3.200.0060.00916.29
7.3.190.0070.01116.48
7.3.180.0070.01016.31
7.3.170.0110.00416.32
7.3.160.0080.00816.33
7.3.120.0110.00514.93
7.3.110.0000.01614.47
7.3.100.0070.00714.33
7.3.90.0050.00514.64
7.3.80.0070.00715.01
7.3.70.0000.01614.71
7.3.60.0090.00614.92
7.3.50.0030.00615.04
7.3.40.0060.00914.63
7.3.30.0090.00315.01
7.3.20.0030.00616.62
7.3.10.0030.00816.71
7.3.00.0040.00816.70
7.2.330.0160.00616.64
7.2.320.0100.00716.73
7.2.310.0150.00916.43
7.2.300.0060.01416.80
7.2.290.0080.01216.60
7.2.250.0130.00714.83
7.2.240.0030.01614.94
7.2.230.0070.00714.68
7.2.220.0070.00715.06
7.2.210.0030.01215.07
7.2.200.0120.00615.19
7.2.190.0070.00714.89
7.2.180.0110.00315.01
7.2.170.0030.00914.91
7.1.330.0100.00615.86
7.1.320.0040.00815.75
7.1.310.0100.00315.91
7.1.300.0000.01015.79
7.1.290.0120.00315.77
7.1.280.0040.00415.64
7.1.270.0080.00315.88
7.1.260.0040.01115.87
7.1.70.0030.00716.89
7.1.60.0110.01419.40
7.1.50.0100.01016.72
7.1.00.0000.04022.48
7.0.200.0040.00416.86
7.0.140.0000.07721.95
7.0.120.0030.07322.16
7.0.60.0070.08319.98
7.0.50.0130.04017.73
7.0.40.0100.08020.08
7.0.30.0000.05020.39
7.0.20.0030.08720.21
7.0.10.0130.06320.08
7.0.00.0070.08320.07
5.6.280.0000.07721.01
5.6.210.0100.05320.70
5.6.200.0030.04018.12
5.6.190.0000.05020.56
5.6.180.0100.04020.48
5.6.170.0230.06320.32
5.6.160.0100.07320.57
5.6.150.0070.07320.36
5.6.140.0130.07720.11
5.6.130.0170.04320.33
5.6.120.0200.06320.43
5.6.110.0030.04720.36
5.6.100.0030.06020.09
5.6.90.0130.04320.29
5.6.80.0070.08319.55
5.6.70.0030.04319.48
5.6.60.0070.04019.48
5.6.50.0000.05319.71
5.6.40.0030.04319.70
5.6.30.0000.04719.76
5.6.20.0030.04319.48
5.6.10.0000.04719.52
5.6.00.0070.04019.75
5.5.350.0130.05320.44
5.5.340.0100.06717.92
5.5.330.0100.05320.14
5.5.320.0130.06020.37
5.5.310.0070.07020.20
5.5.300.0070.05320.17
5.5.290.0130.07020.24
5.5.280.0030.05319.97
5.5.270.0070.04020.16
5.5.260.0070.08320.15
5.5.250.0170.07019.78
5.5.240.0030.08319.55
5.5.230.0170.07319.61
5.5.220.0030.04719.34
5.5.210.0100.06719.45
5.5.200.0070.04319.26
5.5.190.0000.05319.56
5.5.180.0070.04319.47
5.5.160.0070.08719.46
5.5.150.0070.06319.51
5.5.140.0200.07019.32
5.5.130.0070.04019.54
5.5.120.0100.07719.58
5.5.110.0100.08319.50
5.5.100.0100.07319.18
5.5.90.0100.07319.16
5.5.80.0130.04719.17
5.5.70.0070.06719.17
5.5.60.0100.07319.22
5.5.50.0030.08319.21
5.5.40.0030.04019.46
5.5.30.0030.04019.36
5.5.20.0030.04019.55
5.5.10.0000.04319.42
5.5.00.0030.04019.13
5.4.450.0030.06319.33
5.4.440.0100.04319.23
5.4.430.0070.06319.13
5.4.420.0070.04019.25
5.4.410.0070.05019.27
5.4.400.0000.05719.15
5.4.390.0130.03719.15
5.4.380.0100.06019.18
5.4.370.0100.06319.08
5.4.360.0070.08018.78
5.4.350.0030.03718.81
5.4.340.0070.07719.08
5.4.320.0100.07719.14
5.4.310.0030.08018.79
5.4.300.0030.05719.13
5.4.290.0100.03318.80
5.4.280.0100.03319.07
5.4.270.0170.06719.17
5.4.260.0030.05019.17
5.4.250.0030.04719.00
5.4.240.0170.02719.00
5.4.230.0070.06018.90
5.4.220.0070.04319.17
5.4.210.0100.07318.95
5.4.200.0030.03718.78
5.4.190.0070.03318.77
5.4.180.0100.03319.14
5.4.170.0000.04018.78
5.4.160.0070.03319.11
5.4.150.0000.04018.76
5.4.140.0030.03716.21
5.4.130.0030.03316.32
5.4.120.0030.03716.34
5.4.110.0030.03316.39
5.4.100.0070.03316.34
5.4.90.0000.03716.32
5.4.80.0100.03316.39
5.4.70.0030.03316.25
5.4.60.0000.05016.22
5.4.50.0070.03016.21
5.4.40.0030.03716.14
5.4.30.0030.03316.24
5.4.20.0030.03716.21
5.4.10.0000.03716.12
5.4.00.0070.03315.82
5.3.290.0030.04314.63
5.3.280.0070.08314.53
5.3.270.0030.04014.53
5.3.260.0070.03314.55
5.3.250.0170.03714.53
5.3.240.0030.03714.52
5.3.230.0030.03714.52
5.3.220.0030.03714.46
5.3.210.0030.03714.53
5.3.200.0000.04014.50
5.3.190.0030.03714.50
5.3.180.0070.03314.38
5.3.170.0030.03714.44
5.3.160.0070.03314.49
5.3.150.0070.03314.46
5.3.140.0100.03014.48
5.3.130.0000.04314.43
5.3.120.0030.04014.49
5.3.110.0030.03714.43
5.3.100.0030.03713.98
5.3.90.0000.03713.98
5.3.80.0030.03713.82
5.3.70.0070.03013.97
5.3.60.0070.03013.98
5.3.50.0100.03013.87
5.3.40.0000.05013.94
5.3.30.0030.03314.00
5.3.20.0000.03713.51
5.3.10.0030.03313.74
5.3.00.0070.03013.59
5.2.170.0030.02710.96
5.2.160.0000.03011.17
5.2.150.0030.03311.02
5.2.140.0030.02711.13
5.2.130.0030.02710.98
5.2.120.0070.02310.98
5.2.110.0000.03011.07
5.2.100.0070.04711.11
5.2.90.0000.05010.93
5.2.80.0030.05011.10
5.2.70.0070.05710.92
5.2.60.0070.06310.93
5.2.50.0030.03710.87
5.2.40.0000.06010.99
5.2.30.0100.04310.82
5.2.20.0070.02710.89
5.2.10.0030.06010.86
5.2.00.0100.05710.56
5.1.60.0030.04310.06
5.1.50.0070.0509.95
5.1.40.0100.05010.12
5.1.30.0000.03310.51
5.1.20.0070.02310.25
5.1.10.0000.04710.21
5.1.00.0000.06010.07
5.0.50.0070.0438.45
5.0.40.0070.0378.31
5.0.30.0030.0408.26
5.0.20.0000.0438.25
5.0.10.0030.0438.21
5.0.00.0070.0608.19
4.4.90.0030.0337.14
4.4.80.0000.0377.14
4.4.70.0030.0137.14
4.4.60.0070.0137.14
4.4.50.0130.0237.14
4.4.40.0030.0337.14
4.4.30.0000.0237.14
4.4.20.0000.0407.14
4.4.10.0030.0337.14
4.4.00.0030.0537.14
4.3.110.0130.0207.14
4.3.100.0000.0207.14
4.3.90.0030.0307.14
4.3.80.0030.0537.14
4.3.70.0070.0307.14
4.3.60.0000.0377.14
4.3.50.0030.0377.14
4.3.40.0030.0437.14
4.3.30.0000.0407.14
4.3.20.0030.0337.14
4.3.10.0000.0277.14
4.3.00.0000.0337.14

preferences:
54.34 ms | 401 KiB | 5 Q