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 equalsWithRandomType(SomethingElseCompletely $whatever_man) { return ($whatever_man->name === $this->name); } } class DogeCoin extends Doge { private $name; public function foo(Doge $d){ return ($d->name === $this->name); } } $first_doge = new Doge('a'); $second_doge = new Doge('a'); $doge_coin = new DogeCoin('a'); $doge_coin->foo($first_doge);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/90mER
function name:  (null)
number of ops:  16
compiled vars:  !0 = $first_doge, !1 = $second_doge, !2 = $doge_coin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   NEW                                              $3      'Doge'
          1        SEND_VAL_EX                                              'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   43     4        NEW                                              $6      'Doge'
          5        SEND_VAL_EX                                              'a'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   44     8        NEW                                              $9      'DogeCoin'
          9        SEND_VAL_EX                                              'a'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
   46    12        INIT_METHOD_CALL                                         !2, 'foo'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class Doge:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/90mER
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/90mER
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/90mER
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/90mER
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 equalswithrandomtype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/90mER
function name:  equalsWithRandomType
number of ops:  6
compiled vars:  !0 = $whatever_man
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   29     5*     > RETURN                                                   null

End of function equalswithrandomtype

End of class Doge.

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

End of function foo

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/90mER
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/90mER
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/90mER
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/90mER
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 equalswithrandomtype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/90mER
function name:  equalsWithRandomType
number of ops:  6
compiled vars:  !0 = $whatever_man
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        FETCH_OBJ_R                                      ~1      !0, 'name'
          2        FETCH_OBJ_R                                      ~2      'name'
          3        IS_IDENTICAL                                     ~3      ~1, ~2
          4      > RETURN                                                   ~3
   29     5*     > RETURN                                                   null

End of function equalswithrandomtype

End of class DogeCoin.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.89 ms | 1394 KiB | 13 Q