3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array( 0 => array( 2 => array( "type" => 1, "score" => 10, ), ), 1 => array( 2 => array( "type" => 2, "score" => 5, ), ), 2 => array( 2 => array( "type" => 3, "score" => 4, ), ), 3 => array( 2 => array( "type" => 4, "score" => 60, ), ), 4 => array( 1 => array( "type" => 1, "score" => 5, ), ), ); $array2 = array(0 => 2, 1 => 1); $array3 = array( 2 => array( "score" => 79 ), 1 => array( "score" => 5 ), ); foreach( $array1 as $array1x ){ $key=key($array1x); if( in_array($key, $array2) ){ $this_score = $array1x[$key]['score']; $cum_score = isset($newarray[$key]['score']) ? $newarray[$key]['score'] : 0; $newarray[$key]['score'] = $cum_score + $this_score; } } print_r($newarray);

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.60.0130.00616.88
8.3.50.0200.00019.98
8.3.40.0130.00622.08
8.3.30.0090.00618.71
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.180.0150.00725.92
8.2.170.0120.00318.79
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0080.00026.16
8.2.110.0060.00320.79
8.2.100.0060.00617.84
8.2.90.0070.00419.11
8.2.80.0000.00817.97
8.2.70.0030.00517.63
8.2.60.0080.00018.04
8.2.50.0030.00618.07
8.2.40.0000.00819.98
8.2.30.0000.00718.13
8.2.20.0000.00720.49
8.2.10.0000.00817.70
8.2.00.0040.00419.27
8.1.280.0160.00625.92
8.1.270.0100.01022.19
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0030.00621.38
8.1.230.0070.00419.11
8.1.220.0000.00917.88
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0030.00518.71
8.1.160.0000.00818.88
8.1.150.0040.00418.63
8.1.140.0050.00317.37
8.1.130.0040.00419.23
8.1.120.0040.00417.48
8.1.110.0000.00717.43
8.1.100.0040.00417.49
8.1.90.0040.00417.50
8.1.80.0030.00617.35
8.1.70.0030.00317.43
8.1.60.0040.00417.61
8.1.50.0080.00417.54
8.1.40.0080.00017.51
8.1.30.0040.00417.61
8.1.20.0000.00817.61
8.1.10.0030.01117.40
8.1.00.0040.00417.44
8.0.300.0000.00818.84
8.0.290.0090.00016.58
8.0.280.0070.00018.32
8.0.270.0040.00417.92
8.0.260.0060.00316.87
8.0.250.0030.00316.93
8.0.240.0000.00616.85
8.0.230.0030.00316.87
8.0.220.0030.00616.88
8.0.210.0080.00016.92
8.0.200.0030.00517.02
8.0.190.0030.00516.94
8.0.180.0070.00016.85
8.0.170.0040.00416.80
8.0.160.0000.00816.94
8.0.150.0000.00716.95
8.0.140.0060.00616.75
8.0.130.0020.00716.77
8.0.120.0040.00416.85
8.0.110.0030.00716.80
8.0.100.0180.00316.89
8.0.90.0150.00516.76
8.0.80.0140.00716.86
8.0.70.0210.00016.80
8.0.60.0140.00616.93
8.0.50.0140.00616.86
8.0.30.0140.00716.80
8.0.20.0190.00316.82
8.0.10.0180.00416.94
8.0.00.0040.00716.96
7.4.330.0000.00515.55
7.4.320.0030.00316.53
7.4.300.0000.00816.60
7.4.290.0030.00716.53
7.4.280.0080.00016.45
7.4.270.0080.00016.59
7.4.260.0150.00716.37
7.4.250.0190.00416.54
7.4.240.0180.00616.52
7.4.230.0160.01016.45
7.4.220.0140.00616.39
7.4.210.0180.00316.52
7.4.200.0100.00816.52
7.4.190.0110.00716.45
7.4.180.0140.00516.50
7.4.160.0110.01116.56
7.4.150.0140.00516.55
7.4.140.0190.00016.43
7.4.130.0130.00616.44
7.4.120.0190.00016.43
7.4.110.0150.00716.49
7.4.100.0120.00916.47
7.4.90.0080.01016.31
7.4.80.0090.00616.36
7.4.70.0100.00716.41
7.4.60.0130.00616.40
7.4.50.0150.00516.36
7.4.40.0140.00716.28
7.4.30.0140.00616.48
7.4.20.0180.00416.27
7.4.10.0140.00416.43
7.4.00.0200.00016.47
7.3.330.0200.00016.31
7.3.320.0140.00816.34
7.3.310.0120.00816.34
7.3.300.0210.00016.26
7.3.290.0220.00016.16
7.3.280.0190.00316.21
7.3.270.0150.00516.35
7.3.260.0170.00316.09
7.3.250.0200.00016.42
7.3.240.0160.00316.27
7.3.230.0160.00416.36
7.3.220.0160.00616.12
7.3.210.0070.00816.04
7.3.200.0110.00716.23
7.3.190.0170.00216.23
7.3.180.0080.00816.25
7.3.170.0120.00816.10
7.3.160.0080.01216.07
7.3.150.0030.00316.23
7.3.140.0030.00316.26
7.3.130.0060.00316.23

preferences:
28.94 ms | 400 KiB | 5 Q