FAQ
<?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/
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-

Search Discussions

  • Derick Rethans at Feb 27, 2004 at 8:20 am

    On Thu, 26 Feb 2004, John Coggeshall wrote:

    <?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
  • Andi Gutmans at Mar 4, 2004 at 11:49 am

    At 09:20 AM 2/27/2004 +0100, Derick Rethans wrote:
    On Thu, 26 Feb 2004, John Coggeshall wrote:

    <?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...
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedFeb 27, '04 at 4:19a
activeMar 4, '04 at 11:49a
posts3
users3
websitephp.net

People

Translate

site design / logo © 2022 Grokbase