Anonymous | Login | Signup for a new account | 09-07-2024 16:17 PDT |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003232 | [Quercus] | minor | always | 01-09-09 07:43 | 01-09-09 16:47 | ||||
Reporter | haplo | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 4.0.0 | Product Version | 3.2.1 | ||||
Product Build | |||||||||
Summary | 0003232: PostIncrement doesn't work when fields are accessed using magic getter and setter methods | ||||||||
Description |
If a member field is accessed using the php magic getter and setter method the post increment doesnt work on thoes fields Test: <?php class method_test { private $number; public function __construct(){ $this->number = 4; } public function getNumber(){ return $this->number; } public function setNumber($value){ $this->number = $value; } public function __get($value){ $getter='get'.$value; if(method_exists($this,$getter)) { return $this->$getter(); } throw new Exception("Method ('$getter') does not exists"); } public function __set($name, $value){ $setter='set'.$name; if(method_exists($this,$setter)) { $this->$setter($value); } else { throw new Exception("Method ('$setter') does not exists"); } } } /* 1. Test does work! */ $test = new method_test(); echo '1. Number: ' . $test->Number . ''; $test->Number = $test->Number +1; echo '2. Number: ' . $test->Number . ''; echo 'Number is 5? ' . ($test->Number == 5 ? 'Yes' : 'No'); /* 2. Test doesn't work */ $test = new method_test(); echo '1. Number: ' . $test->Number . ''; $test->Number ++; echo '2. Number: ' . $test->Number . ''; echo 'Number is 5? ' . ($test->Number == 5 ? 'Yes' : 'No'); |
||||||||
Steps To Reproduce | |||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |