[Solved-4 Solutions] Weird PHP error: 'Can't use function return value in write context'
Error Description:
Weird PHP error: 'Can't use function return value in write context'
Solution 1:
- This also happens when using empty on a function return:
- because empty is not a function but a language construct (not sure), and it only takes variables:
- Since PHP 5.5, it supports more than variables. But if we need it before 5.5, use trim($name) == false.
Solution 2:
- change this line to
- we are using parentheseis () for $_POST but we wanted square brackets []
- OR
Solution 3:
- This can happen in more than one scenario, below is a list of well known scenarios :
- This also could be triggered when we try to increment the result of a function like below:
Solution 4:
- PHP Fatal error: Can’t use function return value in write context in …/wp-content/themes/customizr/inc/czr-init.php on line 441