3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'getADogThenROCKInTheUSA', 'SomeOfTheWords', 'getADog', 'ADog', 'aDog', 'XML', 'SimpleXMLReader', 'FREE4NOW', '123ABC', 'DEF456', 'ghi789', 'wtf666Omg', 'PHP8Point3', ]; foreach ($tests as $test) { printf("%25s => %s\n", $test, strtolower(preg_replace('/(?>[A-Z]?[a-z]+|[A-Z]+(?=[A-Z][a-z]|[^A-Za-z])|[^A-Za-z]+)\K(?!$)/', '-', $test))); }
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.30, 8.3.0 - 8.3.29, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
getADogThenROCKInTheUSA => get-a-dog-then-rock-in-the-usa SomeOfTheWords => some-of-the-words getADog => get-a-dog ADog => a-dog aDog => a-dog XML => xml SimpleXMLReader => simple-xml-reader FREE4NOW => free-4-now 123ABC => 123-abc DEF456 => def-456 ghi789 => ghi-789 wtf666Omg => wtf-666-omg PHP8Point3 => php-8-point-3
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
105.84 ms | 408 KiB | 5 Q