Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104196 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8502 invoked from network); 5 Feb 2019 20:12:09 -0000 Received: from unknown (HELO mail-it1-f176.google.com) (209.85.166.176) by pb1.pair.com with SMTP; 5 Feb 2019 20:12:09 -0000 Received: by mail-it1-f176.google.com with SMTP id i145so10029623ita.4 for ; Tue, 05 Feb 2019 08:53:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OX/I6kjQ25LeOf457cXKeXnYpnWKgB9v9W0xdsnhhpo=; b=FvgIkZgAYUOkWoiOuOcyILnozETweKRYWwKE8a7TbvUhHmsdP1gHUK07fquKBexh2v bc6ju8DM716j8cfLcZ/nOv3ezl1216PtKfcRk1wzXKfW1Nd12EvOqGFarJA2CYyC45QP INs0QyY/9W3g9y3mOgpBobUPT3WANItzmaXyWd/dfSQEdlsMjA2LRQEB0WfE/DOEVviZ OZQ/JLkDLFUJRI0J3vnbFELBmLt2KKMxBU8gTK0hbvk0hCcancAk94a6UwPPpqGwUvle DA0sYR/zuvEnhcOe1BjBRqj75gM4G75d7VJWaihvxVWWRqRkngIFCsTbWqWIjYCpCOU9 U8Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OX/I6kjQ25LeOf457cXKeXnYpnWKgB9v9W0xdsnhhpo=; b=cH+6j+2luWWYDS7pgR+Qcqw+teErjFukveZznYOxsv2NJORzZeQs1k9Aru7RKT3Kq6 X+d+Oq/HE5tNRcFLoshj+Dk01bwCHmW5ucfLhQGiOtYIUElrxiNJ+q1o7Rafq9wXIvrr 8NFVcu0G1ygfNtuoziXX+VKuXc+IlHgGxrUyPVPw8+qDCoHSsOpBbJDxxJc4wT/DRc0S 8xX4oPCFI7isMGWf3+f/H4Gh63ycs1nvKOMJ+9tfv+9llZZtrCfDdEbzI8RAMk93jKu6 JD+RBUBeczhlT+vmyw0+ZmhNPmTA3aPgwcNt/gN+4etXnR47LI79xysfSTN/wTktskuY S3Fg== X-Gm-Message-State: AHQUAuYl3FyQOYwiICiO1TWD9Z7/Fj3A8oRExORau6RnNMwm+lMnsHZw 6hlu7pWJA1iiNm7NcXyAH4W+vXYXc71OyUCK+sc= X-Google-Smtp-Source: AHgI3Ib1yDkQGcwIJ4AkouQxN6LV9gAr3HwpTj5Xd0/EPTI7RRhC/bbQ66za/9pPEBgkMwdsu9CL/+SUtZftrApVU0I= X-Received: by 2002:a24:32c5:: with SMTP id j188mr2980209ita.139.1549385599735; Tue, 05 Feb 2019 08:53:19 -0800 (PST) MIME-Version: 1.0 References: <2fed98af-3831-1a1c-def8-04793fcc0c6f@birkholz.biz> <2a566239-d205-72f8-fd78-630b7ff01581@birkholz.biz> In-Reply-To: <2a566239-d205-72f8-fd78-630b7ff01581@birkholz.biz> Date: Tue, 5 Feb 2019 16:53:08 +0000 Message-ID: To: Dennis Birkholz Cc: Nikita Popov , Joe Watkins , PHP internals Content-Type: multipart/alternative; boundary="0000000000004adbfe058128720c" Subject: Re: [PHP-DEV] RFC Weakrefs From: rowan.collins@gmail.com (Rowan Collins) --0000000000004adbfe058128720c Content-Type: text/plain; charset="UTF-8" On Tue, 5 Feb 2019 at 16:06, Dennis Birkholz wrote: > Maybe for PHP 8 we > will decide to require all classes to be serializable except classes > that implement the Unserializable interface or something... Or the magic > __isSerializable() method that can decide this at runtime for the actual > state of an object without failing hard when trying it. > I agree, it can be very confusing if you have something like a SimpleXML object buried somewhere, and your serialize() call blows up. (See the example I've raised a couple of times where Exceptions may or may not be serializable, because they slurp up objects from everywhere in their backtrace.) I was going to suggest this would fit with the discussion Nikita raised about adding a new serialization mechanism, but thinking about it more, I'm not sure how the API for this would work. If you don't recursively check that the properties of an object are also serializable, the call is useless; but if you do, it's really no different from try { serialize($foo); } catch {} Regards, -- Rowan Collins [IMSoP] --0000000000004adbfe058128720c--