3v4l.org

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

preferences:
33.06 ms | 404 KiB | 5 Q