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 current($i); reset($i); echo current($i); echo "next:" . next($i); echo current($i);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lSiHB
function name:  (null)
number of ops:  30
compiled vars:  !0 = $foo, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        FETCH_OBJ_R                                      ~5      !0, 'bar'
          4        CONCAT                                           ~6      ~5, '%0A'
          5        ECHO                                                     ~6
   17     6        INIT_METHOD_CALL                                         !0, 'doSomething'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
   20     9        INIT_FCALL                                               'current'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        ECHO                                                     $9
   21    13        INIT_FCALL                                               'reset'
         14        SEND_REF                                                 !1
         15        DO_ICALL                                                 
   22    16        INIT_FCALL                                               'current'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $11     
         19        ECHO                                                     $11
   23    20        INIT_FCALL                                               'next'
         21        SEND_REF                                                 !1
         22        DO_ICALL                                         $12     
         23        CONCAT                                           ~13     'next%3A', $12
         24        ECHO                                                     ~13
   24    25        INIT_FCALL                                               'current'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $14     
         28        ECHO                                                     $14
         29      > RETURN                                                   1

Class Foo:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/lSiHB
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:
163.74 ms | 1396 KiB | 19 Q