1--TEST-- 2htmlentities() / htmlspecialchars() "don't double encode" flag support 3--FILE-- 4<?php 5$tests = array( 6 "abc", 7 "abc&sfdsa", 8 "test+s & some more D", 9 "test+s & some more D", 10 "&; & &#a; &9; &#xyz;", 11 "&kffjadfdhsjfhjasdhffasdfas;", 12 "�", 13 "&", 14 "&&&", 15 "&ab&&", 16); 17 18foreach ($tests as $test) { 19 var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE)); 20 var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE)); 21} 22?> 23--EXPECT-- 24string(3) "abc" 25string(3) "abc" 26string(13) "abc&sfdsa" 27string(13) "abc&sfdsa" 28string(33) "test+s & some more D" 29string(33) "test+s & some more D" 30string(34) "test+s & some more D" 31string(34) "test+s & some more D" 32string(35) "&; &amp &#a; &9; &#xyz;" 33string(35) "&; &amp &#a; &9; &#xyz;" 34string(32) "&kffjadfdhsjfhjasdhffasdfas;" 35string(32) "&kffjadfdhsjfhjasdhffasdfas;" 36string(16) "&#8787978789" 37string(16) "&#8787978789" 38string(5) "&" 39string(5) "&" 40string(15) "&&&" 41string(15) "&&&" 42string(17) "&ab&&" 43string(17) "&ab&&" 44