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; } 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.0090.00918.56
8.3.50.0190.00921.27
8.3.40.0110.01118.84
8.3.30.0070.00720.34
8.3.20.0040.00420.44
8.3.10.0080.00021.04
8.3.00.0040.00423.53
8.2.180.0090.01218.32
8.2.170.0040.01122.96
8.2.160.0100.00320.53
8.2.150.0080.00024.18
8.2.140.0070.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00421.04
8.2.110.0070.00319.28
8.2.100.0080.00417.78
8.2.90.0040.00419.30
8.2.80.0060.00319.34
8.2.70.0000.00917.63
8.2.60.0000.00818.05
8.2.50.0110.00018.07
8.2.40.0060.00320.07
8.2.30.0050.00219.41
8.2.20.0000.00717.73
8.2.10.0000.00717.79
8.2.00.0020.00517.83
8.1.280.0120.00325.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00920.77
8.1.230.0090.00320.91
8.1.220.0030.00618.77
8.1.210.0060.00318.89
8.1.200.0000.00917.35
8.1.190.0000.00717.52
8.1.180.0060.00318.10
8.1.170.0050.00318.50
8.1.160.0060.00318.90
8.1.150.0030.00618.68
8.1.140.0040.00417.59
8.1.130.0050.00217.96
8.1.120.0070.00017.36
8.1.110.0050.00217.34
8.1.100.0080.00017.39
8.1.90.0000.00717.49
8.1.80.0000.00717.45
8.1.70.0030.00317.50
8.1.60.0030.00617.62
8.1.50.0000.00717.51
8.1.40.0040.00417.58
8.1.30.0000.00817.67
8.1.20.0000.00817.59
8.1.10.0050.00217.60
8.1.00.0000.00917.48
8.0.300.0000.00719.99
8.0.290.0080.00017.05
8.0.280.0030.00318.41
8.0.270.0000.00717.21
8.0.260.0000.00616.96
8.0.250.0040.00417.06
8.0.240.0000.00717.06
8.0.230.0060.00317.07
8.0.220.0030.00517.03
8.0.210.0000.00717.02
8.0.200.0030.00316.94
8.0.190.0080.00017.00
8.0.180.0030.00516.98
8.0.170.0070.00016.94
8.0.160.0000.00717.05
8.0.150.0000.00816.82
8.0.140.0000.00716.94
8.0.130.0000.00613.40
8.0.120.0040.00416.95
8.0.110.0040.00416.98
8.0.100.0000.00816.98
8.0.90.0070.00017.10
8.0.80.0030.01817.04
8.0.70.0040.00417.05
8.0.60.0040.00416.96
8.0.50.0030.00516.98
8.0.30.0150.00317.26
8.0.20.0130.00717.40
8.0.10.0000.00817.10
8.0.00.0150.00716.67
7.4.330.0050.00016.83
7.4.320.0070.00016.46
7.4.300.0000.00616.54
7.4.290.0030.00316.55
7.4.280.0050.00216.58
7.4.270.0030.00316.59
7.4.260.0000.00513.23
7.4.250.0000.00716.51
7.4.240.0000.00716.63
7.4.230.0040.00416.75
7.4.220.0130.00616.74
7.4.210.0080.00816.62
7.4.200.0030.00316.61
7.4.190.0030.00516.60
7.4.160.0110.00516.58
7.4.150.0130.00317.40
7.4.140.0100.00917.86
7.4.130.0130.00716.53
7.4.120.0030.01316.62
7.4.110.0070.01016.73
7.4.100.0120.00416.58
7.4.90.0040.01416.36
7.4.80.0100.00719.39
7.4.70.0090.00616.37
7.4.60.0120.00616.54
7.4.50.0040.00416.29
7.4.40.0080.00822.77
7.4.30.0100.00616.68
7.4.00.0100.00315.14
7.3.330.0000.00613.29
7.3.320.0060.00013.29
7.3.310.0000.00716.37
7.3.300.0030.00316.36
7.3.290.0100.00316.41
7.3.280.0090.01016.38
7.3.270.0140.00317.40
7.3.260.0100.01118.24
7.3.250.0140.00616.52
7.3.240.0090.01016.32
7.3.230.0180.00016.53
7.3.210.0030.01316.47
7.3.200.0150.00619.39
7.3.190.0090.00616.62
7.3.180.0120.00816.46
7.3.170.0090.00616.38
7.3.160.0120.00616.40
7.3.120.0060.00914.79
7.2.330.0090.01016.72
7.2.320.0030.01416.88
7.2.310.0030.01416.78
7.2.300.0090.00916.47
7.2.290.0140.00416.80
7.1.70.0040.00417.28
7.1.60.0130.01319.17
7.1.50.0070.01417.11
7.1.00.0000.04022.36
7.0.200.0000.00716.52
7.0.140.0000.07021.92
7.0.100.0030.04019.99
7.0.90.0070.04019.93
7.0.80.0030.04019.91
7.0.70.0070.04719.95
7.0.60.0270.08020.01
7.0.50.0100.07320.26
7.0.40.0170.06020.08
7.0.30.0100.07320.00
7.0.20.0130.08320.11
7.0.10.0070.08320.18
7.0.00.0000.07319.95
5.6.280.0030.07721.04
5.6.250.0070.03720.63
5.6.240.0030.04320.57
5.6.230.0000.04320.59
5.6.220.0030.08320.61
5.6.210.0000.06320.60
5.6.200.0070.08321.18
5.6.190.0100.07721.05
5.6.180.0030.06321.05
5.6.170.0070.05020.94
5.6.160.0030.08021.01
5.6.150.0100.04321.11
5.6.140.0100.08021.11
5.6.130.0100.07721.07
5.6.120.0130.08321.03
5.6.110.0100.08021.00
5.6.100.0000.09021.10
5.6.90.0000.07721.05
5.6.80.0130.06020.43
5.6.70.0270.04720.42
5.6.60.0070.07720.46
5.6.50.0070.08020.32
5.6.40.0100.07320.32
5.6.30.0030.06320.36
5.6.20.0070.08020.46
5.6.10.0130.07320.37
5.6.00.0100.07720.45
5.5.380.0000.04020.45
5.5.370.0100.03320.42
5.5.360.0070.06320.38
5.5.350.0030.08020.41
5.5.340.0130.07320.86
5.5.330.0200.06720.76
5.5.320.0200.07020.89
5.5.310.0070.06720.89
5.5.300.0070.04720.80
5.5.290.0130.07320.78
5.5.280.0130.04320.89
5.5.270.0100.07320.63
5.5.260.0100.08020.93
5.5.250.0070.08020.74
5.5.240.0130.07320.22
5.5.230.0070.04020.30
5.5.220.0030.07720.25
5.5.210.0100.07320.09
5.5.200.0070.04720.24
5.5.190.0270.03320.16
5.5.180.0070.04720.16
5.5.160.0230.06320.09
5.5.150.0100.07320.27
5.5.140.0070.08020.25
5.5.130.0100.08020.23
5.5.120.0070.05720.22
5.5.110.0000.06720.18
5.5.100.0230.06320.20
5.5.90.0070.06320.07
5.5.80.0030.07320.11
5.5.70.0070.07319.97
5.5.60.0100.07320.14
5.5.50.0070.05020.10
5.5.40.0100.05720.16
5.5.30.0030.08019.96
5.5.20.0070.07720.05
5.5.10.0200.05720.07
5.5.00.0170.05719.96
5.4.450.0070.08019.49
5.4.440.0130.05719.20
5.4.430.0070.08019.53
5.4.420.0170.06319.45
5.4.410.0070.04319.43
5.4.400.0070.07719.04
5.4.390.0100.07318.85
5.4.380.0130.04319.18
5.4.370.0070.05318.85
5.4.360.0030.07318.86
5.4.350.0070.04318.91
5.4.340.0070.07019.21
5.4.320.0070.08019.14
5.4.310.0000.08319.03
5.4.300.0100.07318.85
5.4.290.0100.07319.18
5.4.280.0030.07719.05
5.4.270.0030.07719.03
5.4.260.0000.04719.12
5.4.250.0130.07018.84
5.4.240.0030.04319.14
5.4.230.0100.03318.99
5.4.220.0070.07719.03
5.4.210.0070.07019.17
5.4.200.0100.07018.94
5.4.190.0070.07319.04
5.4.180.0070.06718.86
5.4.170.0100.07019.03
5.4.160.0070.05319.11
5.4.150.0000.04319.11
5.4.140.0070.07316.14
5.4.130.0000.05716.36
5.4.120.0030.06316.37
5.4.110.0030.07716.51
5.4.100.0030.04316.54
5.4.90.0070.05316.34
5.4.80.0100.07016.38
5.4.70.0070.04716.37
5.4.60.0030.08016.43
5.4.50.0030.05016.36
5.4.40.0000.07716.52
5.4.30.0070.06716.46
5.4.20.0170.03316.42
5.4.10.0070.07316.41
5.4.00.0070.06715.80
5.3.290.0130.04714.75
5.3.280.0130.06714.68
5.3.270.0070.08014.74
5.3.260.0030.07314.64
5.3.250.0230.06314.59
5.3.240.0100.07714.61
5.3.230.0030.06314.59
5.3.220.0070.07014.67
5.3.210.0100.03314.51
5.3.200.0200.06014.52
5.3.190.0170.05314.56
5.3.180.0070.07714.64
5.3.170.0100.05714.52
5.3.160.0070.07014.50
5.3.150.0070.07714.50
5.3.140.0070.06314.55
5.3.130.0070.07314.61
5.3.120.0130.06714.48
5.3.110.0070.08014.49
5.3.100.0100.06714.02
5.3.90.0070.04314.09
5.3.80.0070.06713.91
5.3.70.0070.06314.09
5.3.60.0070.07013.92
5.3.50.0070.03713.88
5.3.40.0030.08314.05
5.3.30.0030.07013.81
5.3.20.0070.06013.63
5.3.10.0000.07313.59
5.3.00.0170.06313.75
5.2.170.0130.05311.09
5.2.160.0070.05711.21
5.2.150.0100.04311.07
5.2.140.0030.05011.07
5.2.130.0070.05711.16
5.2.120.0070.05311.04
5.2.110.0030.06011.20
5.2.100.0100.02711.00
5.2.90.0000.06011.10
5.2.80.0030.02311.16
5.2.70.0070.05011.16
5.2.60.0070.06011.17
5.2.50.0130.05311.14
5.2.40.0070.03710.88
5.2.30.0000.03711.05
5.2.20.0000.06011.08
5.2.10.0100.03310.82
5.2.00.0100.02010.85
5.1.60.0000.04710.12
5.1.50.0030.0509.99
5.1.40.0070.0579.84
5.1.30.0100.05010.27
5.1.20.0070.05310.48
5.1.10.0130.0439.92
5.1.00.0030.02710.17
5.0.50.0030.0409.11
5.0.40.0070.0439.11
5.0.30.0000.0679.11
5.0.20.0070.0379.11
5.0.10.0030.0339.11
5.0.00.0000.0609.11
4.4.90.0000.0379.11
4.4.80.0000.0339.11
4.4.70.0000.0239.11
4.4.60.0000.0139.11
4.4.50.0030.0239.11
4.4.40.0100.0479.11
4.4.30.0070.0309.11
4.4.20.0030.0209.11
4.4.10.0030.0339.11
4.4.00.0070.0279.11
4.3.110.0030.0339.11
4.3.100.0030.0309.11
4.3.90.0000.0179.11
4.3.80.0000.0509.11
4.3.70.0100.0309.11
4.3.60.0000.0339.11
4.3.50.0030.0309.11
4.3.40.0070.0509.11
4.3.30.0000.0379.11
4.3.20.0070.0309.11
4.3.10.0030.0309.11
4.3.00.0030.0309.11

preferences:
40.29 ms | 400 KiB | 5 Q