3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[img]http://www.test.com/abc.jpg[/img]"; $uid = 123; $text = preg_replace_callback( "#\[img]((?:https?|ftps?)://[^\s?&=\#\"<]*?\.(?:jpe?g|gif|png))\[/img]#i", function ($m) use ($uid) { return "[img:$uid]" . $m[1] . "[/img:$uid]"; }, $text ); echo $text;

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
169.09 ms | 1601 KiB | 9 Q