htmlspecialchars_decode_variation2.phpt [plain text]
--TEST--
Test htmlspecialchars_decode() function : usage variations - unexpected values for 'quote_style' argument
--FILE--
<?php
echo "*** Testing htmlspecialchars_decode() : usage variations ***\n";
$string = "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>";
class classA {
function __toString() {
return "Class A Object";
}
}
$file_handle = fopen(__FILE__, "r");
$unset_var = 10;
unset($unset_var);
$values = array(
10.5,
-10.5,
10.5e20,
10.6E-10,
.5,
array(),
array(0),
array(1),
array(1, 2),
array('color' => 'red', 'item' => 'pen'),
NULL,
null,
true,
false,
TRUE,
FALSE,
"",
'',
"string",
'string',
new classA(),
@$undefined_var,
@$unset_var,
$file_handle
);
$iterator = 1;
foreach($values as $value) {
echo "\n-- Iteration $iterator --\n";
var_dump( htmlspecialchars_decode($string, $value) );
$iterator++;
}
fclose($file_handle);
echo "Done";
?>
--EXPECTF--
*** Testing htmlspecialchars_decode() : usage variations ***
-- Iteration 1 --
string(104) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 2 --
string(104) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 3 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 4 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 5 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 6 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 7 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 8 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 9 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 10 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 11 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 12 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 13 --
string(104) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 14 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 15 --
string(104) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 16 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 17 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 18 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 19 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 20 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 21 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, object given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
-- Iteration 22 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 23 --
string(114) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
-- Iteration 24 --
Warning: htmlspecialchars_decode() expects parameter 2 to be long, resource given in %shtmlspecialchars_decode_variation2.php on line %d
NULL
Done