3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TBi2v
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        FETCH_OBJ_R                                      ~5      !0, 'bar'
          4        CONCAT                                           ~6      ~5, '%0A'
          5        ECHO                                                     ~6
   16     6        INIT_METHOD_CALL                                         !0, 'doSomething'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
   17     9        FETCH_OBJ_R                                      ~9      !0, 'bar'
         10        CONCAT                                           ~10     ~9, '%0A'
         11        ECHO                                                     ~10
   18    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

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

End of function dosomething

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.23 ms | 1395 KiB | 15 Q