note 110046 added to language.constants.predefined

From: Date: Fri, 14 Sep 2012 11:14:59 +0000
Subject: note 110046 added to language.constants.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-190761@lists.php.net to get a copy of this message
__METHOD__ will return bother the method name, as the class and namespace name. __FUNCTION__ will only return the method name. <?php namespace General; class ArgumentValidation { public static function validateIntArguments() { echo __FUNCTION__ . "\n"; echo __METHOD__ . "\n"; } } ArgumentValidation::validateIntArguments(new ArgumentValidation); ?> Will return: validateIntArguments General\ArgumentValidation::validateIntArguments If you want to get a ReflectionMethod instance of your sattis method is to use __FUNCTION__. $refl = new \ReflectionMethod(__CLASS__, __FUNCTION__); ---- Server IP: 69.147.83.197 Probable Submitter: 194.151.159.211 ---- Manual Page -- http://www.php.net/manual/en/language.constants.predefined.php Edit -- https://master.php.net/note/edit/110046 Del: integrated -- https://master.php.net/note/delete/110046/integrated Del: useless -- https://master.php.net/note/delete/110046/useless Del: bad code -- https://master.php.net/note/delete/110046/bad+code Del: spam -- https://master.php.net/note/delete/110046/spam Del: non-english -- https://master.php.net/note/delete/110046/non-english Del: in docs -- https://master.php.net/note/delete/110046/in+docs Del: other reasons-- https://master.php.net/note/delete/110046 Reject -- https://master.php.net/note/reject/110046 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190761) next »