Bug #66509 [Com]: copy() arginfo has changed starting from 5.4

From: Date: Sat, 18 Jan 2014 02:07:55 +0000
Subject: Bug #66509 [Com]: copy() arginfo has changed starting from 5.4
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183877@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66509&edit=1

 ID:                 66509
 Comment by:         willfitch@php.net
 Reported by:        jpauli@php.net
 Summary:            copy() arginfo has changed starting from 5.4
 Status:             Open
 Type:               Bug
 Package:            Reflection related
 Operating System:   *
 PHP Version:        5.4.24
 Block user comment: N
 Private report:     N

 New Comment:

@jpauli are you submitting a patch?  If not, I have some bandwidth.


Previous Comments:
------------------------------------------------------------------------
[2014-01-17 17:21:36] 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)


------------------------------------------------------------------------



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


Thread (6 messages)

« previous php.bugs (#183877) next »