3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'This is a string!'; $i = 0; var_dump(array_filter(str_split($string), function($val) use ($i) { return ++$i % 2; }));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qm0O8
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'This+is+a+string%21'
    4     1        ASSIGN                                                   !1, 0
    5     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'array_filter'
          4        INIT_FCALL                                               'str_split'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQm0O8%3A5%240'
          9        BIND_LEXICAL                                             ~5, !1
    7    10        SEND_VAL                                                 ~5
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQm0O8%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qm0O8
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $val, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    6     2        PRE_INC                                          ~2      !1
          3        MOD                                              ~3      ~2, 2
          4      > RETURN                                                   ~3
    7     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQm0O8%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.1 ms | 1395 KiB | 19 Q