3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = 'A'; public function doSomething() { $this->bar = 'B'; echo "fuck you"; yield 1; } } $foo = new Foo(); echo $foo->bar . PHP_EOL; $i = $foo->doSomething(); echo $foo->bar . PHP_EOL; reset($i); echo $foo->bar; foreach ($i as $b) { echo $b; } echo $foo->bar;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/GduUu
function name:  (null)
number of ops:  25
compiled vars:  !0 = $foo, !1 = $i, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   16     3        FETCH_OBJ_R                                      ~6      !0, 'bar'
          4        CONCAT                                           ~7      ~6, '%0A'
          5        ECHO                                                     ~7
   17     6        INIT_METHOD_CALL                                         !0, 'doSomething'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !1, $8
   18     9        FETCH_OBJ_R                                      ~10     !0, 'bar'
         10        CONCAT                                           ~11     ~10, '%0A'
         11        ECHO                                                     ~11
   20    12        INIT_FCALL                                               'reset'
         13        SEND_REF                                                 !1
         14        DO_ICALL                                                 
   21    15        FETCH_OBJ_R                                      ~13     !0, 'bar'
         16        ECHO                                                     ~13
   22    17      > FE_RESET_R                                       $14     !1, ->21
         18    > > FE_FETCH_R                                               $14, !2, ->21
   23    19    >   ECHO                                                     !2
   22    20      > JMP                                                      ->18
         21    >   FE_FREE                                                  $14
   26    22        FETCH_OBJ_R                                      ~15     !0, 'bar'
         23        ECHO                                                     ~15
         24      > RETURN                                                   1

Class Foo:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/GduUu
function name:  doSomething
number of ops:  6
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        ECHO                                                     'fuck+you'
   11     4        YIELD                                                    1
   12     5      > GENERATOR_RETURN                                         

End of function dosomething

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1396 KiB | 15 Q