3v4l.org

run code in 300+ PHP versions simultaneously
<?php function chk($word) { echo PHP_EOL . 'Word: ' . $word . PHP_EOL; echo 'pattern: 1.' . PHP_EOL; if (preg_match('/^.*[0-90-9]$/u', $word)) { echo 'Ok.' . PHP_EOL; } else { echo 'Ng.' . PHP_EOL; }; echo 'pattern: 2.' . PHP_EOL; if (preg_match('/^[0-90-9]+$/u', $word)) { echo 'Ok.' . PHP_EOL; } else { echo 'Ng.' . PHP_EOL; }; } chk('abc12345'); chk('abc12345'); chk('12345'); chk('12345'); chk('1122334455');
Output for git.master, git.master_jit, rfc.property-hooks
Word: abc12345 pattern: 1. Ok. pattern: 2. Ng. Word: abc12345 pattern: 1. Ok. pattern: 2. Ng. Word: 12345 pattern: 1. Ok. pattern: 2. Ok. Word: 12345 pattern: 1. Ok. pattern: 2. Ok. Word: 1122334455 pattern: 1. Ok. pattern: 2. Ok.

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:
29.98 ms | 406 KiB | 5 Q