Edit report at https://bugs.php.net/bug.php?id=65618&edit=1
ID: 65618 Updated by: ahar...@php.net Reported by: cavensben at gmail dot com Summary: function return in write mode fails to throw error within foreach loop -Status: Open +Status: Feedback Type: Bug -Package: Apache related +Package: Reproducible crash Operating System: windows vista PHP Version: 5.4.19 Block user comment: N Private report: N New Comment: I can't reproduce this. Does this still happen on a current 5.4 build? (You can get a snapshot at http://windows.php.net/snapshots/.) If so, could you please try to get a backtrace using the instructions at http://bugs.php.net/bugs-generating- backtrace-win32.php? The empty() changes in PHP 5.5 mean that this is likely to just work regardless (without the error) in 5.5 onwards, so the only branch that's still fully supported that's likely to be affected is 5.4. Previous Comments: ------------------------------------------------------------------------ [2013-09-04 19:49:01] cavensben at gmail dot com Description: ------------ PHP version 5.3.8 When a function return is in write mode inside a foreach loop, no exception is thrown. Fatal exception 'Can't use function return value in write context' should be thrown but instead, Apache crashes with following error details (dutch): Gebeurtenisnaam van probleem: APPCRASH Naam van de toepassing: httpd.exe Versie van toepassing: 2.2.21.0 Tijdstempel van toepassing: 4e6b3136 Naam van foutmodule: php5ts.dll Versie van foutmodule: 5.3.8.0 Tijdstempel van foutmodule: 4e537a04 Uitzonderingscode: c0000005 Uitzonderingsmarge: 0003c45d Versie van besturingssysteem: 6.0.6002.2.2.0.256.6 Landinstelling-id: 2067 Aanvullende informatie 1: f1e8 Aanvullende informatie 2: d4eb7cf28a4f910486e91a11f70d294f Aanvullende informatie 3: 9e36 Aanvullende informatie 4: 0fa4d7271c395f5ea87ec2c924074b62 Test script: --------------- foreach($values as $value) { if(!empty(trim($value))){ $result = $value;} } Expected result: ---------------- Fatal exception: Can't use function return value in write context Actual result: -------------- Apache crashes ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65618&edit=1