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 strrchr() function : usage variations - heredoc string containing blank line..

Decoded Output download

*** Testing strrchr() function: with heredoc strings ***

Did this file decode correctly?

Original Code

--TEST--
Test strrchr() function : usage variations - heredoc string containing blank line for 'haystack'
--FILE--
<?php
/* Test strrchr() function by passing heredoc string containing
 *  blank-line for haystack and with various needles
*/

echo "*** Testing strrchr() function: with heredoc strings ***\n";
$blank_line = <<<EOD

EOD;

$needles = array(
  "\n",
  '\n',
  "\r",
  "\r\n",
  "\t",
  "",
  $blank_line //needle as haystack
);

//loop through to test strrchr() with each needle
foreach($needles as $needle) {
  var_dump( strrchr($blank_line, $needle) );
}
echo "*** Done ***";
?>
--EXPECT--
*** Testing strrchr() function: with heredoc strings ***
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
*** Done ***

Function Calls

strrchr 1

Variables

$needle
$needles [{'key': 0, 'value': '\n'}, {'key': 1, 'value': '\\n'}, {'key': 2, 'value': '\r'}, {'key': 3, 'value': '\r\n'}, {'key': 4, 'value': '\t'}, {'key': 5, 'value': ''}, {'key': 6, 'value': '\n'}]
$blank_line

Stats

MD5 d43f9e20f6f982d1329b6b7afd0e1b98
Eval Count 0
Decode Time 79 ms