note 112058 added to language.oop5.traits

From: Date: Sat, 27 Apr 2013 09:14:17 +0000
Subject: note 112058 added to language.oop5.traits
Groups: php.notes 
Request: Send a blank email to php-notes+get-194643@lists.php.net to get a copy of this message
Traits can be useful to create Fluent API ex: trait StaticMake { public static function make() { return new static(); } } class HelloWorld { use StaticMake; public function getHello() { return "Hello World"; } } //now instead: $theHello = new HelloWorld; echo $theHello -> getHello(); //one may just use echo HelloWorld:make() -> getHello(); ---- Server IP: 76.75.200.61 Probable Submitter: 92.107.14.238 ---- Manual Page -- http://php.net/manual/en/language.oop5.traits.php Edit -- https://master.php.net/note/edit/112058 Del: integrated -- https://master.php.net/note/delete/112058/integrated Del: useless -- https://master.php.net/note/delete/112058/useless Del: bad code -- https://master.php.net/note/delete/112058/bad+code Del: spam -- https://master.php.net/note/delete/112058/spam Del: non-english -- https://master.php.net/note/delete/112058/non-english Del: in docs -- https://master.php.net/note/delete/112058/in+docs Del: other reasons-- https://master.php.net/note/delete/112058 Reject -- https://master.php.net/note/reject/112058 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194643) next »