From:             guth at fiifo dot u-psud dot fr
Operating system: Linux
PHP version:      5.0.2
PHP Bug Type:     Zend Engine 2 problem
Bug description:  array_key_exists doesn't work with protected properties

Description:
------------
Hello, 
 
array_key_exists should return true for protected and 
private vars if the are called from that scope. 
 
Bad english to explain more, so look at the code. 
 
 
Vincent Guth 

Reproduce code:
---------------
<?php

class A {

        protected $b = 'test';
        public $c = 'test';
        
        public function __construct() {

                var_dump(array_key_exists('b', $this));
                var_dump(array_key_exists('c', $this));
        
        }

}

new A;
?>

Expected result:
----------------
bool(true) 
bool(true) 
 

Actual result:
--------------
bool(false) 
bool(true) 

-- 
Edit bug report at http://bugs.php.net/?id=30694&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30694&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30694&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30694&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30694&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30694&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30694&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30694&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30694&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30694&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30694&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30694&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30694&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30694&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30694&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30694&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30694&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30694&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30694&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30694&r=mysqlcfg

Reply via email to