php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9712 zend_is_callable clobbers values if using arrays as parameters for preg_replace
Submitted: 2001-03-12 14:37 UTC Modified: 2001-03-13 09:32 UTC
From: wez@php.net Assigned: andrei (profile)
Status: Closed Package: PCRE related
PHP Version: 4.0 Latest CVS (12/03/2001) OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wez@php.net
New email:
PHP Version: OS:

 

 [2001-03-12 14:37 UTC] wez@php.net
$search = array("!one!e", "!two!e");
// can be any code below
$replace = array("1", "2");
preg_replace($search, $replace, $matches)

Error message will look sth like:
failed to execute regexp code "Array".

Further investigation shows that pcre uses the new zend_is_callable which returns "Array" for the array.

--Wez.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-12 15:47 UTC] sniper@php.net
Ok, I'll check into this..

-Andrei

 [2001-03-13 09:32 UTC] andrei@php.net
Removed /F modifier from preg_replace(), created preg_replace_callback() function instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC