Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.0a3

Bug #12301 Compat calls php 5 function
Submitted: 2007-10-22 11:56 UTC Modified: 2007-12-03 17:10 UTC
From: phpwebber Assigned: arpad
Status: Closed Package: PHP_Compat (version 1.6.0a1)
PHP Version: 4.3.9 OS: Linux
Roadmaps: 1.6.0a2    
Subscription  


 [2007-10-22 11:56 UTC] phpwebber (Matt McNaney)
Description: ------------ In str_ireplace line 73: $result = preg_replace($search, $replace, $subject, -1, $count); From: http://us3.php.net/manual/en/function.preg-replace.php 5.1.0 Added the count parameter Since the fifth parameter is 5+ specific, user is getting this error: Warning: Wrong parameter count for preg_replace() in ../lib/pear/Compat/Function/str_ireplace.php on line 73 Test script: --------------- echo str_ireplace('foo', 'bar', 'foo'); Expected result: ---------------- bar Actual result: -------------- Warning: Wrong parameter count for preg_replace() in ../lib/pear/Compat/Function/str_ireplace.php on line 73

Comments

 [2007-12-03 17:10 UTC] arpad (Arpad Ray)
Thanks for the report, using a PHP 5 feature was obviously an oversight but we've decided to drop support for the $count argument since we can't make it optional in PHP 4 and the performance cost is too great when a count isn't necessary. This is now fixed in CVS.