Bug #69141 [NEW]: Missing arguments in reflection info for some builtin functions
| From: | kostyantyn dot lysyy at oracle dot com | Date: | Fri, 27 Feb 2015 20:39:18 +0000 |
| Subject: | Bug #69141 [NEW]: Missing arguments in reflection info for some builtin functions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190996@lists.php.net to get a copy of this message | ||
From: kostyantyn dot lysyy at oracle dot com
Operating system: Debian Linux
PHP version: master-Git-2015-02-27 (Git)
Package: Reflection related
Bug Type: Bug
Bug description:Missing arguments in reflection info for some builtin functions
Description:
------------
But reflection does not see the more recently added argument for some
common functions:
Here are the ones I've noticed:
- setcookie (missing "httponly")
- setrawcookie (missing "httponly")
- spl_autoload_register (missing 2 optional params)
- mktime (missing "is_dst")
- gmmktime (missing "is_dst")
spl_autoload_register seems to be fixed in 'master' so I did not include
it in the fix.
Test script:
---------------
<?php
$functionsWithMissingReflectionParams = array(
'setcookie' => 7
,'setrawcookie' => 7
,'spl_autoload_register' => 3 // missing in php 5.6.2-1
,'mktime' => 7
,'gmmktime' => 7
);
foreach($functionsWithMissingReflectionParams as $funcName =>
$expectCount)
{
$refl = new ReflectionFunction($funcName);
if($expectCount != count($refl->getParameters()))
printf("'%s' has %d != %d params, according to reflection\n",
$funcName, count($refl->getParameters()), $expectCount);
else
unset($functionsWithMissingReflectionParams[$funcName]);
}
if(!$functionsWithMissingReflectionParams)
echo "Everything works fine!\n";
Expected result:
----------------
Everything works fine!
Actual result:
--------------
'setcookie' has 6 != 7 params, according to reflection
'setrawcookie' has 6 != 7 params, according to reflection
'spl_autoload_register' has 1 != 3 params, according to reflection
'mktime' has 6 != 7 params, according to reflection
'gmmktime' has 6 != 7 params, according to reflection
--
Edit bug report at https://bugs.php.net/bug.php?id=69141&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69141&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69141&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69141&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69141&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69141&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69141&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69141&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69141&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69141&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69141&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69141&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69141&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69141&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69141&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69141&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69141&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69141&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69141&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69141&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69141&r=mysqlcfg