3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[spoiler]Test\ntesting[/spoiler]."; $text = preg_replace_callback("(\[spoiler\](.*?)\[\/spoiler\])is", function($match){ echo "test"; $lines = explode("\n", str_rot13($match[1])); /* $output = ""; foreach ($lines as $line) { $output .= "[spoiler]".$line."[/spoiler]\n"; } */ $output = implode("[/spoiler]\n[spoiler]"); return $output; }, $text ); echo $text; ?>
Output for git.master, git.master_jit, rfc.property-hooks
test Fatal error: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in /in/EFTPs:15 Stack trace: #0 /in/EFTPs(15): implode('[/spoiler]\n[spo...') #1 [internal function]: {closure}(Array) #2 /in/EFTPs(5): preg_replace_callback('(\\[spoiler\\](.*...', Object(Closure), '[spoiler]Test\nt...') #3 {main} thrown in /in/EFTPs 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:
41.63 ms | 402 KiB | 8 Q