note 116656 added to language.oop5.traits

From: Date: Fri, 06 Feb 2015 04:34:47 +0000
Subject: note 116656 added to language.oop5.traits
Groups: php.notes 
Request: Send a blank email to php-notes+get-201597@lists.php.net to get a copy of this message
It's possible to define abstract function in a trait as static and implement non-static version of the function , and it will works. Like this trait B { public function smallTalk() { echo 'b'; } public function bigTalk() { echo 'B'; } abstract public function talk(); } class traitTest { use B; public static function talk() { echo 111; } } Also, it's possible to define abstract non static , and implement static version. Can't understand , is this a bug or it's a feature :) ---- Server IP: 72.52.91.14 Probable Submitter: 37.157.220.193 ---- Manual Page -- http://php.net/manual/en/language.oop5.traits.php Edit -- https://master.php.net/note/edit/116656 Del: integrated -- https://master.php.net/note/delete/116656/integrated Del: useless -- https://master.php.net/note/delete/116656/useless Del: bad code -- https://master.php.net/note/delete/116656/bad+code Del: spam -- https://master.php.net/note/delete/116656/spam Del: non-english -- https://master.php.net/note/delete/116656/non-english Del: in docs -- https://master.php.net/note/delete/116656/in+docs Del: other reasons-- https://master.php.net/note/delete/116656 Reject -- https://master.php.net/note/reject/116656 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201597) next »