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:
24.66 ms | 475 KiB | 4 Q