3v4l.org

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

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

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

Function %00%7Bclosure%7D%2Fin%2FTvZV0%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TvZV0
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $n, !1 = $factor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        MUL                                              ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FTvZV0%3A12%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.24 ms | 1396 KiB | 17 Q