3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B {} class Overloaded { protected $value; //+overloaded function setValue(A $x) { $this->value = $x; } //+overloaded function setVаlue(B $x) { $this->value = $x; } function dump() { var_dump($this->value); } } $something = new Overloaded(); $something->setValue(new A); $something->dump(); $something->setVаlue(new B); $something->dump();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhd0M
function name:  (null)
number of ops:  18
compiled vars:  !0 = $something
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'Overloaded'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        INIT_METHOD_CALL                                         !0, 'setValue'
          4        NEW                                              $4      'A'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0          
   28     8        INIT_METHOD_CALL                                         !0, 'dump'
          9        DO_FCALL                                      0          
   29    10        INIT_METHOD_CALL                                         !0, 'setV%D0%B0lue'
         11        NEW                                              $8      'B'
         12        DO_FCALL                                      0          
         13        SEND_VAR_NO_REF_EX                                       $8
         14        DO_FCALL                                      0          
   30    15        INIT_METHOD_CALL                                         !0, 'dump'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class Overloaded:
Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhd0M
function name:  setValue
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function setvalue

Function setv%D0%B0lue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhd0M
function name:  setVаlue
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   17     3      > RETURN                                                   null

End of function setv%D0%B0lue

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uhd0M
function name:  dump
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~0      'value'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   22     4      > RETURN                                                   null

End of function dump

End of class Overloaded.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.67 ms | 1400 KiB | 15 Q