Bug #79828 [NEW]: Segfault when trying to access non-existing variable

From: Date: Fri, 10 Jul 2020 23:04:00 +0000
Subject: Bug #79828 [NEW]: Segfault when trying to access non-existing variable
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227948@lists.php.net to get a copy of this message
From: sam at rmcreative dot ru Operating system: PHP version: 8.0.0alpha2 Package: Reproducible crash Bug Type: Bug Bug description:Segfault when trying to access non-existing variable Description: ------------ Executing test script under php:8.00-rc-cli-alpine segfaults. Can also be seen at https://3v4l.org/VRAoq Test script: --------------- <?php function getTime(): DateTimeInterface { return $time; } echo __LINE__; // OK getTime(); // Segfault echo __LINE__; // We aren't getting here Expected result: ---------------- Same output as PHP 7: 7 Notice: Undefined variable: time in /in/VRAoq on line 4 Fatal error: Uncaught TypeError: Return value of getTime() must implement interface DateTimeInterface, null returned in /in/VRAoq:4 Stack trace: #0 /in/VRAoq(8): getTime() #1 {main} thrown in /in/VRAoq on line 4 Process exited with code 255. Actual result: -------------- 7 Process exited with code 139. -- Edit bug report at https://bugs.php.net/bug.php?id=79828&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79828&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79828&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79828&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79828&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79828&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79828&r=support Expected behavior: https://bugs.php.net/fix.php?id=79828&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79828&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79828&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79828&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79828&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79828&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79828&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79828&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79828&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79828&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79828&r=mysqlcfg

« previous php.bugs (#227948) next »