| Anonymous | Login | Signup for a new account | 06-10-2026 06:11 PDT |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0004542 | [Quercus] | crash | always | 05-11-11 13:41 | 06-21-12 01:17 | ||||
| Reporter | ronnie_p | View Status | public | ||||||
| Assigned To | nam | ||||||||
| Priority | normal | Resolution | unable to reproduce | ||||||
| Status | closed | Product Version | 4.0.14 | ||||||
| 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; ?> |
||||||||
| Additional Information | |||||||||
| Attached Files | |||||||||
|
|
|||||||||
| Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed. 27 unique queries executed. |