|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-18 22:23 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 17:00:01 2025 UTC |
Description: ------------ It's not possible to serialize protected and/or private member variables. Reproduce code: --------------- <?php class MyBean { protected $value = null; public function __construct() { $this->value = "hallo"; } public function setValue($value) { $this->value = $value; } public function getValue() { return $value; } } $a = new MyBean(); echo json_encode($a); ?> Expected result: ---------------- {"value":"hallo"} Actual result: -------------- {}