3v4l.org

run code in 300+ PHP versions simultaneously
<?php const UPPER_LEVEL_CONSTANT = "blahblah"; $data = "[0][name]=10"; $data = preg_replace("/([^|&])\[/","$1".UPPER_LEVEL_CONSTANT."[",$data);

preferences:
33.87 ms | 402 KiB | 5 Q