3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[spoiler]Test\ntesting[/spoiler]."; $text = preg_replace_callback("/\[(.*?)\]/", function($match){ echo "test"; $lines = explode("\n", str_rot13(substr($match[0]))); $output = ""; foreach ($lines as $line) { $output .= "[spoiler]".$line."[/spoiler]"; } return $output; }, $text ); echo $text; ?>
Output for git.master, git.master_jit, rfc.property-hooks
test Fatal error: Uncaught ArgumentCountError: substr() expects at least 2 arguments, 1 given in /in/X9293:8 Stack trace: #0 /in/X9293(8): substr('[spoiler]') #1 [internal function]: {closure}(Array) #2 /in/X9293(5): preg_replace_callback('/\\[(.*?)\\]/', Object(Closure), '[spoiler]Test\nt...') #3 {main} thrown in /in/X9293 on line 8
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:
43.34 ms | 401 KiB | 8 Q