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.0140.00318.52
8.3.50.0080.00921.21
8.3.40.0150.00318.71
8.3.30.0070.00720.31
8.3.20.0000.00820.16
8.3.10.0030.00521.13
8.3.00.0000.00823.67
8.2.180.0180.00316.75
8.2.170.0070.01122.96
8.2.160.0040.01120.41
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00420.86
8.2.110.0090.00019.16
8.2.100.0110.00017.91
8.2.90.0040.00419.17
8.2.80.0090.00019.07
8.2.70.0110.00017.63
8.2.60.0000.00818.04
8.2.50.0100.00318.07
8.2.40.0050.00318.25
8.2.30.0070.00019.49
8.2.20.0040.00417.74
8.2.10.0040.00417.67
8.2.00.0040.00417.73
8.1.280.0160.00625.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.40
8.1.230.0110.00020.85
8.1.220.0000.00818.77
8.1.210.0060.00318.97
8.1.200.0060.00317.35
8.1.190.0000.00817.43
8.1.180.0000.00818.10
8.1.170.0050.00318.64
8.1.160.0000.00818.96
8.1.150.0000.00818.65
8.1.140.0040.00417.35
8.1.130.0000.00717.84
8.1.120.0040.00317.37
8.1.110.0040.00417.48
8.1.100.0000.00717.47
8.1.90.0000.00817.40
8.1.80.0040.00417.40
8.1.70.0040.00417.45
8.1.60.0050.00317.52
8.1.50.0030.00517.52
8.1.40.0040.00417.43
8.1.30.0040.00417.57
8.1.20.0030.00617.58
8.1.10.0040.00417.59
8.1.00.0050.00317.46
8.0.300.0050.00219.90
8.0.290.0000.00717.18
8.0.280.0000.00718.39
8.0.270.0040.00417.35
8.0.260.0060.00018.53
8.0.250.0040.00416.94
8.0.240.0040.00417.11
8.0.230.0030.00317.06
8.0.220.0070.00017.00
8.0.210.0070.00017.03
8.0.200.0040.00417.03
8.0.190.0000.00916.95
8.0.180.0070.00017.03
8.0.170.0040.00416.93
8.0.160.0080.00016.98
8.0.150.0070.00016.88
8.0.140.0040.00416.97
8.0.130.0000.00713.45
8.0.120.0040.00416.96
8.0.110.0080.00016.88
8.0.100.0040.00416.88
8.0.90.0080.00017.01
8.0.80.0090.00616.97
8.0.70.0000.00717.00
8.0.60.0070.00016.88
8.0.50.0020.00517.03
8.0.30.0110.00917.02
8.0.20.0040.01417.40
8.0.10.0040.00417.10
8.0.00.0080.01216.74
7.4.330.0030.00315.14
7.4.320.0000.00816.55
7.4.300.0030.00316.53
7.4.290.0000.00716.63
7.4.280.0060.00016.62
7.4.270.0070.00016.58
7.4.260.0060.00313.42
7.4.250.0000.00816.64
7.4.240.0050.00216.62
7.4.230.0030.00316.70
7.4.220.0100.01716.55
7.4.210.0090.00816.63
7.4.200.0020.00516.73
7.4.190.0080.00016.41
7.4.160.0040.01216.79
7.4.150.0040.01417.40
7.4.140.0030.01417.86
7.4.130.0070.01116.69
7.4.120.0110.00916.63
7.4.110.0110.00516.45
7.4.100.0100.00716.61
7.4.90.0160.00416.44
7.4.80.0070.01119.39
7.4.70.0120.00616.48
7.4.60.0130.00916.43
7.4.50.0030.00316.53
7.4.40.0060.00622.77
7.4.30.0090.00916.59
7.4.00.0150.00014.68
7.3.330.0050.00013.12
7.3.320.0000.00513.21
7.3.310.0030.00316.31
7.3.300.0030.00316.39
7.3.290.0000.01416.32
7.3.280.0060.01116.37
7.3.270.0100.00717.40
7.3.260.0070.01218.24
7.3.250.0090.00916.53
7.3.240.0070.01116.43
7.3.230.0100.00716.39
7.3.210.0100.00616.59
7.3.200.0060.01019.39
7.3.190.0100.00716.52
7.3.180.0060.00916.34
7.3.170.0090.00616.43
7.3.160.0130.00316.43
7.3.120.0060.00615.05
7.2.330.0030.01916.85
7.2.320.0130.00416.56
7.2.310.0040.01316.69
7.2.300.0110.00516.71
7.2.290.0120.00416.79
7.2.00.0040.00819.56
7.1.100.0090.00618.27
7.1.70.0030.00717.21
7.1.60.0170.00719.17
7.1.50.0070.01016.96
7.1.00.0030.08022.45
7.0.200.0050.00516.52
7.0.140.0070.06722.09
7.0.80.0170.05019.95
7.0.70.0330.05020.02
7.0.60.0200.06019.99
7.0.50.0370.04020.20
7.0.40.0070.04320.07
7.0.30.0030.04320.11
7.0.20.0070.04020.14
7.0.10.0100.03020.02
7.0.00.0030.03720.04
5.6.280.0070.07020.81
5.6.230.0030.03720.63
5.6.220.0070.04720.52
5.6.210.0030.06020.64
5.6.200.0030.04321.13
5.6.190.0030.04321.17
5.6.180.0070.06720.97
5.6.170.0070.05021.07
5.6.160.0100.06321.08
5.6.150.0000.04721.02
5.6.140.0070.03321.04
5.6.130.0000.05021.08
5.6.120.0070.06321.07
5.6.110.0100.04321.05
5.6.100.0070.03321.04
5.6.90.0070.06020.93
5.6.80.0030.04020.43
5.6.70.0000.05020.39
5.6.60.0030.08020.43
5.6.50.0200.07020.43
5.6.40.0130.03720.46
5.6.30.0130.06020.29
5.6.20.0170.03720.29
5.6.10.0130.04720.43
5.6.00.0100.07320.45
5.5.370.0070.03720.57
5.5.360.0030.05020.33
5.5.350.0030.06020.39
5.5.340.0070.04020.73
5.5.330.0070.03320.92
5.5.320.0030.04020.83
5.5.310.0030.04720.89
5.5.300.0070.07020.87
5.5.290.0030.05720.76
5.5.280.0070.04020.87
5.5.270.0070.08020.82
5.5.260.0070.04020.87
5.5.250.0030.04320.64
5.5.240.0000.04320.29
5.5.230.0070.03720.15
5.5.220.0070.06020.19
5.5.210.0030.08320.20
5.5.200.0070.05020.26
5.5.190.0030.08320.08
5.5.180.0100.07720.23
5.5.160.0100.07720.27
5.5.150.0130.06020.11
5.5.140.0130.05020.13
5.5.130.0000.07320.24
5.5.120.0100.05720.18
5.5.110.0130.08019.96
5.5.100.0070.08020.10
5.5.90.0100.07320.16
5.5.80.0170.06020.07
5.5.70.0070.07720.14
5.5.60.0130.07020.10
5.5.50.0100.07320.09
5.5.40.0100.05019.95
5.5.30.0030.05320.02
5.5.20.0070.08020.05
5.5.10.0070.04020.04
5.5.00.0100.07320.01
5.4.450.0030.04319.36
5.4.440.0000.04019.17
5.4.430.0030.04019.53
5.4.420.0000.05719.55
5.4.410.0000.04019.10
5.4.400.0030.03719.14
5.4.390.0030.03718.85
5.4.380.0070.04019.16
5.4.370.0170.06019.09
5.4.360.0070.06718.90
5.4.350.0070.05319.13
5.4.340.0030.04319.16
5.4.320.0100.07719.13
5.4.310.0030.08319.12
5.4.300.0100.06719.12
5.4.290.0130.06718.89
5.4.280.0030.04719.13
5.4.270.0100.07318.89
5.4.260.0130.07719.13
5.4.250.0000.08319.08
5.4.240.0030.07318.87
5.4.230.0100.07719.20
5.4.220.0100.07019.11
5.4.210.0100.07319.11
5.4.200.0030.08019.20
5.4.190.0130.06319.20
5.4.180.0000.05718.89
5.4.170.0170.06019.06
5.4.160.0100.06718.82
5.4.150.0070.07319.16
5.4.140.0070.07016.36
5.4.130.0100.06716.42
5.4.120.0070.06716.34
5.4.110.0070.07316.28
5.4.100.0070.07316.48
5.4.90.0070.05716.54
5.4.80.0070.06316.45
5.4.70.0100.06716.35
5.4.60.0100.06316.36
5.4.50.0130.04716.46
5.4.40.0070.07316.30
5.4.30.0000.05716.26
5.4.20.0030.05316.33
5.4.10.0070.05716.44
5.4.00.0000.07715.89
5.3.290.0070.07314.79
5.3.280.0030.05014.68
5.3.270.0100.03314.54
5.3.260.0130.06714.68
5.3.250.0030.06714.67
5.3.240.0030.07714.56
5.3.230.0030.07314.71
5.3.220.0070.07714.68
5.3.210.0030.08014.68
5.3.200.0070.07014.71
5.3.190.0100.05314.69
5.3.180.0030.05014.55
5.3.170.0100.07714.50
5.3.160.0070.06714.69
5.3.150.0130.06714.51
5.3.140.0030.07714.48
5.3.130.0100.06014.70
5.3.120.0030.08014.66
5.3.110.0130.07014.63
5.3.100.0130.05314.09
5.3.90.0100.06714.14
5.3.80.0130.06313.95
5.3.70.0030.08014.06
5.3.60.0070.07713.89
5.3.50.0130.06314.04
5.3.40.0130.07014.00
5.3.30.0030.08013.97
5.3.20.0030.05713.60
5.3.10.0070.04713.72
5.3.00.0070.07313.68
5.2.170.0070.05711.67
5.2.160.0070.05311.67
5.2.150.0030.07011.67
5.2.140.0030.04311.67
5.2.130.0100.06011.67
5.2.120.0000.05311.67
5.2.110.0200.05711.67
5.2.100.0030.05711.67
5.2.90.0070.03311.67
5.2.80.0000.03311.67
5.2.70.0000.04711.67
5.2.60.0030.03711.67
5.2.50.0100.05711.67
5.2.40.0000.07011.67
5.2.30.0030.06311.67
5.2.20.0000.05711.67
5.2.10.0030.06011.67
5.2.00.0030.06011.67
5.1.60.0070.05011.67
5.1.50.0000.06011.67
5.1.40.0130.04311.67
5.1.30.0100.04311.67
5.1.20.0000.04011.67
5.1.10.0030.05311.67
5.1.00.0200.03711.67
5.0.50.0000.02711.67
5.0.40.0000.03011.67
5.0.30.0000.06311.67
5.0.20.0000.04011.67
5.0.10.0070.02011.67
5.0.00.0030.06711.67
4.4.90.0030.01711.67
4.4.80.0000.03011.67
4.4.70.0030.03711.67
4.4.60.0000.02711.67
4.4.50.0030.03311.67
4.4.40.0070.04711.67
4.4.30.0030.03711.67
4.4.20.0000.03711.67
4.4.10.0030.02011.67
4.4.00.0030.05011.67
4.3.110.0000.02011.67
4.3.100.0000.03711.67
4.3.90.0000.03011.67
4.3.80.0030.05311.67
4.3.70.0000.03711.67
4.3.60.0000.03711.67
4.3.50.0000.03011.67
4.3.40.0030.03311.67
4.3.30.0030.03311.67
4.3.20.0000.03311.67
4.3.10.0030.03311.67
4.3.00.0030.02711.67

preferences:
44.57 ms | 401 KiB | 5 Q