1--TEST-- 2spoofchecker with restriction level 3--EXTENSIONS-- 4intl 5--SKIPIF-- 6<?php if(!class_exists("Spoofchecker")) print 'skip'; ?> 7<?php 8 $r = new ReflectionClass("SpoofChecker"); 9 if (false === $r->getConstant("SINGLE_SCRIPT_RESTRICTIVE")) { 10 die("skip Incompatible ICU version"); 11 } 12?> 13--FILE-- 14<?php 15 16$x = new Spoofchecker(); 17$x->setRestrictionLevel(Spoofchecker::HIGHLY_RESTRICTIVE); 18 19$mixed = "\u{91CE}\u{7403}\u{30FC}"; 20var_dump($x->isSuspicious($mixed)); 21 22$x->setRestrictionLevel(Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE); 23 24$mixed = "\u{91CE}\u{7403}\u{30FC} abc"; 25var_dump($x->isSuspicious($mixed)); 26?> 27--EXPECT-- 28bool(false) 29bool(true) 30