- func_get_arg: documentation ( source)
<?php
class G {
private $s;
function ()
{
if (!$this->s) {
$this->s = 'g';
}
if ($a = @func_get_arg(0)) {
return$this->s .= $a;
}
$this->s .= 'o';
return $this;
}
}
function g()
{
return new G();
}
// This is the best that you can do in PHP
// because of this: https://wiki.php.net/rfc/uniform_variable_syntax
//
// PHP supports unicode, unicode supports zero-width spaces
echo g()->()->()->()->('al') . PHP_EOL;
echo g()->()->('al') . PHP_EOL;
echo g('al') . PHP_EOL;