3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo setlocale(LC_ALL, 0); echo setlocale(LANG, 0); echo setlocale(LC_COLLATE, 0); echo setlocale(LC_NUMERIC, 0); $text = '%&/()"QEm software VaLidation V20ººººº'; $replacementChar = ' '; // replace non Unicode letters or digits by the replacement char $text = preg_replace('/[^\pL\d]+/u', $replacementChar, $text); echo $text."\n"; // trim replacement characters that ended up at the edges $text = trim($text, $replacementChar); // Force conversion to us-ascci, to take care of accented characters // and transliterate replacing unknown characters by a similar one $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); echo $text."\n"; $text = strtolower($text); // Remove unwanted characters due to transliteration // but keep the replacement character $text = preg_replace('/[^'.$replacementChar.'\w]+/', '', $text); echo $text."\n";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
C Fatal error: Uncaught Error: Undefined constant "LANG" in /in/m1V1r:4 Stack trace: #0 {main} thrown in /in/m1V1r on line 4
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
C Warning: Use of undefined constant LANG - assumed 'LANG' (this will throw an Error in a future version of PHP) in /in/m1V1r on line 4 Warning: setlocale() expects parameter 1 to be int, string given in /in/m1V1r on line 4 CC QEm software VaLidation V20ººººº Fatal error: Uncaught Error: Call to undefined function iconv() in /in/m1V1r:20 Stack trace: #0 {main} thrown in /in/m1V1r on line 20
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
C Warning: Use of undefined constant LANG - assumed 'LANG' (this will throw an Error in a future version of PHP) in /in/m1V1r on line 4 Warning: setlocale() expects parameter 1 to be int, string given in /in/m1V1r on line 4 CC QEm software VaLidation V20ººººº QEm software VaLidation V20????? qem software validation v20
Output for 7.2.0 - 7.2.33
C Warning: Use of undefined constant LANG - assumed 'LANG' (this will throw an Error in a future version of PHP) in /in/m1V1r on line 4 Warning: setlocale() expects parameter 1 to be integer, string given in /in/m1V1r on line 4 CC QEm software VaLidation V20ººººº QEm software VaLidation V20????? qem software validation v20
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
C Notice: Use of undefined constant LANG - assumed 'LANG' in /in/m1V1r on line 4 Warning: setlocale() expects parameter 1 to be integer, string given in /in/m1V1r on line 4 CC QEm software VaLidation V20ººººº QEm software VaLidation V20????? qem software validation v20
Output for 5.6.0 - 5.6.40
C Notice: Use of undefined constant LANG - assumed 'LANG' in /in/m1V1r on line 4 Deprecated: setlocale(): Passing locale category name as string is deprecated. Use the LC_* -constants instead in /in/m1V1r on line 4 Warning: setlocale(): Invalid locale category name LANG, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME in /in/m1V1r on line 4 CC QEm software VaLidation V20ººººº QEm software VaLidation V20????? qem software validation v20

preferences:
60.85 ms | 414 KiB | 5 Q