3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(array(1, 2), array(1)); $arr = array_map(function ($a) { return count($a) == 1 ? $a[0] : $a; }, $arr); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VIG4Q
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>
    5     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    7     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > 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 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VIG4Q
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        COUNT                                            ~1      !0
          2        IS_EQUAL                                                 ~1, 1
          3      > JMPZ                                                     ~2, ->7
          4    >   FETCH_DIM_R                                      ~3      !0, 0
          5        QM_ASSIGN                                        ~4      ~3
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~4      !0
          8    > > RETURN                                                   ~4
          9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.44 ms | 1011 KiB | 15 Q