php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #34534 The reference for extract() does not reference an underscore being concatenated
Submitted: 2005-09-16 20:48 UTC Modified: 2005-09-16 21:43 UTC
From: phpbugs at majiclab dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at majiclab dot com
New email:
PHP Version: OS:

 

 [2005-09-16 20:48 UTC] phpbugs at majiclab dot com
Description:
------------
In the documentation, there is no reference to a '_' being 
concatenated between the prefix and the variable name being 
extracted.  Should make this fact more clear in documentation 
to aleviate some problems such as illustrated below:

Reproduce code:
---------------
<?php
extract(array('test' => 123), EXTR_PREFIX_ALL, 'prefix');
echo $prefixtest;
?>

Expected result:
----------------
123

Actual result:
--------------
undefined variable $prefixtest (it's really $prefix_test)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-16 21:43 UTC] nforbes@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:11 UTC] phpdocbot@php.net
Automatic comment on behalf of nforbes
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=884831ad79a7cf959399b795b69ca00977181f53
Log: fixed bug #34534 (not clear that extract() separates the prefix with an underscore)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC