php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55211 ArrayObject::getArrayObject ()
Submitted: 2011-07-14 20:46 UTC Modified: 2011-07-25 02:31 UTC
From: suman dot madavapeddi at gmail dot com Assigned:
Status: Verified Package: SPL related
PHP Version: 5.3.6 OS: windows 7 Professional
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: suman dot madavapeddi at gmail dot com
New email:
PHP Version: OS:

 

 [2011-07-14 20:46 UTC] 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
)

Patches

getarraycopy-skip-object-protected-private-properties (last revision 2011-07-25 06:33 UTC) by laruence@php.net)
getarraycopy-skip-protected-and-private (last revision 2011-07-24 04:17 UTC) by laruence@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-23 15:00 UTC] dsp@php.net
-Status: Open +Status: Verified
 [2011-07-24 04:17 UTC] 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-25 02:33 UTC] 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
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC