File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / classes / private_members_serialization.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 08:02:46 2013 UTC (11 years ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, HEAD
v 5.4.20

--TEST--
Verifies that it is possible to return private member names of parent classes in __sleep
--FILE--
<?php
class foo
{
	private $private = 'private';
	protected $protected = 'protected';
	public $public = 'public';
}

class bar extends foo
{
	public function __sleep()
	{
		return array("\0foo\0private", 'protected', 'public');
	}
}

var_dump(str_replace("\0", '\0', serialize(new bar())));
?>
--EXPECTF--
string(114) "O:3:"bar":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>