3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x() { $a = new stdclass; yield $a => $a; } $b = a(); var_dump($b->current()); var_dump($b->key());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tm4Jp
function name:  (null)
number of ops:  14
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL_BY_NAME                                       'a'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    9     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'current'
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
   10     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'key'
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/Tm4Jp
function name:  x
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        NEW                                              $1      'stdclass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    5     4        YIELD                                                    !0, !0
    6     5      > GENERATOR_RETURN                                         

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.47 ms | 1395 KiB | 15 Q