3v4l.org

run code in 300+ PHP versions simultaneously
<?php $output = "a b\tc"; $preg_match_matches = NULL; $preg_match_all_matches = NULL; $preg_replace_callback_array_count = NULL; var_dump([ 'preg_filter' => preg_filter('/[a-z]+/', 'X', $output, NULL), 'preg_grep' => preg_grep('/^[a-z]+/', [$output, 'x'], NULL), 'preg_match' => preg_match('/^[a-z]+/', $output, $preg_match_matches, NULL, NULL), 'preg_match $matches' => $preg_match_matches, 'preg_match_all' => preg_match_all('/^[a-z]+/', $output, $preg_match_all_matches, NULL, NULL), 'preg_match_all $matches' => $preg_match_all_matches, 'preg_replace' => preg_replace('/[a-z]+/', 'X', $output, NULL), 'preg_replace_callback' => preg_replace_callback('/[a-z]+/', function($word) { return $word; }, $output, NULL), 'preg_replace_callback_array' => preg_replace_callback_array([ '~[a]+~i' => function ($match) { return 'X'; }, '~[b]+~i' => function ($match) { return 'Y'; }, ], $output, NULL, $preg_replace_callback_array_count, NULL), 'preg_split' => preg_split('/\s/', $output, NULL, PREG_SPLIT_NO_EMPTY), ]); ?>
Output for git.master_jit, git.master
Deprecated: preg_filter(): Passing null to parameter #4 ($limit) of type int is deprecated in /in/dLJSU on line 8 Deprecated: preg_grep(): Passing null to parameter #3 ($flags) of type int is deprecated in /in/dLJSU on line 9 Deprecated: preg_match(): Passing null to parameter #4 ($flags) of type int is deprecated in /in/dLJSU on line 10 Deprecated: preg_match(): Passing null to parameter #5 ($offset) of type int is deprecated in /in/dLJSU on line 10 Deprecated: preg_match_all(): Passing null to parameter #4 ($flags) of type int is deprecated in /in/dLJSU on line 12 Deprecated: preg_match_all(): Passing null to parameter #5 ($offset) of type int is deprecated in /in/dLJSU on line 12 Deprecated: preg_replace(): Passing null to parameter #4 ($limit) of type int is deprecated in /in/dLJSU on line 14 Deprecated: preg_replace_callback(): Passing null to parameter #4 ($limit) of type int is deprecated in /in/dLJSU on line 15 Deprecated: preg_replace_callback_array(): Passing null to parameter #3 ($limit) of type int is deprecated in /in/dLJSU on line 18 Deprecated: preg_replace_callback_array(): Passing null to parameter #5 ($flags) of type int is deprecated in /in/dLJSU on line 18 Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in /in/dLJSU on line 26 array(10) { ["preg_filter"]=> NULL ["preg_grep"]=> array(2) { [0]=> string(6) "a b c" [1]=> string(1) "x" } ["preg_match"]=> int(1) ["preg_match $matches"]=> array(1) { [0]=> string(1) "a" } ["preg_match_all"]=> int(1) ["preg_match_all $matches"]=> array(1) { [0]=> array(1) { [0]=> string(1) "a" } } ["preg_replace"]=> string(6) "a b c" ["preg_replace_callback"]=> string(6) "a b c" ["preg_replace_callback_array"]=> string(6) "a b c" ["preg_split"]=> array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } }

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:
35.8 ms | 411 KiB | 5 Q