Mantis Bugtracker
  

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

- Relationships

- Notes
(0005917)
nam
06-21-12 01:17

Unable to reproduce for 4.0.29 (upcoming).
 

- Issue History
Date Modified Username Field Change
05-11-11 13:41 ronnie_p New Issue
05-11-11 13:41 ronnie_p Issue Monitored: ronnie_p
05-13-11 00:27 kdecherf Issue Monitored: kdecherf
06-21-12 01:16 nam Status new => assigned
06-21-12 01:16 nam Assigned To  => nam
06-21-12 01:17 nam Status assigned => closed
06-21-12 01:17 nam Note Added: 0005917
06-21-12 01:17 nam Resolution open => unable to reproduce


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