php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66509 copy() arginfo has changed starting from 5.4
Submitted: 2014-01-17 17:21 UTC Modified: 2014-01-18 02:44 UTC
From: jpauli@php.net Assigned: willfitch
Status: Closed Package: Reflection related
PHP Version: 5.4.24 OS: *
Private report: No CVE-ID:
 [2014-01-17 17:21 UTC] jpauli@php.net
Description:
------------
php53 --rf copy
Function [ <internal:standard> function copy ] {

  - Parameters [3] {
    Parameter #0 [ <required> $source_file ]
    Parameter #1 [ <required> $destination_file ]
    Parameter #2 [ <optionnal> $context ]
  }
}

php54 --rf copy
Function [ <internal:standard> function copy ] {

  - Parameters [3] {
    Parameter #0 [ <required> $source_file ]
    Parameter #1 [ <required> $destination_file ]
    Parameter #2 [ <required> $context ]
  }
}

Starting from 5.4, copy() arginfo decl has been changed from ZEND_BEGIN _ARG_INFO_EX to ZEND_BEGIN _ARG_INFO , making all parameters required for Reflection. $context is though optionnal


Test script:
---------------
$r = new \ReflectionFunction('copy');
 
foreach($r->getParameters() as $p) {
    var_dump($p->isOptional());	
}

Expected result:
----------------
bool(false)
bool(false)
bool(true)

Actual result:
--------------
bool(false)
bool(false)
bool(false)

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-18 02:07 UTC] willfitch@php.net
@jpauli are you submitting a patch?  If not, I have some bandwidth.
 [2014-01-18 02:28 UTC] jpauli@php.net
You can go for a patch. Please, merge it to 5.4/5.5/5.6 and master, and update NEWS accordingly (README.GIT-RULES details that)

The patch is trivial though.
Thx
 [2014-01-18 02:44 UTC] willfitch@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: willfitch
 [2014-01-18 02:46 UTC] willfitch@php.net
@jpauli - went the GitHub route.
 [2014-01-18 16:27 UTC] willfitch@php.net
Automatic comment on behalf of willfitch
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b906ce6eb02118697c2f81d462ddfa724377fe8
Log: Fix bug #66509: copy() arginfo incorrect since 5.4
 [2014-01-18 16:27 UTC] willfitch@php.net
-Status: Assigned +Status: Closed
 [2014-01-18 16:45 UTC] willfitch@php.net
Automatic comment on behalf of willfitch
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b906ce6eb02118697c2f81d462ddfa724377fe8
Log: Fix bug #66509: copy() arginfo incorrect since 5.4
 [2014-01-18 16:57 UTC] willfitch@php.net
Automatic comment on behalf of willfitch
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b906ce6eb02118697c2f81d462ddfa724377fe8
Log: Fix bug #66509: copy() arginfo incorrect since 5.4
 [2014-01-19 01:35 UTC] ab@php.net
Automatic comment on behalf of willfitch
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b906ce6eb02118697c2f81d462ddfa724377fe8
Log: Fix bug #66509: copy() arginfo incorrect since 5.4
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 19:01:53 2014 UTC