note 97863 added to function.array-combine

From: Date: Wed, 12 May 2010 17:04:51 +0000
Subject: note 97863 added to function.array-combine
Groups: php.notes 
Request: Send a blank email to php-notes+get-169191@lists.php.net to get a copy of this message
array_combine() has a strange bug/misfeature (as of PHP 5.3.2): There is no logical reason for <? array_combine(array(), array()) ?> throwing a warning and returning FALSE, instead of returning <? array() ?> (see http://bugs.php.net/bug.php?id=34857). Here is a quick workaround: <?php function array_real_combine($a, $b) { return $a===array() && $b===array() ? array() : array_combine($a, $b); } ?> ---- Server IP: 194.153.94.10 Probable Submitter: 62.167.68.229 ---- Manual Page -- http://www.php.net/manual/en/function.array-combine.php Edit -- https://master.php.net/note/edit/97863 Del: integrated -- https://master.php.net/note/delete/97863/integrated Del: useless -- https://master.php.net/note/delete/97863/useless Del: bad code -- https://master.php.net/note/delete/97863/bad+code Del: spam -- https://master.php.net/note/delete/97863/spam Del: non-english -- https://master.php.net/note/delete/97863/non-english Del: in docs -- https://master.php.net/note/delete/97863/in+docs Del: other reasons-- https://master.php.net/note/delete/97863 Reject -- https://master.php.net/note/reject/97863 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169191) next »