Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2933 | major | always | 09-14-08 00:47 | 09-15-08 19:03 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | nam | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.2.1 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in 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) ... |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|