I got the error Can't use function return value in write context
when trying to do assignment with empty(strip_tags($string))
as the conditional in a ternary statement. So for testing, I got rid of the assignment and the ternary statement. But I'm still getting this error when it's apparently not in a write context.
Come to think of it, I'm not sure what write context
means -- I thought it had to do with assignment, but I can't say that I know that for sure.
Why doesn't this work like I think it should? It seems pretty straight-forward to me. What am I missing?
$ cat test.php
<?
$string = "<br/>";
if ( empty(strip_tags($string)) ) {
echo "It's empty.\n";
} else {
echo "It's not empty.\n";
}
$ php test.php
PHP Fatal error: Can't use function return value in write context in test.php on line 5