3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attendance = array( array( "student_id" => "1", "date" => "2016-04-24" ) ); $students = array( array( "student_id" => "1", "Reason" => "", "date" => "2016-04-24" ), array( "student_id" => "6", "Reason" => "1", "date" => "2016-04-24" ) ); $atts = array(); foreach($attendance as $att) { $atts[] = $att->student_id; } foreach($students as &$student) { if(in_array($student['student_id'], $atts)) { $student['Reason']='1'; } else { $student['Reason']='0'; } } echo '<pre>',print_r($students,1),'</pre>';

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.0120.00316.63
8.3.50.0140.00622.01
8.3.40.0120.00318.91
8.3.30.0140.00718.87
8.3.20.0040.00418.77
8.3.10.0000.00721.73
8.3.00.0080.00017.93
8.2.180.0160.00316.63
8.2.170.0030.01022.96
8.2.160.0100.00321.12
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00318.00
8.2.120.0040.00426.35
8.2.110.0100.00022.10
8.2.100.0090.00319.76
8.2.90.0040.00419.30
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.00821.18
8.2.30.0000.00718.20
8.2.20.0050.00317.81
8.2.10.0000.00818.09
8.2.00.0030.00618.05
8.1.280.0140.00725.92
8.1.270.0020.00523.82
8.1.260.0040.00428.09
8.1.250.0090.00028.09
8.1.240.0060.00322.59
8.1.230.0110.00017.42
8.1.220.0000.00717.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0040.00418.60
8.1.160.0070.00022.02
8.1.150.0060.00318.86
8.1.140.0050.00219.65
8.1.130.0000.00717.79
8.1.120.0000.00717.48
8.1.110.0000.00817.36
8.1.100.0070.00017.48
8.1.90.0040.00417.42
8.1.80.0040.00417.35
8.1.70.0050.00217.45
8.1.60.0040.00417.59
8.1.50.0000.00817.50
8.1.40.0000.00817.54
8.1.30.0000.00917.50
8.1.20.0000.00817.59
8.1.10.0000.00817.52
8.1.00.0000.01017.59
8.0.300.0000.00818.77
8.0.290.0050.00316.75
8.0.280.0030.00318.36
8.0.270.0060.00317.28
8.0.260.0030.00317.25
8.0.250.0030.00316.96
8.0.240.0030.00317.00
8.0.230.0030.00316.92
8.0.220.0000.00716.87
8.0.210.0000.00716.97
8.0.200.0070.00016.87
8.0.190.0040.00416.99
8.0.180.0110.00017.00
8.0.170.0000.00817.00
8.0.160.0000.00817.07
8.0.150.0040.00416.93
8.0.140.0000.00716.93
8.0.130.0000.00513.38
8.0.120.0080.00016.84
8.0.110.0040.00416.94
8.0.100.0030.00316.84
8.0.90.0030.00516.83
8.0.80.0110.00716.93
8.0.70.0000.00716.89
8.0.60.0070.00016.86
8.0.50.0000.00716.76
8.0.30.0100.00917.07
8.0.20.0100.00917.40
8.0.10.0030.00516.91
8.0.00.0060.01216.64
7.4.330.0020.00215.08
7.4.320.0030.00316.47
7.4.300.0060.00016.40
7.4.290.0070.00416.52
7.4.280.0070.00016.44
7.4.270.0040.00416.62
7.4.260.0050.00216.59
7.4.250.0000.00716.52
7.4.240.0030.00316.54
7.4.230.0020.00516.70
7.4.220.0100.01416.56
7.4.210.0080.01016.63
7.4.200.0040.00416.43
7.4.160.0140.00316.41
7.4.150.0090.00917.40
7.4.140.0090.01117.86
7.4.130.0100.00616.69
7.4.120.0080.01216.62
7.4.110.0090.00916.65
7.4.100.0080.00916.77
7.4.90.0160.01316.62
7.4.80.0140.00919.39
7.4.70.0060.01116.59
7.4.60.0100.00616.59
7.4.50.0150.00016.64
7.4.40.0060.01016.61
7.4.30.0100.01016.45
7.4.00.0070.01014.66
7.3.330.0030.00313.28
7.3.320.0000.00513.14
7.3.310.0070.00016.48
7.3.300.0030.00316.44
7.3.290.0070.00716.43
7.3.280.0090.01116.37
7.3.270.0140.00417.40
7.3.260.0200.00316.38
7.3.250.0150.00616.53
7.3.240.0070.00916.51
7.3.230.0130.00316.39
7.3.210.0100.00616.39
7.3.200.0130.00416.68
7.3.190.0130.00616.43
7.3.180.0110.00516.45
7.3.170.0120.01216.46
7.3.160.0120.00916.49
7.3.10.0030.00716.50
7.3.00.0110.00016.67
7.2.330.0090.00816.57
7.2.320.0100.00716.31
7.2.310.0090.00916.82
7.2.300.0180.00816.68
7.2.290.0090.01216.58
7.2.130.0000.01116.64
7.2.120.0120.00116.85
7.2.110.0030.01016.69
7.2.100.0080.00616.76
7.2.90.0060.00916.62
7.2.80.0090.00316.83
7.2.70.0070.00616.79
7.2.60.0070.00717.04
7.2.50.0060.00716.90
7.2.40.0090.00617.01
7.2.30.0050.01116.86
7.2.20.0070.00617.03
7.2.10.0090.00316.83
7.2.00.0070.00617.86
7.1.250.0030.00715.79
7.1.240.0040.00915.76
7.1.230.0120.00515.61
7.1.220.0100.00715.97
7.1.210.0110.00615.49
7.1.200.0040.00915.97
7.1.190.0130.00315.90
7.1.180.0050.00915.72
7.1.170.0090.00915.95
7.1.160.0130.00615.48
7.1.150.0100.00715.89
7.1.140.0160.00015.96
7.1.130.0110.00515.89
7.1.120.0140.00315.86
7.1.110.0140.00515.95
7.1.100.0110.00516.87
7.1.90.0160.00415.80
7.1.80.0070.01115.99
7.1.70.0090.00116.47
7.1.60.0100.00817.74
7.1.50.0100.00515.80
7.1.40.0110.00315.76
7.1.30.0120.00415.95
7.1.20.0070.01115.54
7.1.10.0040.01115.63
7.1.00.0080.04019.13
7.0.320.0100.00415.33
7.0.310.0070.00915.56
7.0.300.0070.00715.52
7.0.290.0070.00715.34
7.0.280.0170.00015.21
7.0.270.0110.00415.14
7.0.260.0120.00315.47
7.0.250.0090.00615.59
7.0.240.0110.00715.26
7.0.230.0100.00715.57
7.0.220.0080.00515.54
7.0.210.0090.00615.25
7.0.200.0100.00616.06
7.0.190.0110.00515.42
7.0.180.0050.01015.47
7.0.170.0090.00215.41
7.0.160.0030.01215.62
7.0.150.0160.00015.25
7.0.140.0120.00415.49
7.0.130.0070.00715.29
7.0.120.0120.00415.42
7.0.110.0120.00015.25
7.0.100.0100.00715.52
7.0.90.0140.00315.47
7.0.80.0150.00715.32
7.0.70.0120.00415.57
7.0.60.0140.03917.66
7.0.50.0210.03218.02
7.0.40.0160.03116.90
7.0.30.0190.04016.86
7.0.20.0160.02816.86
7.0.10.0150.04316.88
7.0.00.0220.03017.01
5.6.380.0170.00014.61
5.6.370.0140.00014.64
5.6.360.0080.00414.59
5.6.350.0140.00214.75
5.6.340.0140.00014.18
5.6.330.0130.00314.65
5.6.320.0120.00414.15
5.6.310.0100.00514.61
5.6.300.0080.00414.33
5.6.290.0050.00814.61
5.6.280.0080.03717.66
5.6.270.0090.00914.16
5.6.260.0110.00414.58
5.6.250.0150.00314.29
5.6.240.0170.00014.20
5.6.230.0140.00314.64
5.6.220.0150.00314.43
5.6.210.0060.03617.39
5.6.200.0170.02817.83
5.6.190.0140.03017.83
5.6.180.0170.02817.79
5.6.170.0140.03317.66
5.6.160.0180.03317.63
5.6.150.0210.02817.81
5.6.140.0200.02617.79
5.6.130.0180.03417.77
5.6.120.0120.03317.76
5.6.110.0170.02917.75
5.6.100.0070.03617.77
5.6.90.0080.03817.70
5.6.80.0090.03417.28
5.6.70.0170.03017.36
5.6.60.0090.03617.39
5.6.50.0140.03017.43
5.6.40.0150.02717.25
5.6.30.0150.03417.26
5.6.20.0200.02517.26
5.6.10.0130.03117.52
5.6.00.0180.04117.42
5.5.380.0090.00511.55
5.5.370.0140.00011.44
5.5.360.0130.00011.51
5.5.350.0130.02515.91
5.5.340.0110.03116.13
5.5.330.0190.03016.20
5.5.320.0110.03616.13
5.5.310.0110.03316.18
5.5.300.0170.03715.96
5.5.290.0100.03316.11
5.5.280.0120.03016.04
5.5.270.0160.02816.04
5.5.260.0150.04216.08
5.5.250.0070.03516.07
5.5.240.0120.03715.71
5.5.230.0180.02815.87
5.5.220.0130.03015.70
5.5.210.0150.02815.88
5.5.200.0130.03315.75
5.5.190.0170.02515.71
5.5.180.0120.03415.69
5.5.170.0050.00914.31
5.5.160.0140.03715.79
5.5.150.0150.02815.85
5.5.140.0110.03515.77
5.5.130.0140.03615.64
5.5.120.0110.03015.74
5.5.110.0110.03015.89
5.5.100.0100.03215.73
5.5.90.0150.02815.59
5.5.80.0190.02515.52
5.5.70.0140.03315.66
5.5.60.0160.03315.66
5.5.50.0220.02815.51
5.5.40.0220.02515.56
5.5.30.0190.02915.66
5.5.20.0220.02715.61
5.5.10.0150.03015.52
5.5.00.0210.02815.55

preferences:
33.72 ms | 401 KiB | 5 Q