Anonymous | Login | Signup for a new account | 12-17-2024 08:22 PST |
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 | ||||
0002933 | [Quercus] | major | always | 09-14-08 00:47 | 09-15-08 19:03 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.2.1 | ||||||
Summary | 0002933: Static class method can't access private instance fields | ||||||||
Description |
<?php class Foo { private $val; public function __construct($val) { $this->val = $val; } public static function getVal($foo) { return $foo->val; } } $foo = new Foo(123); print Foo::getVal($foo); Vanilla PHP prints "123". Quercus prints nothing and logs an exception: [00:44:08.117] {http--8080-21} com.caucho.quercus.QuercusErrorException: .../test.php:12: Fatal Error: Can't access private field 'Foo::val' [00:44:08.117] {http--8080-21} at com.caucho.quercus.env.Env.error(Env.java:4806) [00:44:08.117] {http--8080-21} at com.caucho.quercus.env.Env.error(Env.java:4709) [00:44:08.117] {http--8080-21} at com.caucho.quercus.env.Env.error(Env.java:4387) [00:44:08.117] {http--8080-21} at com.caucho.quercus.env.ObjectExtValue.getField(ObjectExtValue.java:178) [00:44:08.117] {http--8080-21} at com.caucho.quercus.expr.FieldGetExpr.eval(FieldGetExpr.java:74) ... |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Notes | |
(0003443) ferg 09-15-08 16:39 |
php/091m (backed out private method checking for now) |
(0003445) nam 09-15-08 19:03 |
fixed |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed. 28 unique queries executed. |