import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / htmlentities23.php
bloba9142473863e55957e9ecd699233166ef366b1bc
1 <?php
2 $tests = array(
3 "\x8F\xA1\xFF", //2 sub as 2nd is potentially valid as lead
4 "\x8F\xA1", //2 sub, as 2nd is potentially valid as lead
5 "\x8F", //1 sub
6 "\x8F\xA0", //1 sub, A0 is not valid as sole/first byte
7 "\x8F\xA1\x21", //2 sub, no consume last
8 "\x8F\x21", //1 sub, no consume last
9 "\x8E\xAE", //valid
10 "\x8E", //1 sub
11 "\x8E\x21", //1 sub, no consume last
12 "\xB2\xFF", //1 sub
13 "\xB2", //1 sub
14 "\xB2\x21", //1 sub, no consume last
15 "\xA0", //1 sub
18 foreach ($tests as $test) {
19 error_reporting(~E_STRICT);
20 $a = htmlentities($test, ENT_QUOTES | ENT_SUBSTITUTE, "EUC-JP");
21 error_reporting(-1);
22 var_dump($a, bin2hex($a));
23 $a = htmlspecialchars($test, ENT_QUOTES | ENT_SUBSTITUTE, "EUC-JP");
24 var_dump($a, bin2hex($a));
25 echo "\n";