3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Some text bla-bla #date# other text #date# some other #date#'; echo preg_replace_callback('/#date#/', function () { return date('Y-m-d', strtotime( '+'.mt_rand(0,45).' days')); }, $string);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
161.91 ms | 1172 KiB | 14 Q