3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Test Data $timeVariantSerialized = 'a:3:{s:7:"group_a";a:3:{i:0;a:3:{s:10:"id_variant";i:122;s:4:"name";s:13:"3 hour 30 min";s:4:"time";i:12600;}i:1;a:3:{s:10:"id_variant";i:173;s:4:"name";s:6:"3 hour";s:4:"time";i:10800;}i:2;a:3:{s:10:"id_variant";i:271;s:4:"name";s:6:"1 hour";s:4:"time";i:3600;}}s:7:"group_b";a:2:{i:0;a:3:{s:10:"id_variant";i:107;s:4:"name";s:13:"1 hour 30 min";s:4:"time";i:5400;}i:1;a:3:{s:10:"id_variant";i:321;s:4:"name";s:6:"3 hour";s:4:"time";i:10800;}}s:7:"group_c";a:4:{i:0;a:3:{s:10:"id_variant";i:28;s:4:"name";s:6:"1 hour";s:4:"time";i:3600;}i:1;a:3:{s:10:"id_variant";i:98;s:4:"name";s:6:"3 hour";s:4:"time";i:10800;}i:2;a:3:{s:10:"id_variant";i:157;s:4:"name";s:6:"2 hour";s:4:"time";i:7200;}i:3;a:3:{s:10:"id_variant";i:158;s:4:"name";s:13:"1 hour 30 min";s:4:"time";i:5400;}}}'; // Test Data Array $time_variant = unserialize( $timeVariantSerialized ); $groupsCount = count( $time_variant ); foreach( $time_variant as $groupId => $groupArray ) { foreach( $groupArray as $groupChildId => $groupChildArray ) { $timeCountsArray[$groupChildArray['time']][$groupId] = $groupChildId; } } $result = array(); foreach( $timeCountsArray as $time => $groupIdsArray ) { if( $groupsCount > count( $groupIdsArray ) ) continue; foreach( $groupIdsArray as $groupId => $groupChildId ) { $result[$time_variant[$groupId][$groupChildId]['id_variant']] = $time_variant[$groupId][$groupChildId]; // If you need only one result , uncomment the below break break; } // If more than 1 time could have variants , comment out below break to get them all break; } ksort( $result ); print_r( $result );

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.0070.00716.50
8.3.50.0150.00317.44
8.3.40.0110.00718.65
8.3.30.0040.01118.89
8.3.20.0040.00418.68
8.3.10.0030.00620.52
8.3.00.0040.00419.26
8.2.180.0170.00316.38
8.2.170.0180.00322.96
8.2.160.0030.01219.33
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.18
8.2.110.0030.00720.86
8.2.100.0040.00718.03
8.2.90.0070.00319.52
8.2.80.0040.00419.34
8.2.70.0040.00417.50
8.2.60.0000.00917.89
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0000.00718.04
8.2.20.0030.00617.75
8.2.10.0040.00417.65
8.2.00.0000.00917.79
8.1.280.0100.00625.92
8.1.270.0040.00424.66
8.1.260.0040.01126.35
8.1.250.0080.00028.09
8.1.240.0000.01022.45
8.1.230.0030.00820.89
8.1.220.0080.00017.74
8.1.210.0000.00818.89
8.1.200.0080.00417.36
8.1.190.0020.00517.51
8.1.180.0080.00018.10
8.1.170.0070.00018.80
8.1.160.0000.00718.91
8.1.150.0040.00418.67
8.1.140.0040.00417.37
8.1.130.0030.00317.82
8.1.120.0000.00717.49
8.1.110.0050.00317.39
8.1.100.0040.00417.40
8.1.90.0050.00217.39
8.1.80.0000.00817.41
8.1.70.0080.00017.46
8.1.60.0070.00017.67
8.1.50.0050.00317.47
8.1.40.0000.00817.54
8.1.30.0000.00717.73
8.1.20.0040.00417.66
8.1.10.0050.00217.49
8.1.00.0070.00317.42
8.0.300.0000.00819.90
8.0.290.0000.00716.75
8.0.280.0030.00318.39
8.0.270.0000.00817.34
8.0.260.0000.00716.93
8.0.250.0050.00317.02
8.0.240.0060.00317.08
8.0.230.0040.00417.07
8.0.220.0000.00716.99
8.0.210.0030.00316.97
8.0.200.0070.00017.04
8.0.190.0040.00417.07
8.0.180.0000.00716.97
8.0.170.0030.00616.93
8.0.160.0040.00417.01
8.0.150.0050.00516.99
8.0.140.0030.00616.83
8.0.130.0060.00013.38
8.0.120.0080.00016.96
8.0.110.0000.00816.92
8.0.100.0070.00016.86
8.0.90.0040.00416.79
8.0.80.0050.01016.97
8.0.70.0070.00016.94
8.0.60.0040.00416.97
8.0.50.0050.00216.96
8.0.30.0090.00916.97
8.0.20.0100.00817.11
8.0.10.0030.00516.90
8.0.00.0090.01216.86
7.4.330.0020.00213.13
7.4.320.0030.00316.55
7.4.300.0030.00316.58
7.4.290.0080.00016.46
7.4.280.0050.00316.66
7.4.270.0050.00316.52
7.4.260.0000.00513.29
7.4.250.0050.00316.56
7.4.240.0020.00516.53
7.4.230.0030.00316.66
7.4.220.0120.00616.62
7.4.210.0080.00916.65
7.4.200.0030.00316.54
7.4.190.0030.00316.43
7.4.160.0080.00816.34
7.4.150.0100.00716.35
7.4.140.0090.01016.58
7.4.130.0100.00916.61
7.4.120.0060.01016.56
7.4.110.0040.01316.73
7.4.100.0060.00916.40
7.4.90.0110.00716.56
7.4.80.0080.01116.24
7.4.70.0080.00816.52
7.4.60.0060.01016.43
7.4.50.0050.00916.34
7.4.40.0070.00716.65
7.4.30.0100.01316.63
7.4.00.0030.01014.88
7.3.330.0030.00313.08
7.3.320.0080.00013.08
7.3.310.0000.00716.35
7.3.300.0000.00716.32
7.3.290.0030.01216.36
7.3.280.0130.00616.30
7.3.270.0060.01216.30
7.3.260.0160.00016.40
7.3.250.0090.00816.47
7.3.240.0060.00916.65
7.3.230.0030.01516.43
7.3.210.0070.01316.45
7.3.200.0100.00719.39
7.3.190.0090.00916.61
7.3.180.0040.01216.39
7.3.170.0040.01216.39
7.3.160.0000.01516.45
7.3.120.0090.00914.93
7.3.10.0180.00416.60
7.3.00.0170.00816.61
7.2.330.0090.00916.40
7.2.320.0100.01316.80
7.2.310.0130.00316.75
7.2.300.0100.00616.45
7.2.290.0070.01016.67
7.2.130.0180.00916.81
7.2.120.0280.00316.80
7.2.110.0170.00316.34
7.2.100.0170.00316.55
7.2.90.0160.00616.57
7.2.80.0260.01116.62
7.2.70.0090.00916.88
7.2.60.0070.01016.53
7.2.50.0260.00817.10
7.2.40.0140.01116.80
7.2.30.0100.01016.28
7.2.20.0100.01116.54
7.2.10.0140.00016.39
7.2.00.0110.00518.03
7.1.250.0180.00415.45
7.1.100.0090.00617.71
7.1.70.0040.00417.27
7.1.60.0100.01319.40
7.1.50.0100.01316.78
7.1.00.0030.03322.29
7.0.200.0030.00516.77
7.0.140.0030.07022.04
7.0.120.0000.07722.17
7.0.60.0070.08719.91
7.0.50.0130.07317.87
7.0.40.0000.05020.16
7.0.30.0470.08020.21
7.0.20.0270.08020.21
7.0.10.0230.07720.25
7.0.00.0100.04320.23
5.6.280.0030.07321.03
5.6.210.0100.08020.51
5.6.200.0100.07718.23
5.6.190.0070.08320.64
5.6.180.0270.06020.62
5.6.170.0300.06020.50
5.6.160.0100.04720.56
5.6.150.0130.05318.29
5.6.140.0000.07018.14
5.6.130.0070.09018.15
5.6.120.0130.07721.01
5.6.110.0170.06320.98
5.6.100.0070.08321.00
5.6.90.0170.06020.99
5.6.80.0170.07320.47
5.5.350.0070.07020.40
5.5.340.0070.05018.07
5.5.330.0030.08320.31
5.5.320.0430.06720.29
5.5.310.0230.05020.34
5.5.300.0070.08317.95
5.5.290.0100.05018.03
5.5.280.0070.04020.85
5.5.270.0000.06720.87
5.5.260.0070.06720.76
5.5.250.0130.07720.78
5.5.240.0300.06320.15
5.4.450.0000.07719.48
5.4.440.0100.04319.18
5.4.430.0030.08719.44
5.4.420.0030.08019.56
5.4.410.0070.08019.43
5.4.400.0030.07019.12
5.4.390.0130.04019.15
5.4.380.0030.07718.95
5.4.370.0130.06719.14
5.4.360.0030.04318.97
5.4.350.0100.04319.24
5.4.340.0130.04719.14
5.4.320.0030.04019.15
5.4.310.0000.08718.85
5.4.300.0030.05019.16
5.4.290.0100.06019.11
5.4.280.0100.03319.14
5.4.270.0170.07019.07
5.4.260.0070.03719.23
5.4.250.0130.06719.20
5.4.240.0030.04019.13
5.4.230.0100.04019.19
5.4.220.0100.07018.86
5.4.210.0070.05019.23
5.4.200.0100.07019.23
5.4.190.0000.05719.13
5.4.180.0070.04019.13
5.4.170.0130.04019.23
5.4.160.0100.04018.98
5.4.150.0070.05019.18
5.4.140.0030.04016.42
5.4.130.0170.05716.30
5.4.120.0030.07716.25
5.4.110.0170.06316.50
5.4.100.0100.06716.39
5.4.90.0070.05716.34
5.4.80.0030.04016.52
5.4.70.0000.04716.28
5.4.60.0030.03716.37
5.4.50.0130.06716.44
5.4.40.0070.03716.43
5.4.30.0100.03016.50
5.4.20.0000.06716.41
5.4.10.0100.07316.26
5.4.00.0000.08015.84
5.3.290.0100.07314.85
5.3.280.0070.07714.52
5.3.270.0030.06714.63
5.3.260.0100.05714.66
5.3.250.0030.04014.64
5.3.240.0030.07714.68
5.3.230.0070.06314.66
5.3.220.0000.04014.62
5.3.210.0100.05014.63
5.3.200.0070.07314.61
5.3.190.0070.07714.73
5.3.180.0100.06014.54
5.3.170.0070.06714.57
5.3.160.0030.06014.59
5.3.150.0030.06714.59
5.3.140.0030.04014.73
5.3.130.0100.03014.58
5.3.120.0070.04014.61
5.3.110.0130.07014.59
5.3.100.0000.08014.07
5.3.90.0170.06014.10
5.3.80.0100.07314.04
5.3.70.0100.07014.03
5.3.60.0000.07714.02
5.3.50.0070.07313.99
5.3.40.0070.07013.99
5.3.30.0070.04313.95
5.3.20.0070.03713.59
5.3.10.0070.03713.61
5.3.00.0070.07313.64
5.2.170.0130.05311.12
5.2.160.0100.04311.11
5.2.150.0070.06011.09
5.2.140.0000.07011.16
5.2.130.0100.02711.01
5.2.120.0000.06711.13
5.2.110.0000.04711.06
5.2.100.0070.06711.00
5.2.90.0070.02711.14
5.2.80.0100.04311.18
5.2.70.0030.06311.07
5.2.60.0070.04311.11
5.2.50.0070.04011.07
5.2.40.0070.04011.01
5.2.30.0100.06010.98
5.2.20.0030.06311.02
5.2.10.0000.03710.86
5.2.00.0030.06010.78
5.1.60.0070.03010.04
5.1.50.0030.0309.95
5.1.40.0100.05010.05
5.1.30.0070.05710.23
5.1.20.0000.03710.36
5.1.10.0030.05710.04
5.1.00.0070.03310.03
5.0.50.0070.0408.61
5.0.40.0130.0378.57
5.0.30.0030.0308.16
5.0.20.0070.0278.26
5.0.10.0030.0278.10
5.0.00.0070.0678.09
4.4.90.0000.0377.78
4.4.80.0000.0207.78
4.4.70.0100.0237.78
4.4.60.0030.0277.78
4.4.50.0000.0337.78
4.4.40.0000.0407.78
4.4.30.0000.0407.78
4.4.20.0030.0237.78
4.4.10.0030.0277.78
4.4.00.0000.0577.78
4.3.110.0030.0307.78
4.3.100.0030.0277.78
4.3.90.0030.0177.78
4.3.80.0030.0307.78
4.3.70.0030.0177.78
4.3.60.0030.0377.78
4.3.50.0000.0237.78
4.3.40.0000.0307.78
4.3.30.0030.0337.78
4.3.20.0070.0337.78
4.3.10.0030.0177.78
4.3.00.0000.0207.78

preferences:
47.15 ms | 400 KiB | 5 Q