#43165 [Opn->Bgs]: Static in assignment

From: Date: Wed, 31 Oct 2007 20:01:23 +0000
Subject: #43165 [Opn->Bgs]: Static in assignment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119168@lists.php.net to get a copy of this message
ID: 43165 Updated by: johannes@php.net Reported By: felipensp at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.3CVS-2007-10-31 (snap) New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php That's the new late static binding feature, see http://docs.php.net/manual/en/language.oop5.late-static-bindings.php Previous Comments: ------------------------------------------------------------------------ [2007-10-31 16:54:51] felipensp at gmail dot com Description: ------------ PHP accepts keyword 'static' in assignment. Reproduce code: --------------- <?php class foo { static $a = 1; public function __construct() { $a = static ::$a; var_dump($a); } } new foo; Expected result: ---------------- Parse error: syntax error, unexpected T_STATIC Actual result: -------------- No error. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43165&edit=1

« previous php.bugs (#119168) next »