update : 2015.11.03
php.shukuma.com검색:
|
func_get_args(PHP 4, PHP 5, PHP 7) func_get_args — Returns an array comprising a function's argument list 설명
array func_get_args
( void
)
Gets an array of the function's argument list. This function may be used in conjunction with func_get_arg() and func_num_args() to allow user-defined functions to accept variable-length argument lists. 반환값Returns an array in which each element is a copy of the corresponding member of the current user-defined function's argument list. 변경점
오류/예외Generates a warning if called from outside of a user-defined function. 예제
Example #1 func_get_args() example
<?php 위 예제의 출력: Number of arguments: 3 Second argument is: 2 Argument 0 is: 1 Argument 1 is: 2 Argument 2 is: 3
Example #2 func_get_args() example before and after PHP 5.3
test.php Output previous to PHP 5.3: array ( 0 => 'First arg', 1 => 'Second arg', ) Output in PHP 5.3 and later: Warning: func_get_args(): Called from the global scope - no function context in /home/torben/Desktop/code/ml/fga.inc on line 3 false
Example #3 func_get_args() example of byref and byval arguments
<?php 위 예제의 출력: As passed : array ( 0 => 'bar', ) After change : array ( 0 => 'bar', ) As passed : array ( 0 => 'bar', ) After change : array ( 0 => 'baz', ) 주의
|