3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "foo" => "bar", "bar" => "baz" ]; $callback = function($value, $key) { echo "Key: $key, Value: $value\n"; }; array_map($callback, $array, array_keys($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5WIt
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fm5WIt%3A8%240'
          2        ASSIGN                                                   !1, ~3
   12     3        INIT_FCALL                                               'array_map'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        INIT_FCALL                                               'array_keys'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fm5WIt%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m5WIt
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $value, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ROPE_INIT                                     5  ~3      'Key%3A+'
          3        ROPE_ADD                                      1  ~3      ~3, !1
          4        ROPE_ADD                                      2  ~3      ~3, '%2C+Value%3A+'
          5        ROPE_ADD                                      3  ~3      ~3, !0
          6        ROPE_END                                      4  ~2      ~3, '%0A'
          7        ECHO                                                     ~2
   10     8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fm5WIt%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.4 ms | 1395 KiB | 17 Q