Bug #66107 [Asn]: func_get_args change breaks by-reference in ReflectionClass::newInstanceArgs

From: Date: Mon, 16 Dec 2013 08:36:25 +0000
Subject: Bug #66107 [Asn]: func_get_args change breaks by-reference in ReflectionClass::newInstanceArgs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183352@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66107&edit=1

 ID:                 66107
 Updated by:         dmitry@php.net
 Reported by:        sjon at hortensius dot net
 Summary:            func_get_args change breaks by-reference in
                     ReflectionClass::newInstanceArgs
 Status:             Assigned
 Type:               Bug
 Package:            Arrays related
 Operating System:   archlinux
 PHP Version:        5.5.6
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

It's pushed into PHP-5.5 branch so it must be fixed in the next 5.5 release.


Previous Comments:
------------------------------------------------------------------------
[2013-12-14 04:53:20] Christian dot Stadler at der-bloggsberg dot de

Seems, like this fix didn't make it into PHP 5.5.7 in time. Does that mean, that this will be
fixed in PHP 5.5.8?

------------------------------------------------------------------------
[2013-12-10 12:19:06] dmitry@php.net

I've reverted changes in PHP-5.5 (not in PHP-5.6 and above).

------------------------------------------------------------------------
[2013-12-07 12:05:31] bugs dot php dot net at philippgampe dot info

This is a really nasty bug, because you cannot work around it.
Changing the interface breaks all 3rd-party code that makes use of your code.

------------------------------------------------------------------------
[2013-11-29 18:41:52] neufeind@php.net

This is a regression introduced from 5.5.5 to 5.5.6. Reading the news for 5.5.7RC1 now, it looks
like this won't be fixed anytime soon? :-(

Bug at TYPO3 for this. All current TYPO3-releases are affected and only work until 5.5.5.
http://forge.typo3.org/issues/53682

------------------------------------------------------------------------
[2013-11-25 12:40:18] dmitry@php.net

Actually, this code worked not on purpose but because of luck.
Previously, func_get_args() copied each argument making refcount == 1 and it allowed to pass it by
reference.

The following code demonstrates the real reason of the bug. The first call to call_user_func_array()
works but the second doesn't.

<?php
function foo(&$e) {
	var_dump($e);
}
call_user_func_array("foo", array(2));
$a = array(2);
call_user_func_array("foo", $a);
?>

The problem may be related to zend_fcall_info.no_separation handling.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=66107


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


Thread (12 messages)

« previous php.bugs (#183352) next »