Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #46426 (3rd parameter offset of stream_get_contents not works for "0") --FILE..

Decoded Output download

--TEST--
Bug #46426 (3rd parameter offset of stream_get_contents not works for "0")
--FILE--
<?php

$tmp = tmpfile();

fwrite($tmp, "12345");

echo stream_get_contents($tmp, 2, 1);
echo "
";
echo stream_get_contents($tmp, -1);
echo "
";
echo stream_get_contents($tmp, -1, 0);
echo "
";
echo stream_get_contents($tmp, -1, 2);
echo "
";
echo stream_get_contents($tmp, 0, 0);
echo "
";
echo stream_get_contents($tmp, 1, 0);
echo "
";
echo stream_get_contents($tmp, -1);

?>
--EXPECT--
23
45
12345
345

1
2345

Did this file decode correctly?

Original Code

--TEST--
Bug #46426 (3rd parameter offset of stream_get_contents not works for "0")
--FILE--
<?php

$tmp = tmpfile();

fwrite($tmp, "12345");

echo stream_get_contents($tmp, 2, 1);
echo "\n";
echo stream_get_contents($tmp, -1);
echo "\n";
echo stream_get_contents($tmp, -1, 0);
echo "\n";
echo stream_get_contents($tmp, -1, 2);
echo "\n";
echo stream_get_contents($tmp, 0, 0);
echo "\n";
echo stream_get_contents($tmp, 1, 0);
echo "\n";
echo stream_get_contents($tmp, -1);

?>
--EXPECT--
23
45
12345
345

1
2345

Function Calls

tmpfile 1

Variables

None

Stats

MD5 bd3dc41e598a1c79c9df48e80eb1c547
Eval Count 0
Decode Time 97 ms