3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attachmentSizes = array('Galeria', 'Rss', 'Grande', 'Mediana'); echo $attachmentSizes[0]; $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 = 62) Position 1 = -2
filename:       /in/Pa72U
function name:  (null)
number of ops:  19
compiled vars:  !0 = $attachmentSizes, !1 = $fotos, !2 = $foto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        FETCH_DIM_R                                      ~4      !0, 0
          2        ECHO                                                     ~4
    7     3        ASSIGN                                                   !1, <array>
    9     4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !1
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPa72U%3A9%240'
          7        BIND_LEXICAL                                             ~6, !0
   11     8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
    9    10        ASSIGN                                                   !2, $7
   12    11        INIT_FCALL                                               'array_shift'
         12        SEND_REF                                                 !2
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !2, $9
   14    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPa72U%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pa72U
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $foto, !1 = $attachmentSizes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   10     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
   11     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPa72U%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.87 ms | 1388 KiB | 21 Q