|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-12 20:58 UTC] saltybaldyev at gmx dot com
[2010-07-12 21:02 UTC] rasmus@php.net
-Status: Open
+Status: Bogus
[2010-07-12 21:02 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 20:00:01 2025 UTC |
Description: ------------ let $b=array(# , #). then list($a,$b) = $b fails. moar precise: after the assigment we'd get $b = $b[1], $a = { $b[1][0], if $b[1] is a string/array NULL, if $b[1] is a number } if $b[1] is an object we'd get a fatal error 'cant convert object->array'. ////////////////// it works correctly if we try list($b,$a)=$b. so an easy fix could be forged in just 2 additional steps: swap arguments * do the usual work * swap results Test script: --------------- $a = 1; $b = array('ohno','yeah'); list($a,$b) = $b; print_r(array('a'=>$a,'b'=>$b)); Expected result: ---------------- Array ( [a] => ohno [b] => yeah ) Actual result: -------------- Array ( [a] => y [b] => yeah )