Bug #71999 [NEW]: Array references inside switch regression

From: Date: Sat, 09 Apr 2016 20:48:34 +0000
Subject: Bug #71999 [NEW]: Array references inside switch regression
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200461@lists.php.net to get a copy of this message
From: albertcasademont at gmail dot com Operating system: Debian 8.5 PHP version: 7.0.5 Package: Arrays related Bug Type: Bug Bug description:Array references inside switch regression Description: ------------ In PHP 7.0.4 the script below worked correctly, the result was TRUE. It's not the case in PHP 7.0.5 it seems that the reference inside the switch and case statements is not working correctly. Test script: --------------- <?php function bar(&$b) { switch ($b) { case 'bar': $b = null; } } $a = ['foo' => 'bar']; bar($a['foo']); var_dump(null === $a['foo']); Expected result: ---------------- bool(true) Actual result: -------------- bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=71999&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71999&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71999&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71999&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71999&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71999&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71999&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71999&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71999&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71999&r=support Expected behavior: https://bugs.php.net/fix.php?id=71999&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71999&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71999&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71999&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71999&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71999&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71999&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71999&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71999&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71999&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71999&r=mysqlcfg

« previous php.bugs (#200461) next »