3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mapped = array_map(function($a) { return $a * 2; }, (function() { yield "foo" => 1; yield "bar" => 21; })()); var_dump($mapped);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/74VZY
function name:  (null)
number of ops:  13
compiled vars:  !0 = $mapped
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F74VZY%3A3%240'
    5     2        SEND_VAL                                                 ~1
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F74VZY%3A5%241'
    8     4        INIT_DYNAMIC_CALL                                        ~2
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                         $4      
    3     8        ASSIGN                                                   !0, $4
   10     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F74VZY%3A3%240

Function %00%7Bclosure%7D%2Fin%2F74VZY%3A5%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/74VZY
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   GENERATOR_CREATE                                         
    6     1        YIELD                                                    1, 'foo'
    7     2        YIELD                                                    21, 'bar'
    8     3      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2F74VZY%3A5%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.85 ms | 1396 KiB | 17 Q