3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s0 = 'Α'; $s1 = 'А'; $s2 = 'A'; $s3 = 'a'; $s4 = 'а'; $err = null; $sp = new \Spoofchecker(); $sp->setAllowedLocales('en_EN'); $sp->setChecks(\Spoofchecker::SINGLE_SCRIPT_CONFUSABLE | \Spoofchecker::MIXED_SCRIPT_CONFUSABLE | \Spoofchecker::WHOLE_SCRIPT_CONFUSABLE); // non-unicode, but enough to differentiate var_dump(ord($s0), ord($s1), ord($s2), ord($s3), ord($s4)); // 206, 208, 65, 97, 208 var_dump('Confusable 0-1: ' . $sp->areConfusable($s0, $s1, $err), 'Error: ' . $err); // no, 0 var_dump('Confusable 1-2: ' . $sp->areConfusable($s1, $s2, $err), 'Error: ' . $err); // no, 0 var_dump('Confusable 2-3: ' . $sp->areConfusable($s2, $s3, $err), 'Error: ' . $err); // no, 0 var_dump('Confusable 3-4: ' . $sp->areConfusable($s3, $s4, $err), 'Error: ' . $err); // yes, 6 var_dump('Suspicious #0: ' . $sp->isSuspicious($s0, $err), 'Error: ' . $err); // no, 0 var_dump('Suspicious #1: ' . $sp->isSuspicious($s1, $err), 'Error: ' . $err); // no, 0 var_dump('Suspicious #2: ' . $sp->isSuspicious($s2, $err), 'Error: ' . $err); // no, 0 var_dump('Suspicious #3: ' . $sp->isSuspicious($s3, $err), 'Error: ' . $err); // yes, 4 var_dump('Suspicious #4: ' . $sp->isSuspicious($s4, $err), 'Error: ' . $err); // yes, 4
Output for 7.0.14 - 7.1.0
int(206) int(208) int(65) int(97) int(208) string(17) "Confusable 0-1: 1" string(7) "Error: " string(17) "Confusable 1-2: 1" string(7) "Error: " string(16) "Confusable 2-3: " string(7) "Error: " string(17) "Confusable 3-4: 1" string(7) "Error: " string(15) "Suspicious #0: " string(7) "Error: " string(15) "Suspicious #1: " string(7) "Error: " string(15) "Suspicious #2: " string(7) "Error: " string(15) "Suspicious #3: " string(7) "Error: " string(15) "Suspicious #4: " string(7) "Error: "
Output for 7.0.0 - 7.0.4, 7.0.6
int(206) int(208) int(65) int(97) int(208) string(17) "Confusable 0-1: 1" string(7) "Error: " string(17) "Confusable 1-2: 1" string(7) "Error: " string(16) "Confusable 2-3: " string(7) "Error: " string(17) "Confusable 3-4: 1" string(7) "Error: " string(15) "Suspicious #0: " string(7) "Error: " string(15) "Suspicious #1: " string(7) "Error: " string(15) "Suspicious #2: " string(7) "Error: " string(16) "Suspicious #3: 1" string(7) "Error: " string(16) "Suspicious #4: 1" string(7) "Error: "
Output for 7.0.5
Fatal error: Uncaught Error: Class 'Spoofchecker' not found in /in/5oGit:10 Stack trace: #0 {main} thrown in /in/5oGit on line 10
Process exited with code 255.
Output for 5.4.39 - 5.5.28, 5.5.31 - 5.5.33, 5.5.35 - 5.6.12, 5.6.16 - 5.6.19, 5.6.21 - 5.6.28, hhvm-3.12.0
int(206) int(208) int(65) int(97) int(208) string(17) "Confusable 0-1: 1" string(8) "Error: 6" string(17) "Confusable 1-2: 1" string(8) "Error: 6" string(16) "Confusable 2-3: " string(8) "Error: 0" string(17) "Confusable 3-4: 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" string(16) "Suspicious #3: 1" string(8) "Error: 4" string(16) "Suspicious #4: 1" string(8) "Error: 4"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.4.35, 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
Fatal error: Class 'Spoofchecker' not found in /in/5oGit on line 10
Process exited with code 255.
Output for 5.4.36 - 5.4.38
int(206) int(208) int(65) int(97) int(208) string(16) "Confusable 0-1: " string(8) "Error: 0" string(16) "Confusable 1-2: " string(8) "Error: 0" string(16) "Confusable 2-3: " string(8) "Error: 0" string(17) "Confusable 3-4: 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" string(16) "Suspicious #3: 1" string(8) "Error: 4" string(16) "Suspicious #4: 1" string(8) "Error: 4"
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Fatal error: Class 'Spoofchecker' not found in /in/5oGit on line 10
Process exited with code 255.
Output for 5.1.0
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Fatal error: fatal flex scanner internal error--end of buffer missed in /in/5oGit on line 26
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Parse error: syntax error, unexpected '|', expecting '(' in /in/5oGit on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Parse error: parse error, unexpected '|', expecting '(' in /in/5oGit on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 10 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/5oGit on line 12 Parse error: parse error, expecting `'('' in /in/5oGit on line 12
Process exited with code 255.