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

From: Date: Tue, 11 Aug 2015 09:51:23 +0000
Subject: note 117792 added to function.call-user-func-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-203305@lists.php.net to get a copy of this message
$param_arr may be empty, though it can't be null. <?php function foo( $first = 'default1', $second = 'default2' ) { echo "first: '$first', second: '$second'\n"; } call_user_func_array( 'foo', array( 'one', 'two' ) ); call_user_func_array( 'foo', array( 'only one' ) ); call_user_func_array( 'foo', array() ); call_user_func_array( 'foo', null ); ?> Output: first: 'one', second: 'two' first: 'only one', second: 'default2' first: 'default1', second: 'default2' /* error message or nothing printed depending on version */ ---- Server IP: 72.52.91.14 Probable Submitter: 217.74.47.7 ---- Manual Page -- http://php.net/manual/en/function.call-user-func-array.php Edit -- https://master.php.net/note/edit/117792 Del: integrated -- https://master.php.net/note/delete/117792/integrated Del: useless -- https://master.php.net/note/delete/117792/useless Del: bad code -- https://master.php.net/note/delete/117792/bad+code Del: spam -- https://master.php.net/note/delete/117792/spam Del: non-english -- https://master.php.net/note/delete/117792/non-english Del: in docs -- https://master.php.net/note/delete/117792/in+docs Del: other reasons-- https://master.php.net/note/delete/117792 Reject -- https://master.php.net/note/reject/117792 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#203305) next »