}
else {
/* Likewise, writes will always appear to succeed */
- $x = fwrite($fp,"\n");
+ $x = fwrite($fp,b"\n");
var_dump($x);
/* But reads should always fail */
$content = fread($fp, 40);
?>
--EXPECTF--
-string(4) "bcde"
-string(6) "abcdex"
+%unicode|string%(4) "bcde"
+%unicode|string%(6) "abcdex"
bool(false)
bool(false)
Bug #47174 (base64_decode() interprets pad char in mid string as terminator)
--FILE--
<?php
-if (base64_decode("dGVzdA==") == base64_decode("dGVzdA==CRAP")) {
+if (base64_decode(b"dGVzdA==") == base64_decode(b"dGVzdA==CRAP")) {
echo "Same octect data - Signature Valid\n";
} else {
echo "Invalid Signature\n";
}
-$in = base64_encode("foo") . '==' . base64_encode("bar");
+$in = base64_encode(b"foo") . b'==' . base64_encode(b"bar");
var_dump($in, base64_decode($in));
?>
var_dump(php_sapi_name());
--EXPECTF--
-string(3) "c%ci"
+%unicode|string%(3) "c%ci"
?>
--EXPECTF--
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
-string(3) "111"
+%unicode|string%(3) "111"
"
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
-string(3) "500"
+%unicode|string%(3) "500"
"
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
-string(3) "555"
+%unicode|string%(3) "555"
"
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
-string(3) "555"
-string(10) "/test/path"
+%unicode|string%(3) "555"
+%unicode|string%(10) "/test/path"
"
Done
?>
--EXPECTF--
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
<?php
"
string(%d) "Status: 404 Not Found
X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
No input file specified.
"
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
<?php class test { function foo() {} } ?>
"
?>
--EXPECTF--
string(%d) "X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
<code><span style="color: #000000">
<br /><span style="color: #0000BB"><?php<br />$test </span><span style="color: #007700">= </span><span style="color: #DD0000">"var"</span><span style="color: #007700">; </span><span style="color: #FF8000">//var<br />/* test class */<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">test </span><span style="color: #007700">{<br /> private </span><span style="color: #0000BB">$var </span><span style="color: #007700">= array();<br /><br /> public static function </span><span style="color: #0000BB">foo</span><span style="color: #007700">(</span><span style="color: #0000BB">Test $arg</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"hello"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">);<br /> }<br />}<br /><br /></span><span style="color: #0000BB">$o </span><span style="color: #007700">= new </span><span style="color: #0000BB">test</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?><br /></span>
</code>"
string(%d) "Status: 404 Not Found
X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
No input file specified.
"
?>
--EXPECTF--
X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html%r; charset=.*|%r
string(%d) "%s/x"
Done