php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65625 Ambiguous text
Submitted: 2013-09-05 19:19 UTC Modified: 2013-09-05 21:54 UTC
From: dn dot permyakov at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.5.3 OS: MacOSX Mountain Lion 10.8
Private report: No CVE-ID: None
 [2013-09-05 19:19 UTC] dn dot permyakov at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.oop5.overloading
---

-__isset() is triggered by calling isset() or empty() on inaccessible properties.

but

Note:

It is not possible to use overloaded properties in other language constructs than 
isset(). This means if empty() is called on an overloaded property, the overloaded 
method is not called.

I have checked  - both constructions trigger __isset. So you should fix the text 
on this page.(My php version is last stable 5.3.25 and no notes about difference 
between my version and last 5.5)

Test script:
---------------
<?php                                                                            
   error_reporting(E_ALL | E_STRICT);                                               
                                                                                    
   class A{                                                                         
       public function __isset($v) {                                                
           echo "ISSET triggered!\n";                                               
       }                                                                            
   }                                                                                
   $var = new A;                                                                    
  empty($var->xyz);                                                                
  isset($var->xyz);   

?> 

Expected result:
----------------
ISSET triggered!


Actual result:
--------------
ISSET triggered!
ISSET triggered!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-05 21:53 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=331299
Log: Drop the note about __isset() not being triggered on empty() — it contradicts
the earlier description and, more importantly, is plain wrong.

Fixes doc bug #65625 (Ambiguous text).
 [2013-09-05 21:54 UTC] aharvey@php.net
-Status: Open +Status: Closed -Package: *General Issues +Package: Documentation problem -Assigned To: +Assigned To: aharvey
 [2013-09-05 21:54 UTC] aharvey@php.net
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.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 22:00:01 2026 UTC