Bug #69141 [Opn->Csd]: Missing arguments in reflection info for some builtin functions

From: Date: Sat, 28 Feb 2015 08:49:08 +0000
Subject: Bug #69141 [Opn->Csd]: Missing arguments in reflection info for some builtin functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191003@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69141&edit=1

 ID:                 69141
 Updated by:         reeze@php.net
 Reported by:        kostyantyn dot lysyy at oracle dot com
 Summary:            Missing arguments in reflection info for some
                     builtin functions
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Reflection related
 Operating System:   Debian Linux
 PHP Version:        master-Git-2015-02-27 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of reeze
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f824f91ac95000c7a6e60117d00088c253e16213
Log: Fixed bug #69141 Missing arguments in reflection info for some builtin functions


Previous Comments:
------------------------------------------------------------------------
[2015-02-27 20:39:17] kostyantyn dot lysyy at oracle dot com

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 this bug report at https://bugs.php.net/bug.php?id=69141&edit=1


Thread (2 messages)

« previous php.bugs (#191003) next »