3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Doge { private $name = "Testing"; public function __construct($name) { } public function getName() { return $this->name; } public function equalsWithSameType(self $other) { return ($other->name === $this->name); } public function equalsWithSubType(DogeCoin $sub) { return ($sub->name === $this->name); } public function foo(Doge $d){ return ($d->name === $this->name); } } class DogeCoin extends Doge { private $name = "Testing"; } $doge = new Doge('a'); $doge_coin = new DogeCoin('a'); var_dump($doge->foo($doge_coin));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  (null)
number of ops:  15
compiled vars:  !0 = $doge, !1 = $doge_coin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   NEW                                              $2      'Doge'
          1        SEND_VAL_EX                                              'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   40     4        NEW                                              $5      'DogeCoin'
          5        SEND_VAL_EX                                              'a'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   42     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'foo'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Doge:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  __construct
number of ops:  2
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1      > RETURN                                                   null

End of function __construct

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

End of function getname

Function equalswithsametype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  equalsWithSameType
number of ops:  6
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   19     5*     > RETURN                                                   null

End of function equalswithsametype

Function equalswithsubtype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  equalsWithSubType
number of ops:  6
compiled vars:  !0 = $sub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   24     5*     > RETURN                                                   null

End of function equalswithsubtype

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  foo
number of ops:  6
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   28     5*     > RETURN                                                   null

End of function foo

End of class Doge.

Class DogeCoin:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  __construct
number of ops:  2
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1      > RETURN                                                   null

End of function __construct

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

End of function getname

Function equalswithsametype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  equalsWithSameType
number of ops:  6
compiled vars:  !0 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   19     5*     > RETURN                                                   null

End of function equalswithsametype

Function equalswithsubtype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  equalsWithSubType
number of ops:  6
compiled vars:  !0 = $sub
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   24     5*     > RETURN                                                   null

End of function equalswithsubtype

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Mg9nt
function name:  foo
number of ops:  6
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   28     5*     > RETURN                                                   null

End of function foo

End of class DogeCoin.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1404 KiB | 15 Q