1--TEST-- 2Bug #24281 (str_replace count not returned if variable wasn't initialized) 3--SKIPIF-- 4<?php 5 if (version_compare(zend_version(), '2.0.0-dev', '<')) die('SKIP PHP5 functionality'); 6?> 7--FILE-- 8<?php 9$string = "He had had to have had it"; 10$newstring = str_replace("had", "foo", $string, $count); 11print "$count changes were made.\n"; 12$count = "foo"; 13$newstring = str_replace("had", "foo", $string, $count); 14print "$count changes were made.\n"; 15?> 16--EXPECT-- 173 changes were made. 183 changes were made. 19