|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-12-01 18:37 UTC] zizka at seznam dot cz
Description:
------------
When calling empty() with a return value from function, it says:
Can't use method return value in write context
It would be definitely less confusing if it said something like:
empty() accepts only variables as a parameter.
Reproduce code:
---------------
<?php
empty(trim(""));
?>
Expected result:
----------------
Fatal error: empty() accepts only variables as a parameter in ... on line 2
Actual result:
--------------
Fatal error: Can't use method return value in write context in ... on line 2
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 16:00:02 2025 UTC |
The error message is clear enough and is used in all cases when you're trying to change function's return value, like this: <?php function foo () { return 1; } foo() = 1; ?>