3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = 'text 1234'; $regexes = [ 'syntax_error' => '`[0-9`', 'incomplete' => '`[0-9', // Missing close delimiter. ]; foreach ($regexes as $name => $pattern) { echo PHP_EOL, 'Currently testing regex: "', $name, '"', PHP_EOL; echo 'preg_filter: ', PHP_EOL; preg_filter($pattern, '', $subject); echo 'preg_grep: ', PHP_EOL; preg_grep($pattern, [$subject]); echo 'preg_match_all: ', PHP_EOL; preg_match_all($pattern, $subject); echo 'preg_match: ', PHP_EOL; preg_match($pattern, $subject); if (function_exists('preg_replace_callback_array')) { echo 'preg_replace_callback_array: ', PHP_EOL; preg_replace_callback_array([$pattern => function() {return '';}], $subject); } echo 'preg_replace_callback: ', PHP_EOL; preg_replace_callback($pattern, function() {return '';}, $subject); echo 'preg_replace: ', PHP_EOL; preg_replace($pattern, '', $subject); echo 'preg_split: ', PHP_EOL; preg_split($pattern, $subject); }
Output for git.master, git.master_jit, rfc.property-hooks
Currently testing regex: "syntax_error" preg_filter: Warning: preg_filter(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 14 preg_grep: Warning: preg_grep(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 17 preg_match_all: Warning: preg_match_all(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 20 preg_match: Warning: preg_match(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 23 preg_replace_callback_array: Warning: preg_replace_callback_array(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 27 preg_replace_callback: Warning: preg_replace_callback(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 31 preg_replace: Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 34 preg_split: Warning: preg_split(): Compilation failed: missing terminating ] for character class at offset 4 in /in/WkVIW on line 37 Currently testing regex: "incomplete" preg_filter: Warning: preg_filter(): No ending delimiter '`' found in /in/WkVIW on line 14 preg_grep: Warning: preg_grep(): No ending delimiter '`' found in /in/WkVIW on line 17 preg_match_all: Warning: preg_match_all(): No ending delimiter '`' found in /in/WkVIW on line 20 preg_match: Warning: preg_match(): No ending delimiter '`' found in /in/WkVIW on line 23 preg_replace_callback_array: Warning: preg_replace_callback_array(): No ending delimiter '`' found in /in/WkVIW on line 27 preg_replace_callback: Warning: preg_replace_callback(): No ending delimiter '`' found in /in/WkVIW on line 31 preg_replace: Warning: preg_replace(): No ending delimiter '`' found in /in/WkVIW on line 34 preg_split: Warning: preg_split(): No ending delimiter '`' found in /in/WkVIW on line 37

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:
55.84 ms | 3535 KiB | 4 Q