3v4l.org

run code in 300+ PHP versions simultaneously
<?php function connect($login, $password) { throw new exception ("Connect error!"); } echo "Credentials exposed\n"; try { try { connect("login", "password"); } catch (Throwable $e){ throw $e; } } catch (Throwable $e){ echo $e; // only for demonsration! do no use echo in the catch block } echo "\n\nCredentials hidden:\n"; try { try { connect("login", "password"); } catch (Throwable $e) { throw new exception($e->getMessage()); } } catch (Throwable $e) { echo $e; // only for demonsration! do no use echo in the catch block }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Found catch point at position: 17
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = -2
Branch analysis from position: 18
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 25
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Ygq8
function name:  (null)
number of ops:  28
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'Credentials+exposed%0A'
   10     1        INIT_FCALL                                               'connect'
          2        SEND_VAL                                                 'login'
          3        SEND_VAL                                                 'password'
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->8
   11     6  E > > CATCH                                       last         'Throwable'
   12     7    > > THROW                                         0          !0
          8    > > JMP                                                      ->11
   14     9  E > > CATCH                                       last         'Throwable'
   15    10    >   ECHO                                                     !0
   17    11    >   ECHO                                                     '%0A%0ACredentials+hidden%3A%0A'
   20    12        INIT_FCALL                                               'connect'
         13        SEND_VAL                                                 'login'
         14        SEND_VAL                                                 'password'
         15        DO_FCALL                                      0          
         16      > JMP                                                      ->24
   21    17  E > > CATCH                                       last         'Throwable'
   22    18    >   NEW                                              $3      'exception'
         19        INIT_METHOD_CALL                                         !0, 'getMessage'
         20        DO_FCALL                                      0  $4      
         21        SEND_VAR_NO_REF_EX                                       $4
         22        DO_FCALL                                      0          
         23      > THROW                                         0          $3
         24    > > JMP                                                      ->27
   24    25  E > > CATCH                                       last         'Throwable'
   25    26    >   ECHO                                                     !0
   26    27    > > RETURN                                                   1

Function connect:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/3Ygq8
function name:  connect
number of ops:  7
compiled vars:  !0 = $login, !1 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        NEW                                              $2      'exception'
          3        SEND_VAL_EX                                              'Connect+error%21'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $2
    5     6*     > RETURN                                                   null

End of function connect

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.37 ms | 1019 KiB | 15 Q