note 79802 deleted from language.oop5.overloading by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 15:24:00 +0000 |
| Subject: | note 79802 deleted from language.oop5.overloading by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133563@lists.php.net to get a copy of this message | ||
Note Submitter: fok666 at gmail dot com
----
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.