|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 4542 | crash | always | 05-11-11 13:41 | 06-21-12 01:17 | |
|
|
|||||
| Reporter: | ronnie_p | Platform: | |||
| Assigned To: | nam | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 4.0.14 | ||
| Product Build: | Resolution: | unable to reproduce | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | |||
|
|
|||||
| Summary: | 0004542: Can't call method of nested classes | ||||
| Description: |
When I try to call a method in a class, which is a part of another class, I get a fatal error: <?php class A { public $foo = NULL; function __construct() { $this->foo = ' bar ';} function getFoo() { return $this->foo; } } class B { public $a = NULL; function __construct() { $this->a = new A(); } } // This works $a = new A(); echo $a->getFoo(); // this doesn't work: // Fatal Error: Method call 'getFoo' is not allowed for a null value $b = new B(); try{ echo $b->a->getFoo(); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), " "; } // This doesn't works // Fatal Error: Method call 'getFoo' is not allowed for a null value $c = $b->a; try { echo $c->getFoo(); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), " "; } // This works $c = &$b->a; echo $c->getFoo(); echo " done ";exit; ?> |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||