Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103510 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36110 invoked from network); 26 Nov 2018 16:17:06 -0000 Received: from unknown (HELO scarlet.netpirates.net) (188.94.27.5) by pb1.pair.com with SMTP; 26 Nov 2018 16:17:06 -0000 Received: from p5de2cba8.dip0.t-ipconnect.de ([93.226.203.168] helo=[192.168.178.42]) by scarlet.netpirates.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gRGBh-00080E-Vr for internals@lists.php.net; Mon, 26 Nov 2018 13:40:30 +0100 To: internals@lists.php.net References: <589a0733-839b-66aa-600e-db65a8c574dd@php.net> Reply-To: internals@lists.php.net Message-ID: Date: Mon, 26 Nov 2018 13:40:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Built-in classes that cannot be serialized From: sebastian@php.net (Sebastian Bergmann) Am 26.11.2018 um 13:35 schrieb Nikita Popov: >> If I can rely on classes to throw an exception when serialize() is >> performed (be it through zend_class_serialize_deny or in __sleep()) >> then, yes, I can just try it. > > I believe you can rely on this. Not on any specific exception type, but the > fact that it will throw. Good to know, thanks. > I've switched CURLFile, PDO and PDOStatement over to use serialize_deny. I > couldn't find other classes in bundled extensions that were manually > throwing on serialization. Thanks! > that contains a class that cannot be serialized. Serializability is not a > property of a single class or object, it's a property of the whole object > graph that is being serialized. I know: https://github.com/sebastianbergmann/global-state/blob/master/src/Snapshot.php#L360 ;-) Best, Sebastian