3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_video_block($id) { return "***replacement text for $id***"; } function display_video($text) { return preg_replace_callback( '/\[VIDEO ID=(\d+)]/', function($m) { return get_video_block($m[1]); }, $text ); } echo display_video("Here is a video [VIDEO ID=33] to watch");

preferences:
36.21 ms | 404 KiB | 5 Q