com presentations: Anonymous classes: slides/intro/php7_2 015.xml
[email protected] (Rasmus Lerdorf)
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 40cd28ab9286702ec64519c17b3822f7d6b38bfc Author: Rasmus Lerdorf <[email protected]> Mon, 27 Apr 2015 11:57:52 -0700 Parents: f47feffac7b86b36f10c15cf81df48370df944e5 Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=40cd28ab9286702ec64519c17b3822f7d6b38bfc Log: Anonymous classes Changed paths: M slides/intro/php7_2015.xml Diff: diff --git a/slides/intro/php7_2015.xml b/slides/intro/php7_2015.xml index 078a258..02c3e27 100644 --- a/slides/intro/php7_2015.xml +++ b/slides/intro/php7_2015.xml @@ -46,6 +46,26 @@ Fatal error: Argument 1 passed to logmsg() must be of the type string, integer given ]]></example> +<break lines="1" section="php7anon"/> +<blurb fontsize="1.1em" align="left">✔ Anonymous Classes</blurb> +<example fontsize="1.5em" result='0' title=""><![CDATA[ +<?php +return new class($controller) implements Page { + public function __construct($controller) { + /* ... */ + } + /* ... */ +}; + +class MyObject extends MyStuff { + public function getInterface() { + return new class implements MyInterface { + /* ... */ + }; + } +} +]]></example> + <break lines="1" section="php7coalesce"/> <blurb fontsize="1.1em" align="left">✔ Null Coalesce Operator</blurb> <example fontsize="1.5em" result='0' title=""><![CDATA[