php-src/ext/standard/tests/strings/join_variation6.phpt
2007-09-29 16:52:54 +00:00

34 lines
737 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
Test join() function : usage variations - binary safe
--INI--
--FILE--
<?php
/* Prototype : string join( string $glue, array $pieces )
* Description: Join array elements with a string
* Source code: ext/standard/string.c
* Alias of function: implode()
*/
/*
* check the working of join() when given binary input given
*/
echo "*** Testing join() : usage variationsi - binary safe ***\n";
$glues = array(
",".chr(0)." ",
b", "
);
$pieces = array("Red", "Green", "White", 1);
var_dump( join($glues[0], $pieces) );
var_dump( join($glues[1], $pieces) );
echo "Done\n";
?>
--EXPECTF--
*** Testing join() : usage variationsi - binary safe ***
string(23) "Red, Green, White, 1"
string(20) "Red, Green, White, 1"
Done