#47672 [Opn->Bgs]: public attribute within class initial value issue

From: Date: Mon, 16 Mar 2009 13:27:42 +0000
Subject: #47672 [Opn->Bgs]: public attribute within class initial value issue
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-134743@lists.php.net to get a copy of this message
ID: 47672 Updated by: jani@php.net Reported By: jimmyp2 at freemail dot gr -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: windows 2003 std edition sp2 PHP Version: 5.2.9 New Comment: Expected, you don't get notice about it since you never use the class. The constant is checked once you do '$foo = new TestClass;'. Previous Comments: ------------------------------------------------------------------------ [2009-03-16 12:14:14] jimmyp2 at freemail dot gr Description: ------------ Hello, while testing this new release i noticed that declaring a public attribute the way is shown in the "Reproduce code" section below no error/exception is issued by the scripting engine's parser. Is this a normal behaviour ? Web server used : Apache v. 2.2.11 PHP version : 5.2.9-1 Thank you. Reproduce code: --------------- <?php error_reporting(E_ALL); class TestClass { public $var1 = YTRTWTRT; // notice !!! the value is not quoted // and no constant with such name exists. } ?> Expected result: ---------------- a parser error issued. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47672&edit=1

« previous php.bugs (#134743) next »