3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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('#[^a-z0-9]#', '', preg_replace('#[\s+]#', '-', $$string)))); }
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: this is a string in /in/hqMoi on line 9 string(0) "" Notice: Undefined variable: this is $ a string in /in/hqMoi on line 9 string(0) "" Notice: Undefined variable: this is 12 string in /in/hqMoi on line 9 string(0) "" Notice: Undefined variable: this is $12.99 string in /in/hqMoi on line 9 string(0) ""
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: this is a string in /in/hqMoi on line 9 string(0) "" Notice: Undefined variable: this is $ a string in /in/hqMoi on line 9 string(0) "" Notice: Undefined variable: this is 12 string in /in/hqMoi on line 9 string(0) "" Notice: Undefined variable: this is $12.99 string in /in/hqMoi on line 9 string(0) ""