3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function bar() { var_dump($this instanceof self); yield; } } var_dump((new foo)->bar()->next());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pFPQU
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'bar'
          4        DO_FCALL                                      0  $2      
          5        INIT_METHOD_CALL                                         $2, 'next'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/pFPQU
function name:  bar
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GENERATOR_CREATE                                         
    5     1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       ~0      
          3        INSTANCEOF                                       ~1      ~0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
    6     6        YIELD                                                    
    7     7      > GENERATOR_RETURN                                         

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.34 ms | 1399 KiB | 15 Q