Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75636 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12563 invoked from network); 17 Jul 2014 05:34:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2014 05:34:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.182 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.182 mail-lb0-f182.google.com Received: from [209.85.217.182] ([209.85.217.182:48109] helo=mail-lb0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/70-09067-E7067C35 for ; Thu, 17 Jul 2014 01:34:55 -0400 Received: by mail-lb0-f182.google.com with SMTP id z11so1307368lbi.41 for ; Wed, 16 Jul 2014 22:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=JxIZBiHPNSo/qZgVKfxNSCfFXkOOVcmFJmImKaG7jz8=; b=g7g2HHSJwimLapPPfpXOmF4Ykht6QxIJZugvuXCzUL6rKDUTlAAHdBtkMtOoOj1v3l 7mlDjaGrvSmXmwWGbDM6yHVsvk1LXTOhl8ZN92GrBBRR07tqUu7MhZgQFhdilJxtBa3L 6hvsfpJK5GxUNY8s9jocA7N5kq0WvdCWW6htre3BG80nqJCVEel8ab9jnHNscmZfIvgq iAFwr9VRjjSsokgN32HBhhltCv6YSPxC6ZGEgUNFSMOy5/xh+brOLVk35zbo72//g4NI z06a6lX3KJ3YRE2RERoTP4I7TZJCI1vqWEnoVgekIqPnwwwgsLx+mwPOUyJWokYy2cC6 CWgQ== X-Received: by 10.152.115.229 with SMTP id jr5mr593394lab.94.1405575292130; Wed, 16 Jul 2014 22:34:52 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.128.202 with HTTP; Wed, 16 Jul 2014 22:34:12 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Jul 2014 14:34:12 +0900 X-Google-Sender-Auth: 7-UAn4YERbHj0ZAgztdZX5g01QM Message-ID: To: Laruence Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c35458fe1c8c04fe5cff24 Subject: Re: [PHP-DEV] An BC issue in unserialize From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c35458fe1c8c04fe5cff24 Content-Type: text/plain; charset=UTF-8 Hi Laruence, On Thu, Jul 17, 2014 at 1:01 PM, Laruence wrote: > /** > * Creates a new instance of the mapped class, without invoking > the constructor. > * > * @return object > */ > public function newInstance() > { > if ($this->_prototype === null) { > $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', > strlen($this->name), $this->name)); > } > > return clone $this->_prototype; > } > Just curious. This code is trying to initialize object with __wakeup() method rather than __construct(). Do you know what kind of object is initialized? What's the reason why it needs to use __wakeup() or avoid __construct()? If the usage is valid, we may try to find solutions. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c35458fe1c8c04fe5cff24--