I saw a library with a method named “do”
public function do
totally bugs out parser
Parse error: syntax error, unexpected T_DO, expecting T_STRING in …
//same on call
$obj->do()
Parse error: syntax error, unexpected T_DO, expecting T_STRING or T_VARIABLE or ‘$’ in
Gearman Uses a “do” function by the way.
“do” is a reserved keyword: http://www.php.net/manual/en/reserved.keywords.php
On that same page, in the comments, you see a user mention a way around this. Bear in mind that this method must be used with care:
So you see, you could use a
domethod (or some other reserved word) in any class by using the__calloverload. Externally, this method would be indistinguishable from a traditionally defined method.