php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48912 Namespace causes unexpected strict behaviour with extract()
Submitted: 2009-07-14 08:29 UTC Modified: 2009-07-28 12:37 UTC
Votes:22
Avg. Score:4.5 ± 1.0
Reproduced:22 of 22 (100.0%)
Same Version:22 (100.0%)
Same OS:19 (86.4%)
From: david at grudl dot com Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.0 OS: *
Private report: No CVE-ID: None
 [2009-07-14 08:29 UTC] david at grudl dot com
Description:
------------
The namespace clause causes the PHP behaves more strictly (unexpected behavior according to the documentation - with regard to the namespaces or function extract).

Reproduce code:
---------------
<?php

// namespace A;

function test()
{
	extract(func_get_arg(0));
}

test(array('x' => 1));

Expected result:
----------------
--none--

Actual result:
--------------
When row "namespace A" is commented:
--none--


When row "namespace A" is uncommented:
Strict Standards: Only variables should be passed by reference in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-15 15:48 UTC] vrana@php.net
extract() uses ZEND_SEND_PREFER_REF. It seems that it is not compatible with func_get_arg() under a namespace.
 [2009-07-28 12:35 UTC] svn@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=286452
Log: Fixed bug #48912 (Namespace causes unexpected strict behaviour with extract())
 [2009-07-28 12:36 UTC] svn@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=286453
Log: Fixed bug #48912 (Namespace causes unexpected strict behaviour with extract())
 [2009-07-28 12:37 UTC] dmitry@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC