Bug #66997 [Opn->Fbk]: function callback problem
Edit report at https://bugs.php.net/bug.php?id=66997&edit=1
ID: 66997
Updated by: requinix@php.net
Reported by: b4umelody at gmail dot com
Summary: function callback problem
-Status: Open
+Status: Feedback
Type: Bug
Package: Arrays related
Operating System: ubuntu
PHP Version: 5.4.26
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2014-04-01 17:35:24] 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:30:01] 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:20:01] requinix@php.net
http://3v4l.org/YhO4V
Looks fine. Is that the actual test code or just something similar?
------------------------------------------------------------------------
[2014-04-01 11:10:36] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66997&edit=1
Thread (6 messages)