php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47748 creating class variable outside class definition
Submitted: 2009-03-22 18:20 UTC Modified: 2009-03-22 18:35 UTC
From: tompotts at itsosbroadband dot co dot uk Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.9 OS: W2k/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tompotts at itsosbroadband dot co dot uk
New email:
PHP Version: OS:

 

 [2009-03-22 18:20 UTC] tompotts at itsosbroadband dot co dot uk
Description:
------------
Seem to be able to extend instances outside class definition

Reproduce code:
---------------
class one{
 public $vars;
}
$inst=new one;
$inst->newvar="should make error";
print $inst->newvar;


Expected result:
----------------
An error where the class is modified externally to its definition.

Actual result:
--------------
allows instance to be extended willynilly.
Not sure if this is language feature by design - doesnt feel right to my  view of OO.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-22 18:35 UTC] derick@php.net
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

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC