note 114632 deleted from language.oop5.traits by levim

From: Date: Tue, 18 Mar 2014 02:58:32 +0000
Subject: note 114632 deleted from language.oop5.traits by levim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-198942@lists.php.net to get a copy of this message
Note Submitter: iMix ---- <?php define("speech", "Too cool", true); define("comp", " for school", true); class speech{ public function getSpeech() { return speech; } } trait getComp{ public function getCompletion() { $speech = new speech(); echo $speech::getSpeech(); echo comp; } } class X { use getComp; function __construct() { getComp::getCompletion(); } } $x = new x(); ?> Output: Too cool for school Best example on Earth.

« previous php.notes (#198942) next »