3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($arg){ $var = 'check:'.$arg; echo $var; } preg_replace('/a/', foo("$1"), 'a');

preferences:
51.53 ms | 402 KiB | 5 Q