jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

build php result show issue? #129

Closed skingzd closed 6 years ago

skingzd commented 9 years ago

I found a bug when build php files,my code :

<?php
class A
{
    private function foo(){
        echo "success";
    }
    public function test(){
        echo "\nusing $ to echo :\n";
        $this->foo();

        echo "\nusing static to echo: \n";
        static::foo();
    }
}

class B extends A
{
    private function foo(){

    }
}
$a = new A;
$a->test();
$b = new B;
$b->test();
?>

And I use ctrl+b to build this ,the second line of result should not there. here the result in sublime result window:

using $ to echo : PHP Fatal error: Call to private method B::foo() from context 'A' in F:\w\test.php on line 12 success using static to echo: success using $ to echo : success using static to echo:

Fatal error: Call to private method B::foo() from context 'A' in F:\w\test.php on line 12 [Finished in 0.4s]

but directly use php.exe via cmd get this result(run php.exe f:/w/test.php):

using $ to echo : success using static to echo: success using $ to echo : success using static to echo: PHP Fatal error: Call to private method B::foo() from context 'A' in F:\w\test.php on l ine 14

Fatal error: Call to private method B::foo() from context 'A' in F:\w\test.php on line 1 4

FichteFoll commented 9 years ago

There is no PHP build system provided by default. What build system are you using?

skingzd commented 9 years ago

@FichteFoll I'm using the custom function in tool menu , Build system -> Add new Buildsystem , my cfg is "cmd":["php","$file"] ,Normally it can works well,but this time...