|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-02-18 19:32 UTC] requinix@php.net
-Status: Open
+Status: Feedback
[2015-02-18 19:32 UTC] requinix@php.net
[2015-03-01 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 05:00:01 2025 UTC |
Description: ------------ $report['errors']['linkedin'][] = CLinkedinApiHelper::api()->postToGroup('',$article['title'], $description, $content); array_filter($report['errors']['linkedin']); when function return's nothing, array creating new item $report['errors']['linkedin'][0] => null, but array_filter do not react on it, it is only react when function return null directly. Test script: --------------- $report['errors']['linkedin'][] = CLinkedinApiHelper::api()->postToGroup('',$article['title'], $description, $content); //part of helper function: if ($data['linkedin']) { $xml = simplexml_load_string($data['linkedin']); if (isset($xml->{'error-code'})) { $message = sprintf($xml->message); return $message; } } return null; //if remove this, array_filter do not see new "NULL" array item array_filter($report['errors']['linkedin']); Expected result: ---------------- array(0) {} Actual result: -------------- array(1) { [0]=> NULL }