rfc:structured_object_notation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:structured_object_notation [2016/07/31 08:50] – midorikocak | rfc:structured_object_notation [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 87: | Line 87: | ||
<code php> | <code php> | ||
- | <?php | + | class B{ |
- | + | ||
- | Class B{ | + | |
// No way to define order of methods | // No way to define order of methods | ||
Line 121: | Line 119: | ||
Instead of instantiating objects on the fly, here I propose a structured definition of an object using this syntax: | Instead of instantiating objects on the fly, here I propose a structured definition of an object using this syntax: | ||
<code php> | <code php> | ||
- | + | object | |
- | Object | + | |
$world = " | $world = " | ||
// allowed methods comes after method definition | // allowed methods comes after method definition | ||
Line 142: | Line 139: | ||
}; | }; | ||
} | } | ||
- | + | </code> | |
- | < | + | |
An object can be instance of a class, if it's not defined, is instance of an anonymous class. | An object can be instance of a class, if it's not defined, is instance of an anonymous class. | ||
Line 158: | Line 154: | ||
===== Future Scope ===== | ===== Future Scope ===== | ||
- | Allowed methods can have typed parameters. | + | Allowed methods can have typed parameters. Ide's can use the object notation for autocompletion. Also an object can tell allowed methods using magic method like __help() when $app-> |
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== |
rfc/structured_object_notation.1469955013.txt.gz · Last modified: 2017/09/22 13:28 (external edit)