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 #24281 (str_replace count not returned if variable wasn't initialized) --FILE..

Decoded Output download

0 changes were made.
foo changes were made.

Did this file decode correctly?

Original Code

--TEST--
Bug #24281 (str_replace count not returned if variable wasn't initialized)
--FILE--
<?php
$string = "He had had to have had it";
$newstring = str_replace("had", "foo", $string, $count);
print "$count changes were made.\n";
$count = "foo";
$newstring = str_replace("had", "foo", $string, $count);
print "$count changes were made.\n";
?>
--EXPECT--
3 changes were made.
3 changes were made.

Function Calls

str_replace 2

Variables

$count foo
$string He had had to have had it
$newstring He foo foo to have foo it

Stats

MD5 33e7cd3024d515d36924e5bde569514d
Eval Count 0
Decode Time 88 ms