Re: Re[2]: equivalent to perl shift function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/5/1 Richard Luckhurst <rluckhurst@xxxxxxxxxxxxx>:
> Hi Chris,
>
>  In perl ther is the concept of @_  which is the list of incoming parameter to a
>  subroutine. It is possible to have something like
>
>  my $sock = shift;
>
>  As I understand this the first parameter of the @_ list would be shifted.
>
>  I see for array_shift there must be an argument, the array name to shift, while
>  in perl if the array name is omitted the @_ function list is used. Is ther a php
>  equivalent to the @_ list or how might I use array_shift to achieve the same
>  result as in perl?

I''ve no idea why you want to handle arguments in the same way as perl does -
but func_get_args() returns the array of arguments to the function and you can
shift that with array_shift() if you like.

http://www.php.net/manual/en/function.func-get-args.php

-robin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux