Difference in behaviour of func_num_args,func_get_arg and func_get_args from php 5.2 to 5.3

前端 未结 2 1371
情书的邮戳
情书的邮戳 2021-01-12 02:46

I have seen the PHP manual. But I don\'t understand the difference in behaviour between the earlier version and the later versions of PHP. I don\'t understand this statement

2条回答
  •  甜味超标
    2021-01-12 03:00

    It means that this is invalid in 5.2:

    function foo() {
        $array = array_map('strtolower', func_get_args());
    }
    foo('BAR', 'BAZ');
    

    It will abort with a Fatal error:

    PHP Fatal error: func_get_args(): Can't be used as a function parameter

    However in 5.3, it is valid code.

提交回复
热议问题