note 109819 deleted from language.operators.increment by cmb
| From: | cmb@php.net | Date: | Fri, 14 Aug 2020 07:55:05 +0000 |
| Subject: | note 109819 deleted from language.operators.increment by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214965@lists.php.net to get a copy of this message | ||
Note Submitter: michiel ed thalent circle nl
----
BEWARE:
If incrementing an uninitialized variable you will not get an E_NOTICE error. This may caused you to
not find issue's like the visibility of a property.
<?php
class a {
private $foo = 1;
}
class b extends a {
public function inc() {
echo ++$this->foo;
}
}
$b = new b;
$b->inc();
?>
Will output 1 and not 2 (if $foo was accessible).
Also no notices are given.