note 93318 added to language.oop5.paamayim-nekudotayim

From: Date: Wed, 02 Sep 2009 20:45:33 +0000
Subject: note 93318 added to language.oop5.paamayim-nekudotayim
Groups: php.notes 
Request: Send a blank email to php-notes+get-160173@lists.php.net to get a copy of this message
The use here is completely inconsistent with the -> operator The -> operator takes a class instance object to the left and the class property or method to the right (without the dollar sign). It can also take a string variable to the right and will evaluate it to the property or method name. The scope resolution operator on the other hand takes an explicit class name to the left or a variable containing a string of the class name (php 5.3) and a variable to the right (with $ sign) that is not really a variable but is the name of the property, unless of course a method is being referenced in which case it has the explicit function name. I think a much better definition would have been: MyClass::myProperty // explicit reference to static property MyClass::myMethod() // explicit reference to static method $myInstance->MyParentClass::myProperty // Super class reference $myClassString::$myPropertyString // variable reference to class by string variable name and static property by string variable name $myClassString::$myMethodString() // variable reference to class by string variable name and static method by string variable name $myInstance->$MyParentClass::$myProperty // totally variable ---- Server IP: 64.71.164.2 Probable Submitter: 209.167.10.131 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php Edit -- https://master.php.net/note/edit/93318 Del: integrated -- https://master.php.net/note/delete/93318/integrated Del: useless -- https://master.php.net/note/delete/93318/useless Del: bad code -- https://master.php.net/note/delete/93318/bad+code Del: spam -- https://master.php.net/note/delete/93318/spam Del: non-english -- https://master.php.net/note/delete/93318/non-english Del: in docs -- https://master.php.net/note/delete/93318/in+docs Del: other reasons-- https://master.php.net/note/delete/93318 Reject -- https://master.php.net/note/reject/93318 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160173) next »