Doc #55211 [Ver->Csd]: ArrayObject::getArrayObject() should only returns public properties of an object

From: Date: Wed, 18 Nov 2020 12:29:51 +0000
Subject: Doc #55211 [Ver->Csd]: ArrayObject::getArrayObject() should only returns public properties of an object
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18126@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:         cmb@php.net
 Reported by:        suman dot madavapeddi at gmail dot com
 Summary:            ArrayObject::getArrayObject() should only returns
                     public properties of an object
-Status:             Verified
+Status:             Closed
 Type:               Documentation Problem
 Package:            SPL related
 Operating System:   windows 7 Professional
 PHP Version:        5.3.6
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Fixed as <http://svn.php.net/viewvc?view=revision&revision=351422>.


Previous Comments:
------------------------------------------------------------------------
[2020-11-18 12:14:50] cmb@php.net

Well, I doubt that this is a real bug, since casting an object to
array exhibits the same behavior.  Thus I'm changing to
documentation problem.

------------------------------------------------------------------------
[2011-07-25 02:33:59] laruence@php.net

The following patch has been added/updated:

Patch Name: getarraycopy-skip-object-protected-private-properties
Revision:   1311575639
URL:        https://bugs.php.net/patch-display.php?bug=55211&patch=getarraycopy-skip-object-protected-private-properties&revision=1311575639

------------------------------------------------------------------------
[2011-07-24 04:17:05] laruence@php.net

The following patch has been added/updated:

Patch Name: getarraycopy-skip-protected-and-private
Revision:   1311481025
URL:        https://bugs.php.net/patch-display.php?bug=55211&patch=getarraycopy-skip-protected-and-private&revision=1311481025

------------------------------------------------------------------------
[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 (2 messages)

« previous php.doc.bugs (#18126) next »