note 108316 added to function.http-build-query
| From: | aanter at yahoo dot com | Date: | Tue, 17 Apr 2012 08:21:33 +0000 |
| Subject: | note 108316 added to function.http-build-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187197@lists.php.net to get a copy of this message | ||
calling http_build_query from inside a class using $this as object reference will produce output
including protected and private members as well as public members.
<?php
class Page
{
public $var1;
protected $var2;
private $var3;
function __construct(){
$this->var1='a';
$this->var2='b';
$this->var3='c';
}
function url(){
echo ( http_build_query($this));
}
};
$o=new Page;
$o->url();
?>
the output will be
var1=a&var2=b&var3=c
----
Server IP: 69.147.83.197
Probable Submitter: 41.236.168.194
----
Manual Page -- http://www.php.net/manual/en/function.http-build-query.php
Edit -- https://master.php.net/note/edit/108316
Del: integrated -- https://master.php.net/note/delete/108316/integrated
Del: useless -- https://master.php.net/note/delete/108316/useless
Del: bad code -- https://master.php.net/note/delete/108316/bad+code
Del: spam -- https://master.php.net/note/delete/108316/spam
Del: non-english -- https://master.php.net/note/delete/108316/non-english
Del: in docs -- https://master.php.net/note/delete/108316/in+docs
Del: other reasons-- https://master.php.net/note/delete/108316
Reject -- https://master.php.net/note/reject/108316
Search -- https://master.php.net/manage/user-notes.php