Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311383 - CA missing in some cases of included files
Summary: CA missing in some cases of included files
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact: Sylvia Tancheva CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-03 11:07 EDT by Sylvia Tancheva CLA
Modified: 2020-05-14 10:16 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvia Tancheva CLA 2010-05-03 11:07:32 EDT
File x.php:
<?php
class Singleton {
    
    protected static $_instance;
    
    private function __construct() # we don't permit an explicit call of the constructor! (like $v = new Singleton())
{
    }
    
    private function __clone() # we don't permit cloning the singleton (like $x = clone $v)
{
    }
    
    public static function getInstance() {
        if (self::$_instance === NULL) {
            self::$_instance = new self ();
        }
        return self::$_instance;
    }
    
    function sayHello() {
        echo 'Hello';
    }
}


File y.php:
<?php
include_once 'x.php';
$instance = Singleton::getInstance();
$instance->| // <-- No CA here
Comment 1 Sylvia Tancheva CLA 2010-05-03 11:08:14 EDT
If you put all in the same file instead of two files, CA works OK on the given place (shows getInstance() and sayHello() )
Comment 2 Zhongwei Zhao CLA 2010-05-03 22:39:18 EDT
Hi Silviya

I think there must be some other differences between your project/file setting and mine.Now I could get the CA even I use both x.php and y.php:)
Comment 3 Zhongwei Zhao CLA 2010-05-03 22:40:19 EDT
By the way,I could get CA even there is no include statement "include_once 'x.php';"
Comment 4 Zhongwei Zhao CLA 2010-05-18 22:01:52 EDT
not reproducable in rc1
Comment 5 Gadi Goldbarg CLA 2010-05-27 07:59:15 EDT
verified at PDT-2.2.0.v20100521

Now CA is working like expect for instances from included files

Closing this issue...

Verified by
Teodor Kirkov
teodor.k@zend.com