Bug #80668 [NEW]: passed by reference upgraded from notice to error

From: Date: Mon, 25 Jan 2021 14:00:23 +0000
Subject: Bug #80668 [NEW]: passed by reference upgraded from notice to error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231756@lists.php.net to get a copy of this message
From: b dot lau at tamrael dot de Operating system: linux PHP version: 7.4.14 Package: Reproducible crash Bug Type: Bug Bug description:passed by reference upgraded from notice to error Description: ------------ Since php version 7.4.9 and later, passing any non-variable to a function that expects a reference results in an error. From 7.1.0 to 7.4.8 the same would produce no warning, notice or anything and just work. Before 7.1.0 this would issue a notice but still execute the code. In 5.0.5 this would crash with an error. Maybe this is missing documentation and not a bug but changing behavior like this inside a minor version shouldn't be intended. See https://3v4l.org/iUp7Q Test script: --------------- <?php function test(&$var) { return $var; } echo test(strval('var')); Expected result: ---------------- Output of "var" and a notice Actual result: -------------- fatal error -- Edit bug report at https://bugs.php.net/bug.php?id=80668&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80668&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80668&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80668&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80668&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80668&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80668&r=support Expected behavior: https://bugs.php.net/fix.php?id=80668&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80668&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80668&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80668&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80668&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80668&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80668&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80668&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80668&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80668&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80668&r=mysqlcfg

« previous php.bugs (#231756) next »