3v4l.org

run code in 300+ PHP versions simultaneously
<?php $weight = array('Galeria', 'Rss', 'Grande', 'Mediana'); $weight = array(1, 3, 5); $options = array(1, 2, 4, 2, 3, 5, 55, 2); // de las opciones disponibles obtener la de mayor peso $option = array_reduce($options, function(&$option, $item) use ($weight) { if (in_array($item, $weight)) { return ($option > $item) ? $option:$item; } }); var_dump($option); die; $tamano = 'Rss'; echo $attachmentSizes[$tamano]; die; $fotos = array(array('idAdjunto' => 1, 'tamano' => 'Grande'), array('idAdjunto' => 2, 'tamano'=>'Galeria'), array('idAdjunto' => 3, 'tamano'=>'Mediana')); $foto = array_filter($fotos, function($foto) use ($attachmentSizes) { return in_array($foto['tamano'], $attachmentSizes); }); $foto = array_shift($foto); var_dump($foto);

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.0060.00916.88
8.3.50.0240.00516.28
8.3.40.0140.00018.88
8.3.30.0110.00418.79
8.3.20.0040.00418.63
8.3.10.0040.00418.73
8.3.00.0080.00019.38
8.2.180.0070.00716.63
8.2.170.0110.00322.96
8.2.160.0090.00620.96
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0050.00226.16
8.2.120.0000.00820.72
8.2.110.0090.00020.94
8.2.100.0040.00717.78
8.2.90.0060.00319.20
8.2.80.0030.00719.46
8.2.70.0030.00617.63
8.2.60.0080.00017.68
8.2.50.0030.00618.07
8.2.40.0060.00318.16
8.2.30.0070.00318.02
8.2.20.0000.00917.77
8.2.10.0050.00317.78
8.2.00.0040.00417.79
8.1.280.0040.01125.92
8.1.270.0140.00024.66
8.1.260.0040.01826.35
8.1.250.0070.00028.09
8.1.240.0000.00922.61
8.1.230.0070.00420.80
8.1.220.0030.00617.74
8.1.210.0100.00018.77
8.1.200.0100.00017.25
8.1.190.0040.00417.52
8.1.180.0000.00818.10
8.1.170.0100.00018.79
8.1.160.0000.00918.91
8.1.150.0060.00318.61
8.1.140.0080.00017.46
8.1.130.0070.00017.84
8.1.120.0040.00417.45
8.1.110.0000.00717.43
8.1.100.0000.00717.45
8.1.90.0040.00417.36
8.1.80.0070.00017.54
8.1.70.0000.00817.34
8.1.60.0040.00417.51
8.1.50.0090.00017.51
8.1.40.0000.00817.56
8.1.30.0000.00717.57
8.1.20.0060.00317.58
8.1.10.0000.00817.40
8.1.00.0080.00017.38
8.0.300.0040.00419.98
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0070.00017.30
8.0.260.0000.00716.78
8.0.250.0040.00417.00
8.0.240.0000.00716.96
8.0.230.0000.00717.02
8.0.220.0030.00317.02
8.0.210.0040.00416.97
8.0.200.0030.00517.00
8.0.190.0040.00417.08
8.0.180.0040.00417.04
8.0.170.0000.00817.02
8.0.160.0000.00717.04
8.0.150.0000.00816.92
8.0.140.0030.00516.82
8.0.130.0000.00613.40
8.0.120.0000.00816.96
8.0.110.0000.00717.03
8.0.100.0070.00016.80
8.0.90.0040.00416.82
8.0.80.0030.01217.04
8.0.70.0040.00416.86
8.0.60.0030.00417.01
8.0.50.0000.00717.07
8.0.30.0160.00317.36
8.0.20.0090.00917.04
8.0.10.0000.00817.10
8.0.00.0090.01016.70
7.4.330.0030.00313.01
7.4.320.0030.00316.68
7.4.300.0000.00616.43
7.4.290.0060.00316.63
7.4.280.0040.00416.59
7.4.270.0000.00716.44
7.4.260.0060.00013.23
7.4.250.0000.00816.48
7.4.240.0030.00316.54
7.4.230.0030.00316.44
7.4.220.0070.01416.48
7.4.210.0070.00816.60
7.4.200.0030.00416.65
7.4.190.0070.00016.71
7.4.160.0060.01016.34
7.4.150.0090.00916.50
7.4.140.0130.01016.47
7.4.130.0050.01216.56
7.4.120.0080.01116.57
7.4.110.0060.01416.61
7.4.100.0120.00916.71
7.4.90.0100.01316.73
7.4.80.0140.00719.39
7.4.70.0100.01316.71
7.4.60.0060.01016.52
7.4.50.0080.00416.52
7.4.40.0090.00916.59
7.4.30.0110.00716.55
7.4.00.0110.00714.94
7.3.330.0000.00613.45
7.3.320.0030.00313.20
7.3.310.0080.00016.38
7.3.300.0060.00016.39
7.3.290.0090.00616.31
7.3.280.0120.00416.37
7.3.270.0060.01216.74
7.3.260.0120.00616.47
7.3.250.0120.00516.49
7.3.240.0120.00016.40
7.3.230.0050.01116.55
7.3.210.0030.01316.56
7.3.200.0090.00916.50
7.3.190.0090.00516.55
7.3.180.0030.01716.32
7.3.170.0080.01216.59
7.3.160.0060.00916.54
7.3.120.0030.01214.91
7.3.110.0070.01014.85
7.3.100.0090.00614.96
7.3.90.0040.00714.64
7.3.80.0070.00714.81
7.3.70.0030.00714.88
7.3.60.0060.00914.95
7.3.50.0070.00714.79
7.3.40.0040.00814.60
7.3.30.0100.00314.66
7.3.20.0040.00816.75
7.3.10.0050.00716.69
7.3.00.0080.00616.73
7.2.330.0100.01016.59
7.2.320.0090.01216.44
7.2.310.0090.01216.51
7.2.300.0180.00016.61
7.2.290.0090.00616.70
7.2.250.0110.00714.96
7.2.240.0060.01315.17
7.2.230.0000.01415.14
7.2.220.0050.00515.18
7.2.210.0060.00615.12
7.2.200.0040.01114.95
7.2.190.0040.01215.18
7.2.180.0030.00715.06
7.2.170.0030.01314.93
7.2.130.0090.00616.85
7.2.120.0090.00316.94
7.2.110.0000.01016.72
7.2.100.0070.00717.04
7.2.90.0030.01416.73
7.2.80.0000.01016.98
7.2.70.0030.01417.05
7.2.60.0100.00316.85
7.2.50.0060.01017.02
7.2.40.0030.00916.90
7.2.30.0060.00916.87
7.2.20.0070.00717.07
7.2.10.0040.00816.96
7.2.00.0060.00818.19
7.1.330.0120.00315.96
7.1.320.0100.00315.88
7.1.310.0070.00715.67
7.1.300.0060.00615.80
7.1.290.0050.00515.66
7.1.280.0070.00715.46
7.1.270.0030.00615.85
7.1.260.0030.00716.00
7.1.250.0070.00715.70
7.1.100.0000.01118.15
7.1.70.0030.00517.26
7.1.60.0070.01719.40
7.1.50.0090.00616.91
7.1.00.0070.07022.51
7.0.200.0030.01014.92
7.0.140.0070.07021.99
7.0.120.0030.03722.04
7.0.60.0070.04319.93
7.0.50.0170.06317.95
7.0.40.0100.04320.11
7.0.30.0230.04320.09
7.0.20.0270.08720.12
7.0.10.0070.04020.11
7.0.00.0070.03720.27
5.6.210.0030.08020.72
5.6.200.0030.06318.27
5.6.190.0030.04720.61
5.6.180.0330.06020.50
5.6.170.0170.05720.53
5.6.160.0030.08720.55
5.6.150.0030.07018.27
5.6.140.0130.05018.18
5.6.130.0000.04318.14
5.6.120.0070.08321.00
5.6.110.0070.08321.10
5.6.100.0070.06721.00
5.6.90.0030.04720.98
5.6.80.0000.04720.38
5.6.70.0100.04020.54
5.5.350.0130.07720.32
5.5.340.0070.03718.01
5.5.330.0030.06320.31
5.5.320.0030.06020.28
5.5.310.0170.08020.20
5.5.300.0030.08317.98
5.5.290.0070.07718.08
5.5.280.0030.08020.69
5.5.270.0030.09320.65
5.5.260.0170.07020.98
5.5.250.0170.07720.70
5.5.240.0200.07320.16
5.4.450.0170.07019.20
5.4.440.0070.07719.40
5.4.430.0130.07719.46
5.4.420.0100.07719.17
5.4.410.0000.06319.29
5.4.400.0030.06718.98
5.4.390.0130.07019.20
5.4.380.0030.07719.11
5.4.370.0030.07018.93
5.4.360.0070.03719.20
5.4.350.0030.04019.24
5.4.340.0030.03719.21
5.4.320.0070.04018.98
5.4.310.0030.04019.08
5.4.300.0070.03319.14
5.4.290.0000.04019.02
5.4.280.0000.04019.14
5.4.270.0100.03019.14
5.4.260.0070.03719.15
5.4.250.0030.03719.23
5.4.240.0030.03718.86
5.4.230.0030.03718.99
5.4.220.0030.04019.14
5.4.210.0030.03719.00
5.4.200.0070.03718.88
5.4.190.0030.04318.84
5.4.180.0070.03319.13
5.4.170.0130.03018.97
5.4.160.0170.03019.18
5.4.150.0030.03719.19
5.4.140.0000.04016.35
5.4.130.0000.03716.40
5.4.120.0030.03716.38
5.4.110.0030.03316.42
5.4.100.0070.03316.44
5.4.90.0030.03316.43
5.4.80.0070.03016.41
5.4.70.0130.06016.42
5.4.60.0070.04716.45
5.4.50.0130.07016.40
5.4.40.0100.07316.64
5.4.30.0130.05716.36
5.4.20.0100.05316.27
5.4.10.0070.05316.34
5.4.00.0030.06315.95
5.3.290.0100.03714.68
5.3.280.0070.03314.61
5.3.270.0000.04014.66
5.3.260.0070.03314.61
5.3.250.0000.03714.62
5.3.240.0030.03714.77
5.3.230.0030.03714.76
5.3.220.0000.03714.57
5.3.210.0070.03314.56
5.3.200.0100.03014.63
5.3.190.0000.04014.61
5.3.180.0000.04014.56
5.3.170.0000.04014.56
5.3.160.0070.03314.58
5.3.150.0030.07314.71
5.3.140.0030.07714.57
5.3.130.0030.05014.58
5.3.120.0030.07314.61
5.3.110.0030.07714.56
5.3.100.0130.03013.96
5.3.90.0030.04314.05
5.3.80.0070.03314.06
5.3.70.0130.07014.08
5.3.60.0070.07314.06
5.3.50.0100.07014.02
5.3.40.0000.05014.11
5.3.30.0100.07014.06
5.3.20.0100.04013.86
5.3.10.0130.06713.60
5.3.00.0100.06013.67
5.2.170.0100.04011.13
5.2.160.0070.06011.03
5.2.150.0030.06311.11
5.2.140.0100.03311.30
5.2.130.0100.05011.26
5.2.120.0000.05711.00
5.2.110.0030.04711.07
5.2.100.0070.04311.04
5.2.90.0070.05710.98
5.2.80.0100.05711.04
5.2.70.0000.03311.00
5.2.60.0030.03010.95
5.2.50.0000.04010.87
5.2.40.0000.07010.82
5.2.30.0130.05010.85
5.2.20.0070.06010.96
5.2.10.0030.04310.86
5.2.00.0030.06310.71
5.1.60.0000.04710.34
5.1.50.0070.04710.34
5.1.40.0130.02010.34
5.1.30.0000.03010.34
5.1.20.0030.05710.34
5.1.10.0100.04710.34
5.1.00.0000.02710.34
5.0.50.0030.03310.34
5.0.40.0030.04310.34
5.0.30.0030.06710.34
5.0.20.0030.02710.34
5.0.10.0000.03310.34
5.0.00.0030.05010.34
4.4.90.0000.03310.34
4.4.80.0030.01710.34
4.4.70.0030.03310.34
4.4.60.0070.02710.34
4.4.50.0070.01710.34
4.4.40.0070.05310.34
4.4.30.0000.02310.34
4.4.20.0070.03310.34
4.4.10.0070.03010.34
4.4.00.0000.03310.34
4.3.110.0000.03710.34
4.3.100.0000.04010.34
4.3.90.0030.03010.34
4.3.80.0030.03310.34
4.3.70.0070.03010.34
4.3.60.0030.02310.34
4.3.50.0000.02010.34
4.3.40.0070.02310.34
4.3.30.0000.03710.34
4.3.20.0000.02010.34
4.3.10.0030.01710.34
4.3.00.0000.02310.34

preferences:
28.21 ms | 401 KiB | 5 Q