3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attachmentSizes = array('Galeria', 'Rss', 'Grande', 'Mediana'); $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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/3Qbsq
function name:  (null)
number of ops:  21
compiled vars:  !0 = $attachmentSizes, !1 = $tamano, !2 = $fotos, !3 = $foto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 'Rss'
    6     2        FETCH_DIM_R                                      ~6      !0, !1
          3        ECHO                                                     ~6
    7     4      > EXIT                                                     
    9     5*       ASSIGN                                                   !2, <array>
   11     6*       INIT_FCALL                                               'array_filter'
          7*       SEND_VAR                                                 !2
          8*       DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3Qbsq%3A11%240'
          9*       BIND_LEXICAL                                             ~8, !0
   13    10*       SEND_VAL                                                 ~8
         11*       DO_ICALL                                         $9      
   11    12*       ASSIGN                                                   !3, $9
   14    13*       INIT_FCALL                                               'array_shift'
         14*       SEND_REF                                                 !3
         15*       DO_ICALL                                         $11     
         16*       ASSIGN                                                   !3, $11
   16    17*       INIT_FCALL                                               'var_dump'
         18*       SEND_VAR                                                 !3
         19*       DO_ICALL                                                 
         20*     > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3Qbsq%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Qbsq
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $foto, !1 = $attachmentSizes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   12     2        INIT_FCALL                                               'in_array'
          3        FETCH_DIM_R                                      ~2      !0, 'tamano'
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
   13     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3Qbsq%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.21 ms | 1396 KiB | 21 Q