3v4l.org

run code in 300+ PHP versions simultaneously
<?php class b { protected $object; public function __construct() { $this->object = new stdClass(); $this->object->name = "default"; } public function setObject(a $object) { $this->object = $object; } public function getObject() { return $this->object; } public function __clone() { $this->object = clone $this->object; } } class runner extends b { public $target; public function __construct() { parent::__construct(); $this->target = new b(); } public function run() { $object1 = new stdClass(); $object1->name = "object1"; $object2 = new stdClass(); $object2->name = "object2"; if (1 == 2) { // } elseif ($object1 instanceof $this->target->object) { $b2 = clone $this->target; $b2->object = $object1; echo $b2->object->name; } } } $runner = new runner(); $runner->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rhpFF
function name:  (null)
number of ops:  6
compiled vars:  !0 = $runner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   NEW                                              $1      'runner'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   54     3        INIT_METHOD_CALL                                         !0, 'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class b:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rhpFF
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'object'
          3        OP_DATA                                                  $1
    8     4        FETCH_OBJ_W                                      $3      'object'
          5        ASSIGN_OBJ                                               $3, 'name'
          6        OP_DATA                                                  'default'
    9     7      > RETURN                                                   null

End of function __construct

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

End of function setobject

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

End of function getobject

Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rhpFF
function name:  __clone
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~1      'object'
          1        CLONE                                            ~2      ~1
          2        ASSIGN_OBJ                                               'object'
          3        OP_DATA                                                  ~2
   21     4      > RETURN                                                   null

End of function __clone

End of class b.

Class runner:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rhpFF
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   31     2        NEW                                              $2      'b'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'target'
          5        OP_DATA                                                  $2
   32     6      > RETURN                                                   null

End of function __construct

Function run:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/rhpFF
function name:  run
number of ops:  26
compiled vars:  !0 = $object1, !1 = $object2, !2 = $b2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   37     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'object1'
   38     5        NEW                                              $7      'stdClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   39     8        ASSIGN_OBJ                                               !1, 'name'
          9        OP_DATA                                                  'object2'
   42    10      > JMPZ                                                     <false>, ->12
         11    > > JMP                                                      ->25
   44    12    >   FETCH_OBJ_R                                      ~11     'target'
         13        FETCH_OBJ_R                                      ~12     ~11, 'object'
         14        FETCH_CLASS                                   0  $13     ~12
         15        INSTANCEOF                                               !0, $13
         16      > JMPZ                                                     ~14, ->25
   45    17    >   FETCH_OBJ_R                                      ~15     'target'
         18        CLONE                                            ~16     ~15
         19        ASSIGN                                                   !2, ~16
   46    20        ASSIGN_OBJ                                               !2, 'object'
         21        OP_DATA                                                  !0
   47    22        FETCH_OBJ_R                                      ~19     !2, 'object'
         23        FETCH_OBJ_R                                      ~20     ~19, 'name'
         24        ECHO                                                     ~20
   49    25    > > RETURN                                                   null

End of function run

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

End of function setobject

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

End of function getobject

Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rhpFF
function name:  __clone
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~1      'object'
          1        CLONE                                            ~2      ~1
          2        ASSIGN_OBJ                                               'object'
          3        OP_DATA                                                  ~2
   21     4      > RETURN                                                   null

End of function __clone

End of class runner.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.76 ms | 1394 KiB | 13 Q