|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-06-29 12:52 UTC] xbite at exonium dot net
Description:
------------
If you redefine class property, you don't get any errors.
Reproduce code:
---------------
class Class {
var $property = "some value";
var $property = "some other value";
}
Expected result:
----------------
PHP should generate an error.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
It does: [derick@kossu derick]$ php-4.3.3RC1 <?php class Class { var $property = "some value"; var $property = "some other value"; } ?> PHP Parse error: parse error, expecting `T_STRING' in - on line 2[derick@kossu derick]$ php <?php class F { var $property = "some value"; var $property = "some other value"; } ?> PHP Fatal error: Cannot redeclare f::$property in - on line 4 As you see this works fine (with PHP-5.0.0dev).