3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $field; public function setField($field) { $this->field = $field; } } $test1 = new Test(); $test2 = new Test(); $arr = array(); $arr[] = $test1; $arr[] = $test2; $arr[0]->setField(10); $arr[1]->setField(20); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SnYBg
function name:  (null)
number of ops:  23
compiled vars:  !0 = $test1, !1 = $test2, !2 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   11     3        NEW                                              $6      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   13     6        ASSIGN                                                   !2, <array>
   14     7        ASSIGN_DIM                                               !2
          8        OP_DATA                                                  !0
   15     9        ASSIGN_DIM                                               !2
         10        OP_DATA                                                  !1
   17    11        FETCH_DIM_R                                      ~12     !2, 0
         12        INIT_METHOD_CALL                                         ~12, 'setField'
         13        SEND_VAL_EX                                              10
         14        DO_FCALL                                      0          
   18    15        FETCH_DIM_R                                      ~14     !2, 1
         16        INIT_METHOD_CALL                                         ~14, 'setField'
         17        SEND_VAL_EX                                              20
         18        DO_FCALL                                      0          
   20    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class Test:
Function setfield:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SnYBg
function name:  setField
number of ops:  4
compiled vars:  !0 = $field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'field'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function setfield

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.39 ms | 1395 KiB | 15 Q