Bug #78810 [NEW]: RW fetches do not throw "uninitialized property" exception

From: Date: Wed, 13 Nov 2019 19:56:44 +0000
Subject: Bug #78810 [NEW]: RW fetches do not throw "uninitialized property" exception
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223705@lists.php.net to get a copy of this message
From: nikic Operating system: PHP version: 7.4.0RC5 Package: Scripting Engine problem Bug Type: Bug Bug description:RW fetches do not throw "uninitialized property" exception Description: ------------ Accesses to uninitialized typed properties currently only throw an exception for R fetches, but not increments (https://3v4l.org/PPkFu) or compound assignment operators (https://3v4l.org/eHkLs). These should throw as well. Salvaged from bug #78809, which had to be deleted due to inappropriate language. Test script: --------------- <?php class Test { public int $i; } $test = new Test; $test->i++; Expected result: ---------------- Uncaught Error: Typed property Test::$i must not be accessed before initialization Actual result: -------------- Notice: Undefined property: Test::$i in /in/oqvf3 on line 7 -- Edit bug report at https://bugs.php.net/bug.php?id=78810&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78810&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78810&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78810&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78810&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78810&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78810&r=support Expected behavior: https://bugs.php.net/fix.php?id=78810&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78810&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78810&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78810&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78810&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78810&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78810&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78810&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78810&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78810&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78810&r=mysqlcfg

« previous php.bugs (#223705) next »