3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PassphraseException extends Exception {} class PassphraseTooShortException extends PassphraseException {} class PassphraseTooLongException extends PassphraseException {} class PassphraseRequiresUppercaseLetterException 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...'); } $lowerpass = strtolower($passphrase); if ($passphrase === $lowerpass) { throw new PassphraseRequiresUppercaseLetterException('Fucking idiot.'); } if (str_replace(str_split('abcdefghijklmnopqrstuvwxyz'), '', $lowerpass) === '') { 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('qt3point141592653589793238'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hLNFb
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                                                 'qt3point141592653589793238'
          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 PassphraseRequiresUppercaseLetterException: [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 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 25
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/hLNFb
function name:  validate
number of ops:  40
compiled vars:  !0 = $passphrase, !1 = $len, !2 = $lowerpass
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                                               'strtolower'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
   18    19        IS_IDENTICAL                                             !0, !2
         20      > JMPZ                                                     ~13, ->25
   19    21    >   NEW                                              $14     'PassphraseRequiresUppercaseLetterException'
         22        SEND_VAL_EX                                              'Fucking+idiot.'
         23        DO_FCALL                                      0          
         24      > THROW                                         0          $14
   21    25    >   INIT_FCALL                                               'str_replace'
         26        INIT_FCALL                                               'str_split'
         27        SEND_VAL                                                 'abcdefghijklmnopqrstuvwxyz'
         28        DO_ICALL                                         $16     
         29        SEND_VAR                                                 $16
         30        SEND_VAL                                                 ''
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $17     
         33        IS_IDENTICAL                                             $17, ''
         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/hLNFb
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:
157.47 ms | 1400 KiB | 21 Q