3v4l.org

run code in 200+ PHP versions simultaneously
<?php $stringA = 'INTËRÑÂTÎÔNÆLÍZÀTIØN'; $stringB = 'Intërñâtîônælízàtiøn'; echo 'strcasecmp():',PHP_EOL; var_dump(strcasecmp($stringA, $stringB)); echo PHP_EOL,'strnatcasecmp():',PHP_EOL; var_dump(strnatcasecmp($stringA, $stringB)); echo PHP_EOL,'str_ireplace():',PHP_EOL; var_dump(str_ireplace($stringA, '', $stringB, $count) === '' && $count === 1); echo PHP_EOL,'preg_match():',PHP_EOL; var_dump(preg_match('`^' . preg_quote($stringA, '`') . '$`i', $stringB) === 1);
based on du5ak
Output for 5.0.2 - 7.4.4
strcasecmp(): int(-32) strnatcasecmp(): int(-1) str_ireplace(): bool(false) preg_match(): bool(false)
Output for 5.0.0 - 5.0.1
strcasecmp(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 6 PHP_EOLint(-32) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 9 PHP_EOLstrnatcasecmp(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 9 PHP_EOLint(-1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 12 PHP_EOLstr_ireplace(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 12 PHP_EOLbool(false) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 15 PHP_EOLpreg_match(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 15 PHP_EOLbool(false)
Output for 4.4.5 - 4.4.9
strcasecmp(): int(-32) strnatcasecmp(): int(-1) str_ireplace(): Fatal error: Call to undefined function: str_ireplace() in /in/u8T2L on line 13
Process exited with code 255.
Output for 4.3.10 - 4.4.4
strcasecmp(): int(-32) strnatcasecmp(): int(-1) str_ireplace(): Fatal error: Call to undefined function: str_ireplace() in /in/u8T2L on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.9
strcasecmp(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 6 PHP_EOLint(-32) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 9 PHP_EOLstrnatcasecmp(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 9 PHP_EOLint(-1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 12 PHP_EOLstr_ireplace(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 12 PHP_EOL Fatal error: Call to undefined function: str_ireplace() in /in/u8T2L on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
strcasecmp(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 6 PHP_EOLint(-32) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 9 PHP_EOLstrnatcasecmp(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 9 PHP_EOLint(-1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 12 PHP_EOLstr_ireplace(): Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/u8T2L on line 12 PHP_EOL Fatal error: Call to undefined function: str_ireplace() in /in/u8T2L on line 13