3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DummyPDO { public function prepare(string $query): void { echo $query; } } class YourClassThatUsesTheDatabase { private $conn; public function __construct(DummyPDO $conn) { $this->conn = $conn; } public function doTheThing(): void { $this->conn->prepare("SELECT ..."); } } $conn = new DummyPDO(); $obj = new YourClassThatUsesTheDatabase($conn); $obj->doTheThing();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bGVmm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $conn, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'DummyPDO'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        NEW                                              $5      'YourClassThatUsesTheDatabase'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   28     7        INIT_METHOD_CALL                                         !1, 'doTheThing'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function prepare

End of class DummyPDO.

Class YourClassThatUsesTheDatabase:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bGVmm
function name:  __construct
number of ops:  4
compiled vars:  !0 = $conn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        ASSIGN_OBJ                                               'conn'
          2        OP_DATA                                                  !0
   17     3      > RETURN                                                   null

End of function __construct

Function dothething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bGVmm
function name:  doTheThing
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'conn'
          1        INIT_METHOD_CALL                                         ~0, 'prepare'
          2        SEND_VAL_EX                                              'SELECT+...'
          3        DO_FCALL                                      0          
   22     4      > RETURN                                                   null

End of function dothething

End of class YourClassThatUsesTheDatabase.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.78 ms | 1395 KiB | 13 Q