Bug #55311 [Bgs]: Static methods invoke __call when called from within class

2011-07-30 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=55311&edit=1

 ID: 55311
 Updated by: cataphr...@php.net
 Reported by:steve at twitpic dot com
 Summary:Static methods invoke __call when called from within
 class
 Status: Bogus
 Type:   Bug
 Package:*General Issues
 Operating System:   Ubuntu 11.04
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

> one expects a static call to behave the same 
> inside of a class as qell as outside of a class

The thing is it's not a static call. :: only defines the scope (hence its name, 
"Scope Resolution Operator"), it doesn't determine whether the call is static 
or it isn't.


Previous Comments:

[2011-07-29 15:56:29] steve at twitpic dot com

This is ridiculous- this bug is not bogus, it's completely legitimate, 
unexpected 
behavior, and totally non documented. As a reasonable programmer, one expects a 
static call to behave the same inside of a class as well as outside of a class.

How can we bring the "desired" behavior up for vote? I think that it's insane 
to 
not fix it.


[2011-07-29 08:33:24] cataphr...@php.net

Closing as bogus, see 
http://www.mail-archive.com/internals@lists.php.net/msg52338.html


[2011-07-29 03:31:19] larue...@php.net

The following patch has been added/updated:

Patch Name: bug55311.phpt
Revision:   1311910279
URL:
https://bugs.php.net/patch-display.php?bug=55311&patch=bug55311.phpt&revision=1311910279


[2011-07-29 03:29:37] larue...@php.net

The following patch has been added/updated:

Patch Name: bug55311.patch
Revision:   1311910177
URL:
https://bugs.php.net/patch-display.php?bug=55311&patch=bug55311.patch&revision=1311910177


[2011-07-29 03:28:51] larue...@php.net

looks like for some reason someone change the if/else sequence make this bug, 
but I am not sure why he do this.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=55311


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55311&edit=1


Bug #55311 [Bgs]: Static methods invoke __call when called from within class

2011-07-29 Thread steve at twitpic dot com
Edit report at https://bugs.php.net/bug.php?id=55311&edit=1

 ID: 55311
 User updated by:steve at twitpic dot com
 Reported by:steve at twitpic dot com
 Summary:Static methods invoke __call when called from within
 class
 Status: Bogus
 Type:   Bug
 Package:*General Issues
 Operating System:   Ubuntu 11.04
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

This is ridiculous- this bug is not bogus, it's completely legitimate, 
unexpected 
behavior, and totally non documented. As a reasonable programmer, one expects a 
static call to behave the same inside of a class as well as outside of a class.

How can we bring the "desired" behavior up for vote? I think that it's insane 
to 
not fix it.


Previous Comments:

[2011-07-29 08:33:24] cataphr...@php.net

Closing as bogus, see 
http://www.mail-archive.com/internals@lists.php.net/msg52338.html


[2011-07-29 03:31:19] larue...@php.net

The following patch has been added/updated:

Patch Name: bug55311.phpt
Revision:   1311910279
URL:
https://bugs.php.net/patch-display.php?bug=55311&patch=bug55311.phpt&revision=1311910279


[2011-07-29 03:29:37] larue...@php.net

The following patch has been added/updated:

Patch Name: bug55311.patch
Revision:   1311910177
URL:
https://bugs.php.net/patch-display.php?bug=55311&patch=bug55311.patch&revision=1311910177


[2011-07-29 03:28:51] larue...@php.net

looks like for some reason someone change the if/else sequence make this bug, 
but I am not sure why he do this.


[2011-07-28 21:04:42] steve at twitpic dot com

Description:

When calling a non-existant static method within an objects method, php invokes 
_call instead of 
__callStatic. When calling the same non-existant static method outside of the 
object, php correctly 
invokes __callStatic.

It appears that this broke in php5.3.5 and is still broken in 5.3.6. It works 
as 
expected in 5.3.3, 
however.

Test script:
---
class Test {

  public function __call($method, $args) {
   echo "call\n";
  }

  public static function __callStatic($method, $args) {
   echo "callStatic\n";
  }

  public function testing() {

Test::fakeFunction();

  }

}

$t = new Test;
$t->testing();
Test::fakeFunction();

Expected result:

// expected output
callStatic
callStatic

Actual result:
--
// output
call
callStatic






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55311&edit=1