# Bogus Error Message?

- Thread: https://externals.io/message/8193
- Original archive: https://news-web.php.net/php.internals/8193
- Started by John Coggeshall on 2004-02-27T04:19:14+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8193 — John Coggeshall — 2004-02-27T04:19:14+00:00

URL: https://externals.io/message/8193#8193

<?php

    $reflect = new Reflection_Class("Object");
    
    $docs = $reflect->getDocComment();
    if(!empty($docs)) {
        echo "Has Docs.\n";
    }
    
    if(!empty($reflect->getDocComment())) {
        echo "Has Docs.\n";
    }
    
?>

[john@coogle ]$ php test.php 

Fatal error: Can't use method return value in write context in test.php
on line 10

Since when is empty() writing anything? Or is there something else here
that I'm not seeing?

John

-- 
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-
John Coggeshall                   http://www.coggeshall.org/
The PHP Developer's Handbook    http://www.php-handbook.com/
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=

---

## #8199 — Derick Rethans — 2004-02-27T08:20:24+00:00

URL: https://externals.io/message/8193#8199 · In reply to: #8193

> <?php
>
>     $reflect = new Reflection_Class("Object");
>
>     $docs = $reflect->getDocComment();
>     if(!empty($docs)) {
>         echo "Has Docs.\n";
>     }
>
>     if(!empty($reflect->getDocComment())) {
>         echo "Has Docs.\n";
>     }
>
> ?>
>
> [john@coogle ]$ php test.php
>
> Fatal error: Can't use method return value in write context in test.php
> on line 10
>
> Since when is empty() writing anything? Or is there something else here
> that I'm not seeing?

empty() can only be used on variables, RTFM: http://nl.php.net/empty
but I do agree that the message is bogus...

Derick

---

## #8369 — Andi Gutmans — 2004-03-04T11:48:47+00:00

URL: https://externals.io/message/8193#8369 · In reply to: #8193

At 09:20 AM 2/27/2004 +0100, Derick Rethans wrote:
>
>
> > […]
>
>empty() can only be used on variables, RTFM: http://nl.php.net/empty
>but I do agree that the message is bogus...

The error message isn't too good but it's not something which is easy to 
fix (and it's not critical). Got to think about it...
I prefer looking at a couple of other bugs which were reported which are 
pretty much the last two critical problems I can see before RC1.

Andi
