Bug #55211 [Opn->Ver]: ArrayObject::getArrayObject ()

From: Date: Sat, 23 Jul 2011 15:00:50 +0000
Subject: Bug #55211 [Opn->Ver]: ArrayObject::getArrayObject ()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-162132@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55211&edit=1

 ID:                 55211
 Updated by:         dsp@php.net
 Reported by:        suman dot madavapeddi at gmail dot com
 Summary:            ArrayObject::getArrayObject ()
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            SPL related
 Operating System:   windows 7 Professional
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2011-07-14 20:46:31] suman dot madavapeddi at gmail dot com

Description:
------------
---
From manual page: http://www.php.net/arrayobject.getarraycopy%23Description
---


when it is referred to an object it should return only public properties of an 
object .But, Instead it is returning all the Properties of an Object

Test script:
---------------
class MyClass{
		public $pbvar = "public Variable";
		private $prvar = "Private Variable";
		protected $pdvar = "Protected Variable";
	}


        $ar  = new ArrayObject( new MyClass());
	$arc = $ar->getArrayCopy();
	print_r($arc);


Expected result:
----------------
Array
(
    [pbvar] => public Variable
   
)

Actual result:
--------------
Array
(
    [pbvar] => public Variable
    [MyClass5prvar] => Private Variable
    [*pdvar] => Protected Variable
)


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



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


Thread (4 messages)

« previous php.bugs (#162132) next »