Best way to emulate Ruby “splat” operator in PHP function signatures [Method overloading]

In Ruby

def my_func(foo,bar,*zim)
  [foo, bar, zim].collect(&:inspect)
end

puts my_func(1,2,3,4,5)

# 1
# 2
# [3, 4, 5]

In PHP (5.3)

function my_func($foo, $bar, ... ){
  #...
}

What's the best way to to do this in PHP?

5
задан maček 25 August 2010 в 21:49
поделиться