3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = 'Some {abc} here'; $abc = "Word"; echo preg_replace_callback('/\{(.*?)\}/', function ($matches) { return $GLOBALS[$matches[1]]; }, $data);

preferences:
101.39 ms | 1374 KiB | 5 Q