3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Enable overloading using //+overloaded 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("The value =", $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/1EIDS
function name:  (null)
number of ops:  18
compiled vars:  !0 = $something
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E >   NEW                                                  $1      'Overloaded'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   29     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          
   30     8        INIT_METHOD_CALL                                             !0, 'dump'
          9        DO_FCALL                                          0          
   31    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          
   32    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/1EIDS
function name:  setValue
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   13     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
   14     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/1EIDS
function name:  setVаlue
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
   18     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
   19     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/1EIDS
function name:  dump
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                                   'var_dump'
          1        SEND_VAL                                                     'The+value+%3D'
          2        FETCH_OBJ_R                                          ~0      'value'
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                                     
   24     5      > RETURN                                                       null

End of function dump

End of class Overloaded.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
141.51 ms | 503 KiB | 10 Q