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...'); } $no_alpha = str_replace(str_split('abcdefghijklmnopqrstuvwxyz'), '', strtolower($lowerpass)); echo $no_alpha;exit; if ($passphrase === $lowerpass) { throw new PassphraseRequiresUppercaseLetterException('Fucking idiot.'); } $lowerpass = strtolower($passphrase); 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; } } Passphrase::validate('qt3point141592653589793238');
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $lowerpass in /in/ulHUW on line 17 Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /in/ulHUW on line 17

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.17 ms | 401 KiB | 8 Q