3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected $reference; protected $items = [ 'test', 'test2', 'test3' ]; public function setupReferenceMiddle() { $this->reference = &$this->items[1]; } public function setupReferenceEnd() { $this->reference = &$this->items[2]; } public function output() { return implode(', ', $this->items) . PHP_EOL; } public function modify($value) { $this->reference = $value; } } $test = new Test; echo $test->output(); $test->setupReferenceMiddle(); $test->modify('middle'); echo $test->output(); $test->setupReferenceEnd(); $test->modify('end'); echo $test->output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd3HX
function name:  (null)
number of ops:  23
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   33     3        INIT_METHOD_CALL                                         !0, 'output'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   35     6        INIT_METHOD_CALL                                         !0, 'setupReferenceMiddle'
          7        DO_FCALL                                      0          
   36     8        INIT_METHOD_CALL                                         !0, 'modify'
          9        SEND_VAL_EX                                              'middle'
         10        DO_FCALL                                      0          
   37    11        INIT_METHOD_CALL                                         !0, 'output'
         12        DO_FCALL                                      0  $7      
         13        ECHO                                                     $7
   39    14        INIT_METHOD_CALL                                         !0, 'setupReferenceEnd'
         15        DO_FCALL                                      0          
   40    16        INIT_METHOD_CALL                                         !0, 'modify'
         17        SEND_VAL_EX                                              'end'
         18        DO_FCALL                                      0          
   41    19        INIT_METHOD_CALL                                         !0, 'output'
         20        DO_FCALL                                      0  $10     
         21        ECHO                                                     $10
         22      > RETURN                                                   1

Class Test:
Function setupreferencemiddle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd3HX
function name:  setupReferenceMiddle
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_W                                      $1      'items'
          1        FETCH_DIM_W                                      $2      $1, 1
          2        MAKE_REF                                         $3      $2
          3        ASSIGN_OBJ_REF                                           'reference'
          4        OP_DATA                                                  $3
   14     5      > RETURN                                                   null

End of function setupreferencemiddle

Function setupreferenceend:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd3HX
function name:  setupReferenceEnd
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_W                                      $1      'items'
          1        FETCH_DIM_W                                      $2      $1, 2
          2        MAKE_REF                                         $3      $2
          3        ASSIGN_OBJ_REF                                           'reference'
          4        OP_DATA                                                  $3
   19     5      > RETURN                                                   null

End of function setupreferenceend

Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd3HX
function name:  output
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'implode'
          1        SEND_VAL                                                 '%2C+'
          2        FETCH_OBJ_R                                      ~0      'items'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5        CONCAT                                           ~2      $1, '%0A'
          6      > RETURN                                                   ~2
   24     7*     > RETURN                                                   null

End of function output

Function modify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd3HX
function name:  modify
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        ASSIGN_OBJ                                               'reference'
          2        OP_DATA                                                  !0
   29     3      > RETURN                                                   null

End of function modify

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.08 ms | 1400 KiB | 15 Q