3v4l.org

run code in 300+ PHP versions simultaneously
<?php $weight = array('Galeria', 'Rss', 'Grande', 'Mediana'); $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) { echo $option; echo $item; 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);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 1 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 12 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 24 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 42 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 43 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 45 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 555 Warning: {closure}(): Argument #1 ($option) must be passed by reference, value given in /in/FdqBj on line 8 552int(55)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
48.91 ms | 403 KiB | 8 Q