Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] 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 Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.2.1 Product Version 3.2.1
  Product Build
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
Attached Files

- Relationships

- 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
 

- Issue History
Date Modified Username Field Change
09-14-08 00:47 koreth New Issue
09-15-08 16:39 ferg Note Added: 0003443
09-15-08 16:39 ferg Assigned To  => ferg
09-15-08 16:39 ferg Status new => closed
09-15-08 16:39 ferg Resolution open => fixed
09-15-08 16:39 ferg Fixed in Version  => 3.2.1
09-15-08 18:34 nam Status closed => assigned
09-15-08 18:34 nam Assigned To ferg => nam
09-15-08 19:03 nam Status assigned => closed
09-15-08 19:03 nam Note Added: 0003445


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker