|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66997 function callback problem
Submitted: 2014-04-01 11:10 UTC Modified: 2014-12-30 10:42 UTC
From: b4umelody at gmail dot com Assigned:
Status: No Feedback Package: Arrays related
PHP Version: 5.4.26 OS: ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
50 + 35 = ?
Subscribe to this entry?

 [2014-04-01 11:10 UTC] b4umelody at gmail dot com
test script working on 5.4.17 version but same script not working on 5.4.26 version.I think function callback problem on 5.4.26 version

Test script:


$str1 = "Samsung Television 21 Television new";

$syns = [
   'tv'   => ['sdds', 'Television new', 'Television11']

$str1 = array_reduce(array_keys($syns), function($c, $x) use ($syns)
   return $c = preg_replace('/\b'.join('\b|\b', $syns[$x]).'\b/', $x, $c);
}, $str1);

$arr1 = explode(' ', $str1);



Expected result:
string 'Samsung Television 21 tv' (length=24)

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-01 17:20 UTC]
-Status: Open +Status: Feedback
 [2014-04-01 17:20 UTC]

Looks fine. Is that the actual test code or just something similar?
 [2014-04-01 17:30 UTC] b4umelody at gmail dot com
@requinix I am try actual test code

on  site not give every PHP version of output.....
 [2014-04-01 17:35 UTC] b4umelody at gmail dot com
-Status: Feedback +Status: Open
 [2014-04-01 17:35 UTC] b4umelody at gmail dot com
@requinix I am try actual test code

on  site not give every PHP version of output.....
 [2014-04-01 17:46 UTC]
-Status: Open +Status: Feedback
 [2014-04-01 17:46 UTC]
The version numbers are a range. "5.4.0 through 5.6.0alpha3".

The code works fine. If you're having a problem then it's somewhere else.
 [2014-12-30 10:42 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 19:01:29 2024 UTC