3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attachmentSizes = array('Galeria', 'Rss', 'Grande', 'Mediana'); $fotos = array(array('idAdjunto' => 1, 'tamano' => 'Grande'), array('idAdjunto' => 2, 'tamano'=>'Galeria'), array('idAdjunto' => 3, 'tamano'=>'Mediana')); $foto = array_filter($fotos, function($foto, $i) use ($attachmentSizes) { return in_array($foto['tamano'], $attachmentSizes); }); var_dump($foto);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dEne4
function name:  (null)
number of ops:  13
compiled vars:  !0 = $attachmentSizes, !1 = $fotos, !2 = $foto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FdEne4%3A6%240'
          5        BIND_LEXICAL                                             ~5, !0
    8     6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
    6     8        ASSIGN                                                   !2, $6
    9     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FdEne4%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.1 ms | 1395 KiB | 19 Q