title: PHP variable length arguments?
body: <p>In Python and others, there's special syntax for variable length argument lists:</p>
  
  <pre><code>def do_something(*args):
      # do something
  
  do_something(1, 2, 3, 4, 5, ...) # arbitrarily long list
  </code></pre>
  
  <p>I was reading the PHP manual, and it said this:</p>
  
  <blockquote>
    <p>PHP 4 and above has support for
    variable-length argument lists in
    user-defined functions. This is really
    quite easy, using the func_num_args(),
    func_get_arg(), and func_get_args()
    functions.</p>
    
    <p>No special syntax is required, and
    argument lists may still be explicitly
    provided with function definitions and
    will behave as normal.</p>
  </blockquote>
  
  <p>I get the first part. You can pass as many arguments as you'd like to a function that takes no arguments, then get them as an array using <code>func_get_args()</code>, etc. I don't really get what the second part is saying, though.</p>
  
  <p>So, my question is, is there some special syntax for variable length arguments, or some best practice that I don't know about? The approach that the manual suggests seems kludgey at best and makes your function seem like it's taking no arguments (unless I'm doing it wrong). Should I not be trying to use this language feature at all?</p>