|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-04 22:17 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 02:00:01 2025 UTC |
Description: ------------ Assign return value of a function to a variable, inside another function expecting a reference. Triggers an E_STRICT error and other strange behavior. Reproduce code: --------------- <?php $file = '/path/to/some/file.ext'; $extension = array_pop($fileParts = explode('.',basename($file))); echo $extension."\n"; // This works, echoes 'ext' echo count($fileParts); // Value is 2 ?> Expected result: ---------------- count($fileParts) should return 1, and E_STRICT errors shouldn't be triggered. Actual result: -------------- count($fileParts) returns 2, and an E_STRICT error is thrown