note 83682 added to function.call-user-func-array

From: Date: Sat, 07 Jun 2008 18:38:38 +0000
Subject: note 83682 added to function.call-user-func-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-140208@lists.php.net to get a copy of this message
the order of argument correspondence from the array to the function formal parameters is by 'natural order' of the array and not explicit numerical key order. So: $a[0] = 'arg 1'; $a[2] = 'arg 2'; $a[1] = 'arg 3'; call_user_func_array('foo', $a); delivers the args to foo in the order the keys were inserted! as in... foo($a[0], $a[2], $a[1]); if you wanted something else, ksort the array first. ---- Server IP: 209.41.74.194 Probable Submitter: 76.105.247.92 ---- Manual Page -- http://www.php.net/manual/en/function.call-user-func-array.php Edit -- https://master.php.net/note/edit/83682 Del: integrated -- https://master.php.net/note/delete/83682/integrated Del: useless -- https://master.php.net/note/delete/83682/useless Del: bad code -- https://master.php.net/note/delete/83682/bad+code Del: spam -- https://master.php.net/note/delete/83682/spam Del: non-english -- https://master.php.net/note/delete/83682/non-english Del: in docs -- https://master.php.net/note/delete/83682/in+docs Del: other reasons-- https://master.php.net/note/delete/83682 Reject -- https://master.php.net/note/reject/83682 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140208) next »