3v4l.org

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

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.29 ms | 1397 KiB | 18 Q