3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { /** @var array<string> */ private array $array = []; /** @return array<string> */ public function &getList(): array { return $this->array; } public function rewind(): void { reset($this->getList()); } } $f = new Foo; $f->rewind();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nmiog
function name:  (null)
number of ops:  6
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'rewind'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function getlist:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/nmiog
function name:  getList
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_W                                      $0      'array'
          1        VERIFY_RETURN_TYPE                                       $0
          2      > RETURN_BY_REF                                            $0
   12     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN_BY_REF                                            null

End of function getlist

Function rewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nmiog
function name:  rewind
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'reset'
          1        INIT_METHOD_CALL                                         'getList'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF                               0          $0
          4        DO_ICALL                                                 
   17     5      > RETURN                                                   null

End of function rewind

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.94 ms | 1001 KiB | 14 Q