3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Loginhandler{ public $email; public $password; private $verification; private $db; public function __construct($database) { $this->db = $database; } public function login($email, $password) { $query = $this->db->prepare("SELECT * FROM `leden` WHERE `email` = :email AND `wachtwoord` = :password"); $query->bindValue(":email", $email); $query->bindValue(":password", $password); try{ $query->execute(); $data = $query->rowCount(); if($data == '1'){ return true; }else{ return false; } }catch(PDOException $e){ die($e->getMessage()); } } public function user_exists($email) { $query = $this->db->prepare("SELECT COUNT(`id`) FROM `leden` WHERE `email`= ?"); $query->bindValue(1, $email); try{ $query->execute(); $rows = $query->fetchColumn(); if($rows == 1){ return true; }else{ return false; } } catch (PDOException $e){ die($e->getMessage()); } } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z2K6D
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E > > RETURN                                                   1

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

End of function __construct

Function login:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 26
Branch analysis from position: 26
2 jumps found. (Code = 107) Position 1 = 27, Position 2 = -2
Branch analysis from position: 27
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/Z2K6D
function name:  login
number of ops:  31
compiled vars:  !0 = $email, !1 = $password, !2 = $query, !3 = $data, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        FETCH_OBJ_R                                      ~5      'db'
          3        INIT_METHOD_CALL                                         ~5, 'prepare'
          4        SEND_VAL_EX                                              'SELECT+%2A+FROM+%60leden%60+WHERE+%60email%60+%3D+%3Aemail+AND+%60wachtwoord%60+%3D+%3Apassword'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !2, $6
   17     7        INIT_METHOD_CALL                                         !2, 'bindValue'
          8        SEND_VAL_EX                                              '%3Aemail'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   18    11        INIT_METHOD_CALL                                         !2, 'bindValue'
         12        SEND_VAL_EX                                              '%3Apassword'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
   22    15        INIT_METHOD_CALL                                         !2, 'execute'
         16        DO_FCALL                                      0          
   23    17        INIT_METHOD_CALL                                         !2, 'rowCount'
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !3, $11
   24    20        IS_EQUAL                                                 !3, '1'
         21      > JMPZ                                                     ~13, ->24
   25    22    > > RETURN                                                   <true>
         23*       JMP                                                      ->25
   27    24    > > RETURN                                                   <false>
         25*       JMP                                                      ->30
   30    26  E > > CATCH                                       last         'PDOException'
   31    27    >   INIT_METHOD_CALL                                         !4, 'getMessage'
         28        DO_FCALL                                      0  $14     
         29      > EXIT                                                     $14
   33    30*     > RETURN                                                   null

End of function login

Function user_exists:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 21
Branch analysis from position: 21
2 jumps found. (Code = 107) Position 1 = 22, Position 2 = -2
Branch analysis from position: 22
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/Z2K6D
function name:  user_exists
number of ops:  26
compiled vars:  !0 = $email, !1 = $query, !2 = $rows, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   37     1        FETCH_OBJ_R                                      ~4      'db'
          2        INIT_METHOD_CALL                                         ~4, 'prepare'
          3        SEND_VAL_EX                                              'SELECT+COUNT%28%60id%60%29+FROM+%60leden%60+WHERE+%60email%60%3D+%3F'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   38     6        INIT_METHOD_CALL                                         !1, 'bindValue'
          7        SEND_VAL_EX                                              1
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   42    10        INIT_METHOD_CALL                                         !1, 'execute'
         11        DO_FCALL                                      0          
   43    12        INIT_METHOD_CALL                                         !1, 'fetchColumn'
         13        DO_FCALL                                      0  $9      
         14        ASSIGN                                                   !2, $9
   45    15        IS_EQUAL                                                 !2, 1
         16      > JMPZ                                                     ~11, ->19
   46    17    > > RETURN                                                   <true>
         18*       JMP                                                      ->20
   48    19    > > RETURN                                                   <false>
         20*       JMP                                                      ->25
   51    21  E > > CATCH                                       last         'PDOException'
   52    22    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         23        DO_FCALL                                      0  $12     
         24      > EXIT                                                     $12
   55    25*     > RETURN                                                   null

End of function user_exists

End of class Loginhandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.18 ms | 1399 KiB | 13 Q