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-- Test strrpos() function : usage variations - heredoc string containing escape cha..

Decoded Output download

*** Testing strrpos() function: with heredoc strings ***
-- With heredoc string containing escape characters --

Did this file decode correctly?

Original Code

--TEST--
Test strrpos() function : usage variations - heredoc string containing escape chars for 'haystack' argument
--FILE--
<?php
/* Test strrpos() function by passing heredoc string containing escape chars for haystack
 *  and with various needles & offsets
*/

echo "*** Testing strrpos() function: with heredoc strings ***\n";
echo "-- With heredoc string containing escape characters --\n";
$control_char_str = <<<EOD
Hello, World\n
Hello\tWorld
EOD;
var_dump( strrpos($control_char_str, "\n") );
var_dump( strrpos($control_char_str, "\t") );
var_dump( strrpos($control_char_str, "\n", 12) );
var_dump( strrpos($control_char_str, "\t", 15) );

echo "*** Done ***";
?>
--EXPECT--
*** Testing strrpos() function: with heredoc strings ***
-- With heredoc string containing escape characters --
int(13)
int(19)
int(13)
int(19)
*** Done ***

Function Calls

strrpos 1

Variables

$control_char_str Hello, World Hello World

Stats

MD5 c741f4386db3238982cba8ae58b3ff93
Eval Count 0
Decode Time 93 ms