3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public $foo = 'x'; } class A { public function convertToDatabaseValue($value) { return $value; } } class B { public function convertToDatabaseValue(X $value) { // if (!($value instanceof X)) { // throw new \InvalidArgumentException(); // } return $value->foo; } } $foo = new X(); $bar = new B(); echo $bar->convertToDatabaseValue($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X2h9i
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   28     6        INIT_METHOD_CALL                                         !1, 'convertToDatabaseValue'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $8      
          9        ECHO                                                     $8
         10      > RETURN                                                   1

Class X: [no user functions]
Class A:
Function converttodatabasevalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X2h9i
function name:  convertToDatabaseValue
number of ops:  3
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1      > RETURN                                                   !0
   11     2*     > RETURN                                                   null

End of function converttodatabasevalue

End of class A.

Class B:
Function converttodatabasevalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X2h9i
function name:  convertToDatabaseValue
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   21     1        FETCH_OBJ_R                                      ~1      !0, 'foo'
          2      > RETURN                                                   ~1
   22     3*     > RETURN                                                   null

End of function converttodatabasevalue

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.13 ms | 1394 KiB | 13 Q