3v4l.org

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

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

End of function __construct

Function setid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4s4jh
function name:  setId
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
   11     3      > RETURN                                                   null

End of function setid

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.69 ms | 1395 KiB | 15 Q