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)); echo $no_alpha;exit; if ($no_alpha === $passphrase) { throw new PassphraseRequiresLetterException('Fucking idiot.'); } $lowerpass = strtolower($passphrase); 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; } } Passphrase::validate('qt3point141592653589793238');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H544H
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_STATIC_METHOD_CALL                                  'Passphrase', 'validate'
          1        SEND_VAL                                                 'qt3point141592653589793238'
          2        DO_FCALL                                      0          
          3      > 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
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/H544H
function name:  validate
number of ops:  46
compiled vars:  !0 = $passphrase, !1 = $len, !2 = $no_alpha, !3 = $lowerpass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        STRLEN                                           ~4      !0
          2        ASSIGN                                                   !1, ~4
   11     3        IS_SMALLER                                               !1, 15
          4      > JMPZ                                                     ~6, ->9
   12     5    >   NEW                                              $7      'PassphraseTooShortException'
          6        SEND_VAL_EX                                              'Jesus+fucking+christ%2C+read+the+requirements+you+fuck%21'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $7
   14     9    >   IS_SMALLER                                               140, !1
         10      > JMPZ                                                     ~9, ->15
   15    11    >   NEW                                              $10     '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          $10
   17    15    >   INIT_FCALL                                               'str_replace'
         16        INIT_FCALL                                               'str_split'
         17        SEND_VAL                                                 'abcdefghijklmnopqrstuvwxyz'
         18        DO_ICALL                                         $12     
         19        SEND_VAR                                                 $12
         20        SEND_VAL                                                 ''
         21        INIT_FCALL                                               'strtolower'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $13     
         24        SEND_VAR                                                 $13
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !2, $14
   18    27        ECHO                                                     !2
         28      > EXIT                                                     
   19    29*       IS_IDENTICAL                                             !2, !0
         30*       JMPZ                                                     ~16, ->35
   20    31*       NEW                                              $17     'PassphraseRequiresLetterException'
         32*       SEND_VAL_EX                                              'Fucking+idiot.'
         33*       DO_FCALL                                      0          
         34*       THROW                                         0          $17
   22    35*       INIT_FCALL                                               'strtolower'
         36*       SEND_VAR                                                 !0
         37*       DO_ICALL                                         $19     
         38*       ASSIGN                                                   !3, $19
   23    39*       IS_IDENTICAL                                             !2, ''
         40*       JMPZ                                                     ~21, ->45
   24    41*       NEW                                              $22     'PassphraseRequiresNumberOrSpecialException'
         42*       SEND_VAL_EX                                              'You+fucking+fuck%2C+fuck+you+fucking+fucker+fuckface+fuck.'
         43*       DO_FCALL                                      0          
         44*       THROW                                         0          $22
   26    45*     > 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/H544H
function name:  isValid
number of ops:  9
compiled vars:  !0 = $passphrase, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   30     1        INIT_STATIC_METHOD_CALL                                  'validate'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->7
   31     5  E > > CATCH                                       last         'PassphraseException'
   32     6    > > RETURN                                                   <false>
   34     7    > > RETURN                                                   <true>
   35     8*     > RETURN                                                   null

End of function isvalid

End of class Passphrase.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.73 ms | 1400 KiB | 19 Q