rfc:callableconstructors
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
rfc:callableconstructors [2016/02/25 16:45] – Under Discussion danack | rfc:callableconstructors [2016/02/25 22:19] – DokuWiki tags danack | ||
---|---|---|---|
Line 146: | Line 146: | ||
class A { | class A { | ||
- | public function | + | public function |
return "Why would you even do this."; | return "Why would you even do this."; | ||
} | } | ||
| | ||
public function foo() { | public function foo() { | ||
- | $fn = [self:: | + | $fn = [self:: |
// Calling directly as a callable like: | // Calling directly as a callable like: | ||
// $result = $fn(); | // $result = $fn(); | ||
// Correctly fails with the error message: | // Correctly fails with the error message: | ||
- | // Error: Non-static method A::%%__%%construct() cannot be called statically | + | // Error: Non-static method A::__construct() cannot be called statically |
| | ||
// However calling with 'call user function', | // However calling with 'call user function', |
rfc/callableconstructors.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1