3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=[' ', ' foo ', ' ', ' bar ', 'baz ', ' ']; function something(array $arg) { array_filter($arg, function(&$el){return strlen($el=trim($el));}); } var_dump($arr); something($arr); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K7bRf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   11     4        INIT_FCALL                                               'something'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K7bRf
function name:  something
number of ops:  7
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FK7bRf%3A7%240'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
    8     6      > RETURN                                                   null

End of function something

Function %00%7Bclosure%7D%2Fin%2FK7bRf%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K7bRf
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                           ~2      !0, $1
          5        STRLEN                                           ~3      ~2
          6      > RETURN                                                   ~3
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FK7bRf%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.09 ms | 1403 KiB | 20 Q