3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ '$hey()', '$hey->hi()', '$hey(\'hi\')', '$hey moretext()' ]; foreach ($strings as $string) { if (preg_match('~^\$\w+\([^)]*\)$~', $string)) { echo $string . "\n"; } }

preferences:
56.08 ms | 402 KiB | 5 Q