3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PassphraseException extends Exception {} class PassphraseTooShortException extends PassphraseException {} class PassphraseTooLongException extends PassphraseException {} class PassphraseRequiresLetterException extends PassphraseException {} class PassphraseRequiresNumberOrSpecialException extends PassphraseException {} class Passphrase { static function validate($passphrase) { $len = strlen($passphrase); if ($len < 15) { throw new PassphraseTooShortException('Jesus fucking christ, read the requirements you fuck!'); } if ($len > 140) { throw new PassphraseTooLongException('Are you fucking kidding me? How are you going to remember this shit...'); } $no_alpha = str_replace(str_split('abcdefghijklmnopqrstuvwxyz'), '', strtolower($passphrase)); if ($no_alpha === $passphrase) { throw new PassphraseRequiresLetterException('Fucking idiot.'); } if ($no_alpha === '') { throw new PassphraseRequiresNumberOrSpecialException('You fucking fuck, fuck you fucking fucker fuckface fuck.'); } } static function isValid($passphrase) { try { static::validate($passphrase); } catch (PassphraseException $e) { return false; } return true; } } var_dump(Passphrase::isValid('d'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ti4D0
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Passphrase', 'isValid'
          2        SEND_VAL                                                 'd'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class PassphraseException: [no user functions]
Class PassphraseTooShortException: [no user functions]
Class PassphraseTooLongException: [no user functions]
Class PassphraseRequiresLetterException: [no user functions]
Class PassphraseRequiresNumberOrSpecialException: [no user functions]
Class Passphrase:
Function validate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 39
Branch analysis from position: 35
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ti4D0
function name:  validate
number of ops:  40
compiled vars:  !0 = $passphrase, !1 = $len, !2 = $no_alpha
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        STRLEN                                           ~3      !0
          2        ASSIGN                                                   !1, ~3
   11     3        IS_SMALLER                                               !1, 15
          4      > JMPZ                                                     ~5, ->9
   12     5    >   NEW                                              $6      'PassphraseTooShortException'
          6        SEND_VAL_EX                                              'Jesus+fucking+christ%2C+read+the+requirements+you+fuck%21'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $6
   14     9    >   IS_SMALLER                                               140, !1
         10      > JMPZ                                                     ~8, ->15
   15    11    >   NEW                                              $9      'PassphraseTooLongException'
         12        SEND_VAL_EX                                              'Are+you+fucking+kidding+me%3F+How+are+you+going+to+remember+this+shit...'
         13        DO_FCALL                                      0          
         14      > THROW                                         0          $9
   17    15    >   INIT_FCALL                                               'str_replace'
         16        INIT_FCALL                                               'str_split'
         17        SEND_VAL                                                 'abcdefghijklmnopqrstuvwxyz'
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        SEND_VAL                                                 ''
         21        INIT_FCALL                                               'strtolower'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                         $13     
         26        ASSIGN                                                   !2, $13
   18    27        IS_IDENTICAL                                             !2, !0
         28      > JMPZ                                                     ~15, ->33
   19    29    >   NEW                                              $16     'PassphraseRequiresLetterException'
         30        SEND_VAL_EX                                              'Fucking+idiot.'
         31        DO_FCALL                                      0          
         32      > THROW                                         0          $16
   21    33    >   IS_IDENTICAL                                             !2, ''
         34      > JMPZ                                                     ~18, ->39
   22    35    >   NEW                                              $19     'PassphraseRequiresNumberOrSpecialException'
         36        SEND_VAL_EX                                              'You+fucking+fuck%2C+fuck+you+fucking+fucker+fuckface+fuck.'
         37        DO_FCALL                                      0          
         38      > THROW                                         0          $19
   24    39    > > RETURN                                                   null

End of function validate

Function isvalid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ti4D0
function name:  isValid
number of ops:  9
compiled vars:  !0 = $passphrase, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        INIT_STATIC_METHOD_CALL                                  'validate'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->7
   29     5  E > > CATCH                                       last         'PassphraseException'
   30     6    > > RETURN                                                   <false>
   32     7    > > RETURN                                                   <true>
   33     8*     > RETURN                                                   null

End of function isvalid

End of class Passphrase.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.23 ms | 1400 KiB | 21 Q