php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: b4umelody at gmail dot com
New email:
PHP Version: OS:

 

 [2014-04-01 11:10 UTC] b4umelody at gmail dot com
Description:
------------
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:
---------------
<?php

	

$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);

var_dump($arr1);

?>

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

Actual result:
--------------
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-01 17:20 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2014-04-01 17:20 UTC] requinix@php.net
http://3v4l.org/YhO4V

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 3v4l.org  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 3v4l.org  site not give every PHP version of output.....
 [2014-04-01 17:46 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2014-04-01 17:46 UTC] requinix@php.net
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: Thu Apr 25 23:01:29 2024 UTC