I'm writing a method which returns an function argument by its number.
protected function parseArgs($str, $args)
{
return preg_replace('|#(\d)|e', '$args[\\1 - 1]', $str);
}
$str - a string with '#N' where N is a number of argument $args - array of arguments
So if i write '#1' - it returns $arg[0], the first argument. It works with string arguments, integers... But don't work with object as argument. In returns string Object
.
How do i get the object with this function?