3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RegexTranslator { const INT = '[0-9]+'; const ALPHA = '[a-zA-Z_-]+'; const ALNUM = '[a-zA-Z0-9_-]+'; public static function translate($string) { if (!is_string($string)) { throw InvalidArgumentException(); } if (!defined(__CLASS__ . "::$string")) { throw new InvalidArgumentException('No regex translation found for this string'); } else { return constant(__CLASS__ . "::$string"); } } } echo RegexTranslator::translate('int');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught InvalidArgumentException: No regex translation found for this string in /in/asLBb:15 Stack trace: #0 /in/asLBb(24): RegexTranslator::translate('int') #1 {main} thrown in /in/asLBb on line 15
Process exited with code 255.

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:
57.18 ms | 401 KiB | 8 Q