mirror of
https://github.com/php/php-src.git
synced 2024-10-19 15:34:25 +00:00
99695744ac
and fix \v\f stuff while we're here..
88 lines
1.6 KiB
PHP
88 lines
1.6 KiB
PHP
--TEST--
|
||
Test addcslashes() function (variation 1)
|
||
--INI--
|
||
precision=14
|
||
--FILE--
|
||
<?php
|
||
|
||
echo "*** Testing addcslashes() for basic operations ***\n";
|
||
/* checking normal operation of addcslashes */
|
||
$string = "goodyear12345NULL\0truefalse\a\v\f\b\n\r\t";
|
||
$charlist = array (
|
||
NULL,
|
||
2,
|
||
array(5,6,7),
|
||
"a",
|
||
"\0",
|
||
"\n",
|
||
"\r",
|
||
"\t",
|
||
"\a",
|
||
"\v",
|
||
"\b",
|
||
"\f"
|
||
);
|
||
/* loop prints string with backslashes before characters
|
||
mentioned in $char using addcslashes() */
|
||
$counter = 1;
|
||
foreach($charlist as $char) {
|
||
echo "-- Iteration $counter --\n";
|
||
var_dump( addcslashes($string, $char) );
|
||
$counter++;
|
||
}
|
||
|
||
echo "Done\n";
|
||
|
||
?>
|
||
--EXPECTF--
|
||
*** Testing addcslashes() for basic operations ***
|
||
-- Iteration 1 --
|
||
string(36) "goodyear12345NULL |