3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data1 = array('foo', null, 'bar', false, 5); $data2 = array('foo', null, 'bar', false, 5); // ======================================================== foreach ($data1 as $key => $value) { if ($value === null) { unset($data1[$key]); } } print_r($data1); // ======================================================== $data2 = array_filter($data2, function ($value) { return $value !== null; }); print_r($data2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/gB2hq
function name:  (null)
number of ops:  23
compiled vars:  !0 = $data1, !1 = $data2, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    8     2      > FE_RESET_R                                       $6      !0, ->9
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->9
          4    >   ASSIGN                                                   !3, ~7
    9     5        TYPE_CHECK                                    2          !2
          6      > JMPZ                                                     ~9, ->8
   10     7    >   UNSET_DIM                                                !0, !3
    8     8    > > JMP                                                      ->3
          9    >   FE_FREE                                                  $6
   14    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   18    13        INIT_FCALL                                               'array_filter'
         14        SEND_VAR                                                 !1
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgB2hq%3A18%240'
   20    16        SEND_VAL                                                 ~11
         17        DO_ICALL                                         $12     
   18    18        ASSIGN                                                   !1, $12
   22    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FgB2hq%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gB2hq
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        TYPE_CHECK                                  1020  ~1      !0
          2      > RETURN                                                   ~1
   20     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FgB2hq%3A18%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.81 ms | 1396 KiB | 17 Q