3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "This is a #hastag within some #awesometext."; function tagIt($body) { $string = $body; $htag = "#"; $arr = preg_split("/(\s|\.|\!/)", $string);print_r($arr); $arrc = count($arr); $i = 0; while($i < $arrc) { if(substr($arr[$i], 0, 1) === $htag) { $arr[$i] = "<a href = 'category.php?tag=$arr[$i]'>".$arr[$i]."</a>"; } $i++; } $string = implode(" ", $arr); echo "\n".$string."\n"; } tagIt($text);
Output for git.master, git.master_jit
Warning: preg_split(): Unknown modifier ')' in /in/PcoN1 on line 9 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /in/PcoN1:10 Stack trace: #0 /in/PcoN1(25): tagIt('This is a #hast...') #1 {main} thrown in /in/PcoN1 on line 10
Process exited with code 255.
Output for rfc.property-hooks
Warning: preg_split(): Unknown modifier ')' in /in/PcoN1 on line 9 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /in/PcoN1:10 Stack trace: #0 /in/PcoN1(25): tagIt('This is a #hast...') #1 {main} thrown in /in/PcoN1 on line 10
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:
50.16 ms | 401 KiB | 8 Q