3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'Data 1 table 1', '', 'Data 3 table 1', '', '', 'Data 6 table 1', '', 'Data 8 table 1', '', 'Data 10 table 1', ]; $filter = [ 'Data 1 table 2', 'Data 2 table 2', 'Data 3 table 2', 'Data 4 table 2', 'Data 5 table 2', ]; $array = array_map(function($v) use ($filter) { if (empty($v)) { $v = array_shift($filter); } return $v; }, $array); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OvLPh
function name:  (null)
number of ops:  13
compiled vars:  !0 = $array, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   23     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          4        BIND_LEXICAL                                             ~4, !1
   28     5        SEND_VAL                                                 ~4
          6        SEND_VAR                                                 !0
   23     7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !0, $5
   29     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/OvLPh
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $v, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   24     2        ISSET_ISEMPTY_CV                                         !0
          3      > JMPZ                                                     ~2, ->8
   25     4    >   INIT_FCALL                                               'array_shift'
          5        SEND_REF                                                 !1
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
   27     8    > > RETURN                                                   !0
   28     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.91 ms | 1012 KiB | 16 Q