Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103763 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17165 invoked from network); 18 Jan 2019 04:39:14 -0000 Received: from unknown (HELO mail-io1-f47.google.com) (209.85.166.47) by pb1.pair.com with SMTP; 18 Jan 2019 04:39:14 -0000 Received: by mail-io1-f47.google.com with SMTP id c2so9400177iom.12 for ; Thu, 17 Jan 2019 17:15:44 -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=MJusYbO8NNkDLC9AimhHAlsmcCIt/aciFOGhQc3Wrdo=; b=oBPBI2u1BUj4vmr/9TTw5oTUu/H2THolRL6vxL9YCPTdU3cMzTBo0H0rhxtWhEjW71 54SfjtmVek+WDHhTAetYpakZOq2ZAZmtNiOox9Ea3gluHO4Uc35tOc94yOsRjeN/2lcf ApaOTDWl1hLwXo4YxOzYCzPzdTjW5qMf1spXfuTl2Cfd8NDFeYmSvTmkntgUENn+UtM5 AfBtmHtv+Nz4haM6iok+vUVr6dvn3BBDgGEdf+jP2PlksFF7uIcCTYghws4c17wvcNAp wisefwuu5CZqaFjwLMqpqhw40VO53Vi07TkjwtWRjJQJQrkm7lbQET3s6Z0+rnmQuxMp 6+iw== 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=MJusYbO8NNkDLC9AimhHAlsmcCIt/aciFOGhQc3Wrdo=; b=ktDCWYDv+Am4w8GsrLG47SojlliBAUTf2+c/ykqNBv84oJ98uPsHaannu4xAhph4w1 vQ1EAhWKeyoOrJIjoQ3sxXkGCZkYbsKf/u2SYnXzZoToabhL3a/p8P9DPe2TAcSYgHDw ynbkDWnASz2x/DeA+ZjixExl4slk0nM6s+RlvLNByrAPUMSSDYzMh4lOPJZVL5W53Ibl Oja1ModOMhW9xCzimIhlMmRh7cOBAUzcgpV6c2VMLphTkFOiiB46CxL+ZuY1Nbn3U1Ee g+egX2YLvqX3KcJmD9fbthwx8KkYc14X48HKhi8V8/SMQXvuQwRhYJRTjiregIv96sHF 2HGA== X-Gm-Message-State: AJcUukc3jVgGmDTAlzR42uviZ6CRI+yQb/yUgt9DDQeL3aB0+yq8m7qt zSgN6ieoJnE6jkPYeoYB+tbVIKNtzkpijgNyLfJXDrwbq2w= X-Google-Smtp-Source: ALg8bN6xnDovelbYz0PbRYs4X87834WAdSCDzOaqMM2ZBY+DZOBELVt5UCKh09qahufRvS1LSR5GY314GC1EmqWYzOs= X-Received: by 2002:a5d:8ac6:: with SMTP id e6mr8283797iot.235.1547774144534; Thu, 17 Jan 2019 17:15:44 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 18 Jan 2019 02:15:33 +0100 Message-ID: To: Marcos Passos Cc: internals Content-Type: multipart/alternative; boundary="00000000000013de5f057fb140fd" Subject: Re: [PHP-DEV] Unserializes, inheritance and allows_classes From: ocramius@gmail.com (Marco Pivetta) --00000000000013de5f057fb140fd Content-Type: text/plain; charset="UTF-8" On Fri, Jan 18, 2019 at 2:13 AM Marcos Passos wrote: > How would you fix this example, then? Perhaps we should add more examples >> in the docs. >> > > But it closes for extension preventing the serialization of instances not > whitelisted. It may work for @internal or package private classes, but not > for public classes. > That is precisely what this is designed for. A subclass is a different type, with a world of possible broken things in it: do not consider the subclass to be the same as a parent class: it's a logical mistake. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --00000000000013de5f057fb140fd--