[PHP-BUG] Bug #54171 [NEW]: is_callable() returns false on callable functions when not specifying namespace

2011-03-05 Thread hellosexyprout at gmail dot com
From: 
Operating system: Ubuntu 10.10
PHP version:  5.3.5
Package:  *General Issues
Bug Type: Bug
Bug description:is_callable() returns false on callable functions when not 
specifying namespace

Description:

First sorry, I can only test this case with PHP 5.3.3 but I 

didn't find any bugs referring to is_callable() since then, so I 

think it's worth reporting.



The problem is that is_callable() will return false if you don't 

specify the eventual namespace you're using.

Test script:
---
http://bugs.php.net/bug.php?id=54171&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=54171&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=54171&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=54171&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=54171&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54171&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=54171&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=54171&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=54171&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=54171&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=54171&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=54171&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=54171&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=54171&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=54171&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=54171&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=54171&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=54171&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=54171&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=54171&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=54171&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=54171&r=mysqlcfg



Bug #54171 [Opn]: is_callable() returns false on callable functions when not specifying namespace

2011-03-05 Thread hellosexyprout at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54171&edit=1

 ID: 54171
 User updated by:hellosexyprout at gmail dot com
 Reported by:hellosexyprout at gmail dot com
 Summary:is_callable() returns false on callable functions
 when not specifying namespace
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

PLEASE NOTE: I inverted the actual and expected results, sorry.


Previous Comments:

[2011-03-05 21:00:08] hellosexyprout at gmail dot com

Description:

First sorry, I can only test this case with PHP 5.3.3 but I 

didn't find any bugs referring to is_callable() since then, so I 

think it's worth reporting.



The problem is that is_callable() will return false if you don't 

specify the eventual namespace you're using.

Test script:
---
http://bugs.php.net/bug.php?id=54171&edit=1


Bug #54171 [Com]: is_callable() returns false on callable functions when not specifying namespace

2011-03-05 Thread hellosexyprout at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54171&edit=1

 ID: 54171
 Comment by: hellosexyprout at gmail dot com
 Reported by:hellosexyprout at gmail dot com
 Summary:is_callable() returns false on callable functions
 when not specifying namespace
 Status: Bogus
 Type:   Bug
 Package:*General Issues
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

But then PHP's behavior is incoherent because:







And anyway, being able to call bar() while 'bar' isn't 

considered callable by is_callable() (see report) is totally 

incoherent. Or I'm missing something big.


Previous Comments:

[2011-03-05 22:05:28] fel...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is expected, see #51651

----
[2011-03-05 21:04:27] hellosexyprout at gmail dot com

PLEASE NOTE: I inverted the actual and expected results, sorry.

----
[2011-03-05 21:00:08] hellosexyprout at gmail dot com

Description:

First sorry, I can only test this case with PHP 5.3.3 but I 

didn't find any bugs referring to is_callable() since then, so I 

think it's worth reporting.



The problem is that is_callable() will return false if you don't 

specify the eventual namespace you're using.

Test script:
---
http://bugs.php.net/bug.php?id=54171&edit=1


Bug #54171 [Com]: is_callable() returns false on callable functions when not specifying namespace

2011-03-05 Thread hellosexyprout at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54171&edit=1

 ID: 54171
 Comment by: hellosexyprout at gmail dot com
 Reported by:hellosexyprout at gmail dot com
 Summary:is_callable() returns false on callable functions
 when not specifying namespace
 Status: Bogus
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Great, I'm okay with that.



But how do explain this?



http://docs.php.net/manual/en/language.namespaces.faq.php



namespace foo;

function bar() { }



bar(); // foo\ is prepended in compile-time



$x = 'bar'; // obviously foo\ will not be prepended

$x(); // hence 'bar' is not found

----
[2011-03-05 22:33:26] hellosexyprout at gmail dot com

But then PHP's behavior is incoherent because:







And anyway, being able to call bar() while 'bar' isn't 

considered callable by is_callable() (see report) is totally 

incoherent. Or I'm missing something big.


[2011-03-05 22:05:28] fel...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is expected, see #51651

----------------
[2011-03-05 21:04:27] hellosexyprout at gmail dot com

PLEASE NOTE: I inverted the actual and expected results, sorry.

----------------
[2011-03-05 21:00:08] hellosexyprout at gmail dot com

Description:

First sorry, I can only test this case with PHP 5.3.3 but I 

didn't find any bugs referring to is_callable() since then, so I 

think it's worth reporting.



The problem is that is_callable() will return false if you don't 

specify the eventual namespace you're using.

Test script:
---
http://bugs.php.net/bug.php?id=54171&edit=1


Bug #54171 [Com]: is_callable() returns false on callable functions when not specifying namespace

2011-03-05 Thread hellosexyprout at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=54171&edit=1

 ID: 54171
 Comment by: hellosexyprout at gmail dot com
 Reported by:hellosexyprout at gmail dot com
 Summary:is_callable() returns false on callable functions
 when not specifying namespace
 Status: Bogus
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Damn it, thanks!

Well, sorry to have bothered you and thank you for answering my 

questions. ;)


Previous Comments:

[2011-03-05 23:08:57] fel...@php.net

You mistyped 'world' on function call :-)


[2011-03-05 23:06:16] hellosexyprout at gmail dot com

Great, I'm okay with that.



But how do explain this?



http://docs.php.net/manual/en/language.namespaces.faq.php



namespace foo;

function bar() { }



bar(); // foo\ is prepended in compile-time



$x = 'bar'; // obviously foo\ will not be prepended

$x(); // hence 'bar' is not found

----
[2011-03-05 22:33:26] hellosexyprout at gmail dot com

But then PHP's behavior is incoherent because:







And anyway, being able to call bar() while 'bar' isn't 

considered callable by is_callable() (see report) is totally 

incoherent. Or I'm missing something big.


[2011-03-05 22:05:28] fel...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is expected, see #51651




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

http://bugs.php.net/bug.php?id=54171


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