3v4l.org

run code in 300+ PHP versions simultaneously
<?php $selfTable = 'songs'; $relTable = 'artists'; $strings = array( 'id', 'artists.name', '$artist.real_name', '$title' ); foreach($strings as $string) { echo preg_replace_callback('#([^\.\$]+|\$[\w]+|\$[\w]+\.[\w]+)#', function($match) { print_r($match); }, $string); }

preferences:
54.11 ms | 402 KiB | 5 Q