3v4l.org

run code in 300+ PHP versions simultaneously
<?php function plumberpro_id_safe( $string ) { // Strip accents $accents = '/&([A-Za-z]{1,2})(tilde|grave|acute|circ|cedil|uml|lig);/'; $string = preg_replace( $accents, '$1', htmlentities( utf8_decode( $string ) ) ); // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores. $string = strtolower( preg_replace( '/[^a-zA-Z0-9_-]+/', '-', $string ) ); // If the first character is not a-z, add 'n' in front. if ( !ctype_lower( $string{0} ) ) { // Don't use ctype_alpha since its locale aware. $string = 'id' . $string; } return $string; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/hfeui on line 10
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/hfeui on line 10
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33

preferences:
227.33 ms | 402 KiB | 284 Q