3v4l.org

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

Class Test:
Function setfiled:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqYfs
function name:  setFiled
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 setfiled

Function getfield:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqYfs
function name:  getField
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'field'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function getfield

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.32 ms | 1396 KiB | 15 Q