|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-18 04:28 UTC] crrodriguez+php at suse dot de
[2007-11-18 17:35 UTC] dnfeitosa@php.net
[2007-11-18 19:03 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 22:00:01 2025 UTC |
Description: ------------ Apache crashes and CLI segfault when serializing objects which have circular references and implements the Serializable interface. Whitout the interface, the serialization and deserialization occurs without any problem. Reproduce code: --------------- <?php class A implements Serializable { private $b; public function setB($b) { $this->b = $b; } public function serialize() { return serialize($this->b); } public function unserialize($s) { $this->b = unserialize($s); } } class B { private $a; public function __construct($a) { $a->setB($this); $this->a = $a; } } $a = new A(); $b = new B($a); var_dump(serialize($b)); ?> Expected result: ---------------- The string of the serialized object. Actual result: -------------- Apache crash or cli segfault.