3v4l.org

run code in 300+ PHP versions simultaneously
<?php $segments1 = ["foo", "bar", 0, "0", NULL, FALSE, ""]; $segments2 = array_filter($segments1, function ($segment) { return ! (empty($segment) && (string) $segment !== '0'); }); var_export([$segments1, $segments2]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tWjEi
function name:  (null)
number of ops:  13
compiled vars:  !0 = $segments1, !1 = $segments2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
    6     4        SEND_VAL                                                 ~3
    4     5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    8     7        INIT_FCALL                                               'var_export'
          8        INIT_ARRAY                                       ~6      !0
          9        ADD_ARRAY_ELEMENT                                ~6      !1
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
         12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/tWjEi
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $segment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2      > JMPZ_EX                                          ~1      ~1, ->6
          3    >   CAST                                          6  ~2      !0
          4        IS_NOT_IDENTICAL                                 ~3      ~2, '0'
          5        BOOL                                             ~1      ~3
          6    >   BOOL_NOT                                         ~4      ~1
          7      > RETURN                                                   ~4
    6     8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.3 ms | 1433 KiB | 15 Q