3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s0 = 'a'; $s1 = 'a'; $s2 = 'а'; $err = null; $sp = new \Spoofchecker(); $sp->setAllowedLocales('en_EN'); $sp->setChecks(\Spoofchecker::SINGLE_SCRIPT_CONFUSABLE | \Spoofchecker::MIXED_SCRIPT_CONFUSABLE | \Spoofchecker::WHOLE_SCRIPT_CONFUSABLE); var_dump(ord($s0), ord($s1), ord($s2)); echo "\n"; var_dump('Confusable: ' . $sp->areConfusable($s0, $s1, $err), 'Error: ' . $err); var_dump('Confusable: ' . $sp->areConfusable($s1, $s2, $err), 'Error: ' . $err); echo "\n"; var_dump('Suspicious #0: ' . $sp->isSuspicious($s0, $err), 'Error: ' . $err); echo "\n"; var_dump('Suspicious #1: ' . $sp->isSuspicious($s1, $err), 'Error: ' . $err); echo "\n"; var_dump('Suspicious #2: ' . $sp->isSuspicious($s2, $err), 'Error: ' . $err);
Output for 8.1.28, 8.2.18, 8.3.5 - 8.3.6
int(97) int(97) int(208) string(13) "Confusable: 1" string(8) "Error: 1" string(13) "Confusable: 1" string(8) "Error: 6" string(15) "Suspicious #0: " string(8) "Error: 0" string(15) "Suspicious #1: " string(8) "Error: 0" string(15) "Suspicious #2: " string(8) "Error: 0"
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 8.1.17 - 8.1.27, 8.2.4 - 8.2.17, 8.3.0 - 8.3.4
int(97) int(97) int(208) string(13) "Confusable: 1" string(8) "Error: 1" string(13) "Confusable: 1" string(8) "Error: 6" string(16) "Suspicious #0: 1" string(8) "Error: 4" string(16) "Suspicious #1: 1" string(8) "Error: 4" string(16) "Suspicious #2: 1" string(8) "Error: 4"
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.16, 8.2.0 - 8.2.3
int(97) int(97) int(208) string(13) "Confusable: 1" string(7) "Error: " string(13) "Confusable: 1" string(7) "Error: " string(16) "Suspicious #0: 1" string(7) "Error: " string(16) "Suspicious #1: 1" string(7) "Error: " string(16) "Suspicious #2: 1" string(7) "Error: "
Output for 8.0.13
Fatal error: Uncaught Error: Class "Spoofchecker" not found in /in/IDWH5:8 Stack trace: #0 {main} thrown in /in/IDWH5 on line 8
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Fatal error: Uncaught Error: Class 'Spoofchecker' not found in /in/IDWH5:8 Stack trace: #0 {main} thrown in /in/IDWH5 on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45
Fatal error: Class 'Spoofchecker' not found in /in/IDWH5 on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 10 Fatal error: Class 'Spoofchecker' not found in /in/IDWH5 on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 10 Parse error: syntax error, unexpected '|', expecting '(' in /in/IDWH5 on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 10 Parse error: parse error, unexpected '|', expecting '(' in /in/IDWH5 on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/IDWH5 on line 10 Parse error: parse error, expecting `'('' in /in/IDWH5 on line 10
Process exited with code 255.

preferences:
305.03 ms | 401 KiB | 460 Q