Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Zend/tests/ns_069.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

var_dump((binary)__NAMESPACE__);
var_dump(__NAMESPACE__);
4 changes: 2 additions & 2 deletions Zend/tests/ns_069.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace foo;

class Test {
static function f() {
var_dump((binary)__NAMESPACE__);
var_dump(__NAMESPACE__);
include __DIR__ . '/ns_069.inc';
var_dump((binary)__NAMESPACE__);
var_dump(__NAMESPACE__);
}
}

Expand Down
2 changes: 1 addition & 1 deletion ext/dom/tests/bug40836.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bug #40836 (Segfault in insertBefore)
<?php
$dom = new DOMDocument("1.0", "UTF-8");
$dom->preserveWhiteSpace = false;
$xml = (binary)'<?xml version="1.0" encoding="utf-8"?>
$xml = '<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<entry xmlns="http://www.w3.org/2005/Atom">
<updated>2007-02-14T00:00:00+01:00</updated>
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/tests/bug41374.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bug #41374 (wholetext concats values of wrong nodes)
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$xml = (binary)<<<EOXML
$xml = <<<EOXML
<?xml version="1.0" encoding="ISO-8859-1" ?>
<root>foo<child />baz</root>
EOXML;
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/tests/domxpath.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function MyAverage($nodelist) {
}

$dom = new DOMDocument;
$dom->loadXML(b'<root xmlns="urn::default"><child>myval</child></root>');
$dom->loadXML('<root xmlns="urn::default"><child>myval</child></root>');

$xpath = new DOMXPath($dom);

Expand Down
6 changes: 3 additions & 3 deletions ext/hash/tests/hash_copy_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $algos = hash_algos();
foreach ($algos as $algo) {
var_dump($algo);
$orig = hash_init($algo);
hash_update($orig, b"I can't remember anything");
hash_update($orig, "I can't remember anything");
$copy = hash_copy($orig);
var_dump(hash_final($orig));

Expand All @@ -20,11 +20,11 @@ foreach ($algos as $algo) {
foreach ($algos as $algo) {
var_dump($algo);
$orig = hash_init($algo);
hash_update($orig, b"I can't remember anything");
hash_update($orig, "I can't remember anything");
$copy = hash_copy($orig);
var_dump(hash_final($orig));

hash_update($copy, b"Can’t tell if this is true or dream");
hash_update($copy, "Can’t tell if this is true or dream");
var_dump(hash_final($copy));
}

Expand Down
6 changes: 3 additions & 3 deletions ext/iconv/tests/iconv_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function_exists('iconv') or die("skip iconv() is not available in this build");
echo "*** Testing iconv() : basic functionality ***\n";

//All strings are the same when displayed in their respective encodings
$sjis_string = base64_decode(b'k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==');
$euc_jp_string = base64_decode(b'xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==');
$utf8_string = base64_decode(b'5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
$sjis_string = base64_decode('k/qWe4zqg2WDTINYg2eCxYK3gUIwMTIzNIJUglWCVoJXgliBQg==');
$euc_jp_string = base64_decode('xvzL3LjspcalraW5pcikx6S5oaMwMTIzNKO1o7ajt6O4o7mhow==');
$utf8_string = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');

echo "\n-- Convert to EUC-JP --\n";
echo "Expected EUC-JP encoded string in base64:\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_mime_decode_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function_exists('iconv_mime_decode') or die("skip iconv_mime_decode() is not ava
echo "*** Testing iconv_mime_decode() : usage variations ***\n";

// Initialise function arguments not being substituted
$header = b'Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=';
$header = 'Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=';
$mode = ICONV_MIME_DECODE_CONTINUE_ON_ERROR;
$charset = 'ISO-8859-1';

Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_mime_decode_variation2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function_exists('iconv_mime_decode') or die("skip iconv_mime_decode() is not ava
echo "*** Testing iconv_mime_decode() : usage variations ***\n";

// Initialise function arguments not being substituted
$header = b'Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=';
$header = 'Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=';
$mode = ICONV_MIME_DECODE_CONTINUE_ON_ERROR;
$charset = 'UTF-8';

Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_mime_decode_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ echo "*** Testing iconv_mime_decode() : usage variations ***\n";
// Some of the parameters actually passed to charset will request to use
// a default charset determined by the platform. In order for this test to
// run on both linux and windows, the subject will have to be ascii only.
$header = b'Subject: =?UTF-8?B?QSBTYW1wbGUgVGVzdA==?=';
$header = 'Subject: =?UTF-8?B?QSBTYW1wbGUgVGVzdA==?=';
$mode = ICONV_MIME_DECODE_CONTINUE_ON_ERROR;
$charset = 'UTF-8';

Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/tests/iconv_strlen_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function_exists('iconv_strlen') or die("skip iconv_strlen() is not available in

echo "*** Testing iconv_strlen() : basic functionality***\n";

$string_ascii = b'abc def';
$string_ascii = 'abc def';
//Japanese string in UTF-8
$string_mb = base64_decode(b'5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');

echo "\n-- ASCII String --\n";
var_dump(iconv_strlen($string_ascii));
Expand Down
10 changes: 5 additions & 5 deletions ext/iconv/tests/iconv_strpos_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ echo "*** Testing iconv_strpos() : basic functionality***\n";

iconv_set_encoding("internal_encoding", "UTF-8");

$string_ascii = b'abc def';
$string_ascii = 'abc def';
//Japanese string in UTF-8
$string_mb = base64_decode(b'5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');

echo "\n-- ASCII string 1 --\n";
var_dump(iconv_strpos($string_ascii, b'd', 2, 'ISO-8859-1'));
var_dump(iconv_strpos($string_ascii, 'd', 2, 'ISO-8859-1'));

echo "\n-- ASCII string 2 --\n";
var_dump(iconv_strpos($string_ascii, b'123'));
var_dump(iconv_strpos($string_ascii, '123'));

echo "\n-- Multibyte string 1 --\n";
$needle1 = base64_decode('5pel5pys6Kqe');
var_dump(iconv_strpos($string_mb, $needle1));

echo "\n-- Multibyte string 2 --\n";
$needle2 = base64_decode(b"44GT44KT44Gr44Gh44Gv44CB5LiW55WM");
$needle2 = base64_decode("44GT44KT44Gr44Gh44Gv44CB5LiW55WM");
var_dump(iconv_strpos($string_mb, $needle2));

echo "Done";
Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/tests/iconv_strpos_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
echo "*** Testing iconv_strpos() : usage variations ***\n";

// Initialise function arguments not being substituted
$needle = b'a';
$haystack = b'string_val';
$needle = 'a';
$haystack = 'string_val';
$encoding = 'utf-8';

//get an unset variable
Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/tests/iconv_strpos_variation3_64bit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
echo "*** Testing iconv_strpos() : usage variations ***\n";

// Initialise function arguments not being substituted
$needle = b'a';
$haystack = b'string_val';
$needle = 'a';
$haystack = 'string_val';
$encoding = 'utf-8';

//get an unset variable
Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/tests/iconv_strpos_variation4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function_exists('iconv_strpos') or die("skip iconv_strpos() is not available in
echo "*** Testing iconv_strpos() : usage variations ***\n";

// Initialise function arguments not being substituted
$haystack = b'string_val';
$needle = b'val';
$haystack = 'string_val';
$needle = 'val';
$offset = 0;

//get an unset variable
Expand Down
8 changes: 4 additions & 4 deletions ext/iconv/tests/iconv_strpos_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ iconv_set_encoding("internal_encoding", "UTF-8");

echo "*** Testing iconv_strpos() : usage variations ***\n";

$string_ascii = b'+Is an English string'; //21 chars
$needle_ascii = b'g';
$string_ascii = '+Is an English string'; //21 chars
$needle_ascii = 'g';

$string_mb = base64_decode(b'5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII='); //21 chars
$needle_mb = base64_decode(b'44CC');
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII='); //21 chars
$needle_mb = base64_decode('44CC');

/*
* Loop through integers as multiples of ten for $offset argument
Expand Down
12 changes: 6 additions & 6 deletions ext/iconv/tests/iconv_strrpos_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ echo "*** Testing iconv_strrpos() : basic ***\n";

iconv_set_encoding("internal_encoding", "UTF-8");

$string_ascii = b'This is an English string. 0123456789.';
$string_ascii = 'This is an English string. 0123456789.';
//Japanese string in UTF-8
$string_mb = base64_decode(b'5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');

echo "\n-- ASCII string 1 --\n";
var_dump(iconv_strrpos($string_ascii, b'is', 'ISO-8859-1'));
var_dump(iconv_strrpos($string_ascii, 'is', 'ISO-8859-1'));

echo "\n-- ASCII string 2 --\n";
var_dump(iconv_strrpos($string_ascii, b'hello, world'));
var_dump(iconv_strrpos($string_ascii, 'hello, world'));

echo "\n-- Multibyte string 1 --\n";
$needle1 = base64_decode(b'44CC');
$needle1 = base64_decode('44CC');
var_dump(iconv_strrpos($string_mb, $needle1));

echo "\n-- Multibyte string 2 --\n";
$needle2 = base64_decode(b'44GT44KT44Gr44Gh44Gv44CB5LiW55WM');
$needle2 = base64_decode('44GT44KT44Gr44Gh44Gv44CB5LiW55WM');
var_dump(iconv_strrpos($string_mb, $needle2));

echo "Done";
Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/tests/iconv_strrpos_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function_exists('iconv_strrpos') or die("skip iconv_strrpos() is not available i
echo "*** Testing iconv_strrpos() : usage variations ***\n";

// Initialise function arguments not being substituted
$haystack = b'hello, world';
$needle = b'world';
$haystack = 'hello, world';
$needle = 'world';

//get an unset variable
$unset_var = 10;
Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/tests/iconv_substr_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ iconv.output_encoding=ISO-8859-1

echo "*** Testing iconv_substr() : basic functionality ***\n";

$string_ascii = b'ABCDEF';
$string_ascii = 'ABCDEF';
//Japanese string in UTF-8
$string_mb = base64_decode(b'5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');

echo "\n-- ASCII string 1 --\n";
var_dump(bin2hex(iconv_substr($string_ascii, 3)));
Expand Down
6 changes: 3 additions & 3 deletions ext/imap/tests/imap_base64_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ extension_loaded('imap') or die('skip imap extension not available in this build

echo "*** Testing imap_base64() : basic functionality ***\n";

$str = b'This is an example string to be base 64 encoded';
$str = 'This is an example string to be base 64 encoded';
$base64 = base64_encode($str);
if (imap_base64($base64) == $str) {
echo "TEST PASSED\n";
} else {
echo "TEST FAILED";
}

$str = b'!£$%^&*()_+-={][];;@~#?/>.<,';
$str = '!£$%^&*()_+-={][];;@~#?/>.<,';
$base64 = base64_encode($str);
if (imap_base64($base64) == $str) {
echo "TEST PASSED\n";
} else {
echo "TEST FAILED";
}

$hex = b'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
$hex = 'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
$base64 = base64_encode($hex);
if (imap_base64($base64) == $hex) {
echo "TEST PASSED\n";
Expand Down
8 changes: 4 additions & 4 deletions ext/imap/tests/imap_binary_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ extension_loaded('imap') or die('skip imap extension not available in this build
echo "*** Testing imap_binary() : basic functionality ***\n";

echo "Encode as short string\n";
$str = b'This is an example string to be base 64 encoded';
$str = 'This is an example string to be base 64 encoded';
$base64 = imap_binary($str);
var_dump(bin2hex($base64));

echo "Encode a string which results in more than 60 charters of output\n";
$str = b'This is a long string with results in more than 60 characters of output';
$str = 'This is a long string with results in more than 60 characters of output';
$base64 = imap_binary($str);
var_dump(bin2hex($base64));

echo "Encode a string with special characters\n";
$str = b'_+-={][];;@~#?/>.<,';
$str = '_+-={][];;@~#?/>.<,';
$base64 = imap_binary($str);
var_dump(bin2hex($base64));

echo "Encode some hexadecimal data\n";
$hex = b'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
$hex = 'x00\x01\x02\x03\x04\x05\x06\xFA\xFB\xFC\xFD\xFE\xFF';
$base64 = imap_binary($hex);
var_dump(bin2hex($base64));

Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/bug43840.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ foreach($offsets as $i) {
echo "--Multibyte String:--\n";
var_dump( mb_strpos($string_mb, $needle, $i, 'UTF-8') );
echo"--ASCII String:--\n";
var_dump(mb_strpos(b'This is na English ta', b'a', $i));
var_dump(mb_strpos('This is na English ta', 'a', $i));
}
?>
--EXPECTF--
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/tests/bug43841.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ foreach ($offsets as $i) {
var_dump( mb_strrpos($string_mb, $needle, $i, 'UTF-8') );
echo "ASCII String:\n";
echo "mb_strrpos:\n";
var_dump(mb_strrpos(b'This is na English ta', b'a', $i));
var_dump(mb_strrpos('This is na English ta', 'a', $i));
echo "strrpos:\n";
var_dump(strrpos(b'This is na English ta', b'a', $i));
var_dump(strrpos('This is na English ta', 'a', $i));
}
?>

Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/tests/mb_convert_encoding_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo "*** Testing mb_convert_encoding() : usage variations ***\n";

// Initialise function arguments not being substituted
mb_internal_encoding('utf-8');
$sourcestring = b'hello, world';
$sourcestring = 'hello, world';

//get an unset variable
$unset_var = 10;
Expand Down
10 changes: 5 additions & 5 deletions ext/mbstring/tests/mb_ereg.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ output_handler=
mb_regex_encoding( $test_enc );
$pat = mb_convert_encoding( $pat, $test_enc, $in_enc );
$str = mb_convert_encoding( $str, $test_enc, $in_enc );
printf( "(%d)%s\n", mb_ereg( $pat, $str, $reg ), ( is_array( $reg )? bin2hex(mb_convert_encoding( implode( b' ', $reg ), $in_enc, $test_enc )) : '' ) );
printf( "(%d)%s\n", mb_ereg( $pat, $str, $reg ), ( is_array( $reg )? bin2hex(mb_convert_encoding( implode( ' ', $reg ), $in_enc, $test_enc )) : '' ) );
}
function do_tests( $enc ) {
test_ereg( $enc, b'abc ([a-z]+) ([a-z]+) ([a-z]+)$', b"abc def ghi jkl" );
$pat = b'([��-��]+) ([ ��-��]+)([��-��]+) ([��-��]+)$';
test_ereg( $enc, $pat, b'���� ������ ������ ����' );
test_ereg( $enc, $pat, b'��������� ������ ���� ���' );
test_ereg( $enc, 'abc ([a-z]+) ([a-z]+) ([a-z]+)$', "abc def ghi jkl" );
$pat = '([��-��]+) ([ ��-��]+)([��-��]+) ([��-��]+)$';
test_ereg( $enc, $pat, '���� ������ ������ ����' );
test_ereg( $enc, $pat, '��������� ������ ���� ���' );
}

foreach( $encs as $enc ) {
Expand Down
6 changes: 3 additions & 3 deletions ext/mbstring/tests/mb_ereg_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ if(mb_regex_encoding('utf-8') == true) {
} else {
echo "Could not set regex encoding to utf-8\n";
}
$string_ascii = b'This is an English string. 0123456789.';
$regex_ascii1 = b'(.*is)+.*\.[[:blank:]][0-9]{9}';
$regex_ascii2 = b'.*is+';
$string_ascii = 'This is an English string. 0123456789.';
$regex_ascii1 = '(.*is)+.*\.[[:blank:]][0-9]{9}';
$regex_ascii2 = '.*is+';

$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
$regex_mb1 = base64_decode('KOaXpeacrOiqnikuKj8oWzEtOV0rKQ==');
Expand Down
6 changes: 3 additions & 3 deletions ext/mbstring/tests/mb_ereg_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ echo "*** Testing mb_ereg() : error conditions ***\n";

//Test mb_ereg with one more than the expected number of arguments
echo "\n-- Testing mb_ereg() function with more than expected no. of arguments --\n";
$pattern = b'string_val';
$string = b'string_val';
$pattern = 'string_val';
$string = 'string_val';
$registers = array(1, 2);
$extra_arg = 10;
var_dump( mb_ereg($pattern, $string, $registers, $extra_arg) );

// Testing mb_ereg with one less than the expected number of arguments
echo "\n-- Testing mb_ereg() function with less than expected no. of arguments --\n";
$pattern = b'string_val';
$pattern = 'string_val';
var_dump( mb_ereg($pattern) );

echo "Done";
Expand Down
Loading