note 79802 added to language.oop5.overloading
| From: | fok666 at gmail dot com | Date: | Thu, 13 Dec 2007 12:42:31 +0000 |
| Subject: | note 79802 added to language.oop5.overloading | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133419@lists.php.net to get a copy of this message | ||
Careful not to crash PHP with this feature (tested on Windows/php 5.1.4 only):
<?php
class test_class {
public function __set($var,$value){
$this->{$var} = $value;
}
}
$t = new test_class();
$f = null;
// crash and burn:
$t->{$f} = "some value";
?>
Albeit I don´t know why, if $f is null or is undefined, PHP will not issue any error message. It
will simply crash.
----
Server IP: 69.147.83.197
Probable Submitter: 189.7.116.70
----
Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php
Edit -- https://master.php.net/note/edit/79802
Del: integrated -- https://master.php.net/note/delete/79802/integrated
Del: useless -- https://master.php.net/note/delete/79802/useless
Del: bad code -- https://master.php.net/note/delete/79802/bad+code
Del: spam -- https://master.php.net/note/delete/79802/spam
Del: non-english -- https://master.php.net/note/delete/79802/non-english
Del: in docs -- https://master.php.net/note/delete/79802/in+docs
Del: other reasons-- https://master.php.net/note/delete/79802
Reject -- https://master.php.net/note/reject/79802
Search -- https://master.php.net/manage/user-notes.php