Bug #66997 [Fbk->Opn]: function callback problem

From: Date: Tue, 01 Apr 2014 17:35:24 +0000
Subject: Bug #66997 [Fbk->Opn]: function callback problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185020@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66997&edit=1 ID: 66997 User updated by: b4umelody at gmail dot com Reported by: b4umelody at gmail dot com Summary: function callback problem -Status: Feedback +Status: Open Type: Bug Package: Arrays related Operating System: ubuntu PHP Version: 5.4.26 Block user comment: N Private report: N New Comment: @requinix I am try actual test code on 3v4l.org site not give every PHP version of output..... Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#185020) next »