3v4l.org

run code in 300+ PHP versions simultaneously
<?php $weight = array('Galeria', 'Rss', 'Grande', 'Mediana'); $weight = array(1, 3, 5); $options = array(1, 1, 2, 4, 2, 3, 5, 55, 2); // de las opciones disponibles obtener la de mayor peso $options = array_filter($options, function($item) use ($weight) {return in_array($item, $weight);}); $option = array_reduce($options, function(&$option, $item) use ($weight) { echo $item . PHP_EOL; 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.0100.01016.75
8.3.50.0110.00418.05
8.3.40.0160.00618.66
8.3.30.0110.00418.90
8.3.20.0050.00220.29
8.3.10.0060.00323.65
8.3.00.0080.00019.26
8.2.180.0120.00918.39
8.2.170.0070.01122.96
8.2.160.0110.00420.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00422.25
8.2.110.0060.00322.26
8.2.100.0030.00917.84
8.2.90.0000.00819.23
8.2.80.0000.00818.05
8.2.70.0070.00317.75
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0080.00018.34
8.2.30.0030.00718.00
8.2.20.0050.00317.74
8.2.10.0000.00819.79
8.2.00.0040.00817.77
8.1.270.0050.00322.14
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00523.81
8.1.230.0110.00019.10
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0000.00817.35
8.1.190.0070.00017.53
8.1.180.0050.00318.10
8.1.170.0080.00018.66
8.1.160.0000.00722.09
8.1.150.0030.00618.67
8.1.140.0040.00417.52
8.1.130.0070.00017.86
8.1.120.0000.00817.47
8.1.110.0040.00417.47
8.1.100.0000.00717.45
8.1.90.0050.00217.34
8.1.80.0000.00717.50
8.1.70.0030.00317.35
8.1.60.0050.00317.61
8.1.50.0000.00817.54
8.1.40.0000.00717.58
8.1.30.0040.00417.63
8.1.20.0040.00417.55
8.1.10.0060.00317.54
8.1.00.0040.00417.43
8.0.300.0000.00718.77
8.0.290.0040.00417.30
8.0.280.0000.00718.48
8.0.270.0000.00717.21
8.0.260.0040.00416.88
8.0.250.0000.00716.97
8.0.240.0040.00417.09
8.0.230.0000.00716.99
8.0.220.0000.00716.86
8.0.210.0000.00716.90
8.0.200.0000.00617.08
8.0.190.0050.00316.93
8.0.180.0000.00717.05
8.0.170.0030.00517.06
8.0.160.0020.00517.03
8.0.150.0000.00716.99
8.0.140.0070.00016.89
8.0.130.0060.00013.40
8.0.120.0030.00616.80
8.0.110.0070.00016.86
8.0.100.0000.00716.83
8.0.90.0000.00816.82
8.0.80.0160.00017.01
8.0.70.0050.00317.03
8.0.60.0000.00716.89
8.0.50.0050.00216.82
8.0.30.0140.00917.24
8.0.20.0110.00817.43
8.0.10.0030.00517.00
8.0.00.0110.00616.81
7.4.330.0000.00515.03
7.4.320.0000.00616.41
7.4.300.0000.00616.69
7.4.290.0030.00316.52
7.4.280.0030.00316.58
7.4.270.0000.00716.48
7.4.260.0060.00316.46
7.4.250.0000.00716.49
7.4.240.0030.00416.66
7.4.230.0030.00316.35
7.4.220.0100.00716.64
7.4.210.0100.00716.59
7.4.200.0070.00016.60
7.4.190.0000.00716.55
7.4.160.0130.00316.38
7.4.150.0070.01317.40
7.4.140.0090.00917.86
7.4.130.0100.00916.50
7.4.120.0110.00616.52
7.4.110.0120.00516.65
7.4.100.0110.00716.69
7.4.90.0210.00016.45
7.4.80.0030.01719.39
7.4.70.0100.01016.46
7.4.60.0170.00216.46
7.4.50.0030.00616.63
7.4.40.0090.00322.77
7.4.30.0060.00916.57
7.4.00.0030.01215.09
7.3.330.0000.00513.39
7.3.320.0070.00013.22
7.3.310.0040.00416.27
7.3.300.0000.00716.41
7.3.290.0000.01816.41
7.3.280.0070.01016.43
7.3.270.0120.00617.40
7.3.260.0090.01016.35
7.3.250.0110.01116.57
7.3.240.0080.00816.56
7.3.230.0130.00316.62
7.3.210.0100.00716.33
7.3.200.0160.01119.39
7.3.190.0120.01216.60
7.3.180.0090.00616.57
7.3.170.0060.01016.41
7.3.160.0050.01116.58
7.3.120.0090.00615.10
7.2.330.0180.00016.69
7.2.320.0030.01616.54
7.2.310.0140.00916.80
7.2.300.0070.01016.72
7.2.290.0070.01016.40
7.2.60.0140.00016.87
7.2.00.0040.00419.63
7.1.200.0080.00815.86
7.1.100.0040.00718.17
7.1.70.0000.01117.20
7.1.60.0070.01719.33
7.1.50.0150.00617.04
7.1.00.0070.07322.29
7.0.200.0060.00616.93
7.0.140.0000.07722.01
7.0.100.0430.07719.94
7.0.90.0530.08319.99
7.0.80.0370.05319.88
7.0.70.0470.07719.98
7.0.60.0500.04019.89
7.0.50.0530.08020.36
7.0.40.0070.07320.11
7.0.30.0130.08020.09
7.0.20.0130.07320.05
7.0.10.0070.07320.17
7.0.00.0100.07320.14
5.6.280.0000.07720.91
5.6.250.0030.05020.61
5.6.240.0130.03320.55
5.6.230.0100.07720.57
5.6.220.0030.08020.55
5.6.210.0100.07720.66
5.6.200.0070.09320.96
5.6.190.0130.07021.06
5.6.180.0170.06720.92
5.6.170.0030.07021.15
5.6.160.0070.08321.05
5.6.150.0100.07320.97
5.6.140.0100.04721.09
5.6.130.0270.06321.04
5.6.120.0070.07721.04
5.6.110.0070.05021.10
5.6.100.0200.06021.05
5.6.90.0130.08020.93
5.6.80.0100.05320.35
5.6.70.0030.08020.46
5.6.60.0100.07720.41
5.6.50.0170.07020.34
5.6.40.0000.08020.51
5.6.30.0130.07020.46
5.6.20.0070.07720.34
5.6.10.0030.05720.30
5.6.00.0030.08720.43
5.5.380.0070.06020.40
5.5.370.0200.03320.46
5.5.360.0030.08020.45
5.5.350.0030.05720.46
5.5.340.0070.08020.94
5.5.330.0030.07020.64
5.5.320.0100.07320.77
5.5.310.0100.06720.88
5.5.300.0100.07020.85
5.5.290.0030.06320.91
5.5.280.0030.05720.79
5.5.270.0070.07020.64
5.5.260.0100.08020.93
5.5.250.0070.07720.75
5.5.240.0100.07320.30
5.5.230.0000.09020.30
5.5.220.0100.08020.19
5.5.210.0170.03720.12
5.5.200.0070.08320.14
5.5.190.0100.07020.28
5.5.180.0030.08320.26
5.5.160.0100.03720.16
5.5.150.0030.07020.25
5.5.140.0070.06020.23
5.5.130.0070.06720.16
5.5.120.0070.07720.23
5.5.110.0070.08020.28
5.5.100.0070.04020.08
5.5.90.0070.07720.09
5.5.80.0030.07720.18
5.5.70.0100.06720.11
5.5.60.0100.05020.04
5.5.50.0070.07320.10
5.5.40.0170.06320.17
5.5.30.0170.06720.08
5.5.20.0000.09020.08
5.5.10.0000.06320.07
5.5.00.0130.05720.12
5.4.450.0070.08019.21
5.4.440.0130.07319.28
5.4.430.0070.07319.45
5.4.420.0070.07719.53
5.4.410.0130.06719.32
5.4.400.0000.05019.04
5.4.390.0130.08319.10
5.4.380.0070.07019.16
5.4.370.0100.07319.14
5.4.360.0100.07319.18
5.4.350.0100.07018.91
5.4.340.0100.07319.12
5.4.320.0200.06019.13
5.4.310.0130.07319.08
5.4.300.0070.06719.04
5.4.290.0100.04019.16
5.4.280.0070.07319.12
5.4.270.0170.06319.03
5.4.260.0030.07318.88
5.4.250.0070.07719.18
5.4.240.0070.07719.05
5.4.230.0000.07718.89
5.4.220.0070.05019.03
5.4.210.0130.06319.22
5.4.200.0000.08318.88
5.4.190.0000.08019.11
5.4.180.0100.04019.02
5.4.170.0130.06719.11
5.4.160.0100.06318.88
5.4.150.0000.05018.88
5.4.140.0000.08016.24
5.4.130.0030.04716.38
5.4.120.0030.08016.46
5.4.110.0070.04016.53
5.4.100.0070.07716.49
5.4.90.0170.05716.52
5.4.80.0100.07016.57
5.4.70.0070.07016.47
5.4.60.0030.07316.40
5.4.50.0030.07716.47
5.4.40.0130.07016.46
5.4.30.0100.03716.40
5.4.20.0130.06316.29
5.4.10.0100.07716.38
5.4.00.0070.06315.86
5.3.290.0100.07714.81
5.3.280.0070.04314.67
5.3.270.0030.07314.68
5.3.260.0030.07314.67
5.3.250.0130.04014.54
5.3.240.0070.05714.65
5.3.230.0000.08014.54
5.3.220.0170.06014.51
5.3.210.0030.07714.69
5.3.200.0000.04014.64
5.3.190.0100.07314.61
5.3.180.0000.08014.55
5.3.170.0070.05014.53
5.3.160.0000.07714.66
5.3.150.0100.07014.64
5.3.140.0030.07314.63
5.3.130.0100.07714.61
5.3.120.0130.06714.49
5.3.110.0130.07014.57
5.3.100.0030.08014.25
5.3.90.0030.07314.25
5.3.80.0070.07714.25
5.3.70.0100.06714.25
5.3.60.0100.07014.25
5.3.50.0000.07014.25
5.3.40.0000.08014.25
5.3.30.0100.06714.25
5.3.20.0070.06014.25
5.3.10.0100.06314.25
5.3.00.0100.05714.25
5.2.170.0070.06014.25
5.2.160.0100.05714.25
5.2.150.0070.06014.25
5.2.140.0000.06314.25
5.2.130.0070.06014.25
5.2.120.0000.06014.25
5.2.110.0030.06014.25
5.2.100.0070.05014.25
5.2.90.0000.06314.25
5.2.80.0030.05714.25
5.2.70.0100.06014.25
5.2.60.0030.05714.25
5.2.50.0100.05714.25
5.2.40.0030.05314.25
5.2.30.0030.05314.25
5.2.20.0070.06014.25
5.2.10.0070.05314.25
5.2.00.0100.05014.25
5.1.60.0030.05014.25
5.1.50.0070.05014.25
5.1.40.0000.05714.25
5.1.30.0000.06014.25
5.1.20.0000.03714.25
5.1.10.0030.05714.25
5.1.00.0070.05014.25
5.0.50.0100.04014.25
5.0.40.0000.04714.25
5.0.30.0030.06714.25
5.0.20.0030.03714.25
5.0.10.0100.03714.25
5.0.00.0070.06314.25
4.4.90.0000.02714.25
4.4.80.0030.03314.25
4.4.70.0000.03714.25
4.4.60.0100.02014.25
4.4.50.0070.03014.25
4.4.40.0000.05314.25
4.4.30.0070.02014.25
4.4.20.0000.02014.25
4.4.10.0030.02714.25
4.4.00.0070.03714.25
4.3.110.0030.02314.25
4.3.100.0030.03014.25
4.3.90.0070.03014.25
4.3.80.0000.04714.25
4.3.70.0000.03314.25
4.3.60.0000.04014.25
4.3.50.0070.03014.25
4.3.40.0130.04314.25
4.3.30.0000.02714.25
4.3.20.0030.03314.25
4.3.10.0000.03714.25
4.3.00.0070.03014.25

preferences:
48.59 ms | 400 KiB | 5 Q