3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = array( 'this is a string', 'this is $ a string', 'this is 12 string', 'this is $12.99 string', ); foreach ($strings as $string) { var_dump(strtolower(preg_replace('#[-+]#, '-', preg_replace('#[^a-z0-9\-]#', '', preg_replace('#[\s+]#', '-', $string))))); }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '}' in /in/hqWUf on line 10
Process exited with code 255.

preferences:
214.32 ms | 1399 KiB | 61 Q