ID:               30847
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jed at jed dot bz
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: *
 PHP Version:      Irrelevant
-Assigned To:      
+Assigned To:      sean
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

You'll see, below, that "empty" objects ARE, in fact, no longer
empty(...).

I've fixed the example (removed the !), though.

As far as CVS goes, the php.net is clear on this, and the normal
procedure is for an applicant to build up a little reputation, by
supplying patches to [EMAIL PROTECTED], before applying. 

--
[EMAIL PROTECTED]:~$ echo '<?php echo PHP_VERSION ."\n"; class Test{}; $t
= new Test(); var_dump(empty($t)); echo "execute ". (!$t ? "yes" : "no")
."\n"; ?>' | php4 -q
4.1.2
bool(true)
execute yes
[EMAIL PROTECTED]:~$ echo '<?php echo PHP_VERSION ."\n"; class Test{}; $t
= new Test(); var_dump(empty($t)); echo "execute ". (!$t ? "yes" : "no")
."\n"; ?>' | php
5.0.2
bool(false)
execute no



Previous Comments:
------------------------------------------------------------------------

[2004-11-20 02:01:57] jed at jed dot bz

Description:
------------
http://us2.php.net/manual/en/migration5.incompatible.php

Example B-2, "An object with no properties is no longer considered
"empty"" is incorrect. Who would I talk to about CVS access so I can
fix this stuff?

This is a glaring mistake, since $t *definitely* contains an instance
reference regardless of what the class contains.

Reproduce code:
---------------
Below.

Expected result:
----------------
<?php
class test { }
$t = new test();

var_dump(empty($t)); // echo bool(false)

if (!$t) {
   // Will NOT be executed
}
?> 


Actual result:
--------------
<?php
class test { }
$t = new test();

var_dump(empty($t)); // echo bool(false)

if (!$t) {
   // Will be executed
}
?>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30847&edit=1

Reply via email to