|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 4310 | major | always | 11-30-10 12:32 | 03-22-12 13:41 | |
|
|
|||||
| Reporter: | gspeicher | Platform: | |||
| Assigned To: | OS: | ||||
| Priority: | normal | OS Version: | |||
| Status: | assigned | Product Version: | 4.0.13 | ||
| Product Build: | Resolution: | open | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | |||
|
|
|||||
| Summary: | 0004310: inconsistent behavior for declared attributes when accessed from member functions versus public member access | ||||
| Description: |
Declaring attributes in user-defined classes results in the following problematic situation: class A { public $x = 1; public function __construct() { $this->x = 2; } public function foo() { return $this->x; } } $a = new A(); print "a.x: " . $a->x . " \n"; print "a.foo(): " . $a->foo() . " \n"; class B { # note no declaration for x public function __construct() { $this->x = 2; } public function foo() { return $this->x; } } $b = new B(); print "b.x: " . $b->x . " \n"; print "b.foo(): " . $b->foo() . " \n"; Expected output: a.x: 2 a.foo(): 2 b.x: 2 b.foo(): 2 Actual output: a.x: 1 a.foo(): 2 b.x: 2 b.foo(): 2 |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| There are no notes attached to this issue. |