3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array_replace( array_fill_keys( array_map( function ($x) { return sprintf("%02d", $x); }, range(1, 10, 1) ), 0), ["04" => 1, "09" => 1, "10" => 1, "01" => 1]); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SunLO
function name:  (null)
number of ops:  23
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_replace'
    4     1        INIT_FCALL                                               'array_fill_keys'
    5     2        INIT_FCALL                                               'array_map'
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FSunLO%3A6%240'
    8     4        SEND_VAL                                                 ~1
    9     5        INIT_FCALL                                               'range'
          6        SEND_VAL                                                 1
          7        SEND_VAL                                                 10
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
   10    13        SEND_VAL                                                 0
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        SEND_VAL                                                 <array>
         17        DO_ICALL                                         $5      
    3    18        ASSIGN                                                   !0, $5
   12    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FSunLO%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SunLO
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%2502d'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
    8     6*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.26 ms | 1407 KiB | 25 Q