3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FdEv21%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/dEv21
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                                    'potato'
    5     2      > GENERATOR_RETURN                                         

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.55 ms | 1395 KiB | 17 Q