rfc:callableconstructors
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:callableconstructors [2016/02/25 14:04] – danack | rfc:callableconstructors [2016/02/25 22:19] – DokuWiki tags danack | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Callable Constructors ====== | ====== PHP RFC: Callable Constructors ====== | ||
- | * Version: | + | * Version: |
* Date: 2016-02-25 | * Date: 2016-02-25 | ||
* Author: Dan Ackroyd, Danack@php.net | * Author: Dan Ackroyd, Danack@php.net | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
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