3v4l.org

run code in 300+ PHP versions simultaneously
<?php class fake_pdo { public function prepare($query){ return $this; } public function execute($array){ echo '<pre>'; print_r($array); } } // Log each login attempt $db = new fake_pdo(); $ipAddress = $_SERVER['REMOTE_ADDR']; $logQuery = "INSERT INTO Logs.Logins (userName, ipAddress) VALUES (:userName,:ipAddress)"; $st = $db->prepare($logQuery); $st->execute(['userName' =>$myName,'ipAddress'=>$ipAddress]); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U4UbI
function name:  (null)
number of ops:  17
compiled vars:  !0 = $db, !1 = $ipAddress, !2 = $logQuery, !3 = $st, !4 = $myName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $5      'fake_pdo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
   15     3        FETCH_R                      global              ~8      '_SERVER'
          4        FETCH_DIM_R                                      ~9      ~8, 'REMOTE_ADDR'
          5        ASSIGN                                                   !1, ~9
   16     6        ASSIGN                                                   !2, 'INSERT+INTO+Logs.Logins+%28userName%2C+ipAddress%29+VALUES+%28%3AuserName%2C%3AipAddress%29'
   17     7        INIT_METHOD_CALL                                         !0, 'prepare'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $12     
         10        ASSIGN                                                   !3, $12
   18    11        INIT_METHOD_CALL                                         !3, 'execute'
         12        INIT_ARRAY                                       ~14     !4, 'userName'
         13        ADD_ARRAY_ELEMENT                                ~14     !1, 'ipAddress'
         14        SEND_VAL_EX                                              ~14
         15        DO_FCALL                                      0          
   19    16      > RETURN                                                   1

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

End of function prepare

Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U4UbI
function name:  execute
number of ops:  6
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ECHO                                                     '%3Cpre%3E'
    9     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   10     5      > RETURN                                                   null

End of function execute

End of class fake_pdo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.88 ms | 1396 KiB | 15 Q