3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is our range of numbers $numbers = range(1, 5); // Our closure $double = function($a) { return $a * 2; }; // Use the closure as a callback here to // double the size of each element in our // range $new_numbers = array_map($double, $numbers); print implode(' ', $new_numbers); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pOTkX
function name:  (null)
number of ops:  18
compiled vars:  !0 = $numbers, !1 = $double, !2 = $new_numbers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 5
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    7     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpOTkX%3A7%240'
          6        ASSIGN                                                   !1, ~5
   14     7        INIT_FCALL                                               'array_map'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   16    12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 '+'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $9      
         16        ECHO                                                     $9
   17    17      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FpOTkX%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.4 ms | 1395 KiB | 19 Q