note 98382 added to language.oop5.late-static-bindings
| From: | adam dot prall at thinkingman dot com | Date: | Fri, 11 Jun 2010 16:51:23 +0000 |
| Subject: | note 98382 added to language.oop5.late-static-bindings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170066@lists.php.net to get a copy of this message | ||
Just a quick reminder to always check your syntax. While I love LSB, I thought it wasn't
working:
static::$sKey = not set
â¦until I realized that Iâd completely forgotten to make it a variable variable:
$sKey = 'testStaticClassVarNameThatExistsInThisClassesScope';
static::$$sKey = is set
â¦of course this applies anywhere in PHP, but because of the (current) newness late static
bindings, Iâve seen lots of code with this particular snafu in it from others.
----
Server IP: 64.71.164.2
Probable Submitter: 2002:6296:8416:0:223:dfff:fedf:8a02
----
Manual Page -- http://www.php.net/manual/en/language.oop5.late-static-bindings.php
Edit -- https://master.php.net/note/edit/98382
Del: integrated -- https://master.php.net/note/delete/98382/integrated
Del: useless -- https://master.php.net/note/delete/98382/useless
Del: bad code -- https://master.php.net/note/delete/98382/bad+code
Del: spam -- https://master.php.net/note/delete/98382/spam
Del: non-english -- https://master.php.net/note/delete/98382/non-english
Del: in docs -- https://master.php.net/note/delete/98382/in+docs
Del: other reasons-- https://master.php.net/note/delete/98382
Reject -- https://master.php.net/note/reject/98382
Search -- https://master.php.net/manage/user-notes.php