3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $bar = 'A'; public function doSomething() { $this->bar = 'B'; yield; } } $foo = new Foo(); echo $foo->bar . PHP_EOL; $i = $foo->doSomething(); echo $foo->bar . PHP_EOL; print_r($i);
based on UrY1t
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/TBi2v
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  14     1        NEW                                              $3      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $3
  15     4        FETCH_OBJ_R                                      $6      !0, 'bar'
         5        CONCAT                                           ~7      $6, '%0A'
         6        ECHO                                                     ~7
  16     7        INIT_METHOD_CALL                                         !0, 'doSomething'
         8        DO_FCALL                                      0  $8      
         9        ASSIGN                                                   !1, $8
  17    10        FETCH_OBJ_R                                      $10     !0, 'bar'
        11        CONCAT                                           ~11     $10, '%0A'
        12        ECHO                                                     ~11
  18    13        INIT_FCALL                                               'print_r'
        14        SEND_VAR                                                 !1
        15        DO_ICALL                                                 
        16      > RETURN                                                   1

Class Foo:
Function dosomething:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/TBi2v
function name:  doSomething
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E >   ASSIGN_OBJ                                               'bar'
         1        OP_DATA                                                  'B'
  10     2        YIELD                                                    
  11     3      > GENERATOR_RETURN                                         

End of function dosomething

End of class Foo.

Generated using Vulcan Logic Dumper, using php 7.2.0