3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = range(1, 10000); $default = 'Empty'; $output = array_map( function($value) use ($default) { return $value ?: $default; }, $array ); var_dump(implode($output));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lX2NT
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $default, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 10000
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    3     5        ASSIGN                                                   !1, 'Empty'
    5     6        INIT_FCALL                                               'array_map'
    6     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FlX2NT%3A6%240'
          8        BIND_LEXICAL                                             ~6, !1
    8     9        SEND_VAL                                                 ~6
    9    10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $7      
    5    12        ASSIGN                                                   !2, $7
   12    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'implode'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FlX2NT%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lX2NT
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $value, !1 = $default
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    7     2        JMP_SET                                          ~2      !0, ->4
          3        QM_ASSIGN                                        ~2      !1
          4      > RETURN                                                   ~2
    8     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FlX2NT%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.64 ms | 1395 KiB | 21 Q