note 14324 added to function.func-get-args.php

From: Date: Thu, 26 Jul 2001 18:18:59 +0000
Subject: note 14324 added to function.func-get-args.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15877@lists.php.net to get a copy of this message
What ak@avatartech.com said above contains an error. function printme($x) { print($x); print(func_get_arg(2)); } printme("one ","two"); This prints "one" and gives an error. The arglist is zero-based. So function printme($x) { print($x); print(func_get_arg(1)); } printme("one ","two"); Would print "one two". func_get_arg(0) would return nothing, though, since the first argument (argument zero) is already in a variable. http://www.php.net/manual/en/function.func-get-args.php

« previous php.notes (#15877) next »