note 75959 added to function.extract
| From: | dot) | Date: | Sun, 24 Jun 2007 08:26:36 +0000 |
| Subject: | note 75959 added to function.extract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127912@lists.php.net to get a copy of this message | ||
This is kinda' nice behaviour that can be used as a workaround in some situations. But consider
its use carefully.
<?php
class A {
function B() {
extract(array('this'=>'abc'));
echo $this;
}
}
$a = new A();
$a->B(); // will echo 'abc', tested on PHP 5.1.6
?>
----
Server IP: 69.147.83.197
Probable Submitter: 89.102.215.183
----
Manual Page -- http://www.php.net/manual/en/function.extract.php
Edit -- https://master.php.net/note/edit/75959
Del: integrated -- https://master.php.net/note/delete/75959/integrated
Del: useless -- https://master.php.net/note/delete/75959/useless
Del: bad code -- https://master.php.net/note/delete/75959/bad+code
Del: spam -- https://master.php.net/note/delete/75959/spam
Del: non-english -- https://master.php.net/note/delete/75959/non-english
Del: in docs -- https://master.php.net/note/delete/75959/in+docs
Del: other reasons-- https://master.php.net/note/delete/75959
Reject -- https://master.php.net/note/reject/75959
Search -- https://master.php.net/manage/user-notes.php