3v4l.org

run code in 500+ 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                              ~1      [0]
          4        SEND_VAL                                                     ~1
          5        DO_ICALL                                                     
    8     6      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K7bRf
function name:  {closure:something():7}
number of ops:  6
compiled vars:  !0 = $el
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        FRAMELESS_ICALL_1                trim                ~1      !0
          2        ASSIGN                                               ~2      !0, ~1
          3        STRLEN                                               ~3      ~2
          4      > RETURN                                                       ~3
          5*     > RETURN                                                       null

End of Dynamic Function 0

End of function something

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
148.51 ms | 482 KiB | 10 Q