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 (profile)
Status: Closed Package: Reflection related
PHP Version: 5.4.24 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jpauli@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

Pull requests:

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
 [2014-10-07 23:16 UTC] stas@php.net
Automatic comment on behalf of willfitch
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=5b906ce6eb02118697c2f81d462ddfa724377fe8
Log: Fix bug #66509: copy() arginfo incorrect since 5.4
 [2014-10-07 23:27 UTC] stas@php.net
Automatic comment on behalf of willfitch
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=5b906ce6eb02118697c2f81d462ddfa724377fe8
Log: Fix bug #66509: copy() arginfo incorrect since 5.4
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC