|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10546 extract() to work with objects
Submitted: 2001-04-29 01:06 UTC Modified: 2016-08-07 04:54 UTC
Avg. Score:3.0 ± 1.5
Reproduced:3 of 6 (50.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: fabiankessler at usa dot net Assigned:
Status: Suspended Package: Class/Object related
PHP Version: * 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: fabiankessler at usa dot net
New email:
PHP Version: OS:


 [2001-04-29 01:06 UTC] fabiankessler at usa dot net

class foo {
  function foo() {
    $var_array = array('hello'=>'world');
    extract($var_array, EXTR_PREFIX_ALL, "this->prefix");
    echo $this->prefix_hello;
$f = new foo();



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-16 17:41 UTC]
-Package: Feature/Change Request +Package: Class/Object related -Operating System: all +Operating System: * -PHP Version: 4.0.4 +PHP Version: *
 [2013-09-19 23:03 UTC] metamarkers at gmail dot com
A blind import into an object would be neat for shortcutting certain things, but 
would undermine __set(). Consider instead:

function import ( $object , array $vars ) {
    foreach ($vars as $k=>$v) {
        $object->$k = $v;
 [2016-08-06 00:31 UTC]
-Status: Assigned +Status: Closed -Assigned To: andrei +Assigned To: kalle
 [2016-08-06 00:31 UTC]
I'm gonna close this, such a feature would need a healthy discussion on the mailing list which most likely will end in an RFC.

All in all I'm not a huge fan of this, but every idea deserves a chance
 [2016-08-06 09:35 UTC]
-Status: Closed +Status: Suspended
 [2016-08-06 09:35 UTC]
By convention "Suspended" is our "Needs RFC" state.
 [2016-08-07 04:54 UTC]
-Assigned To: kalle +Assigned To:
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 11:05:45 2022 UTC