Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75060 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34108 invoked from network); 24 Jun 2014 11:42:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2014 11:42:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=remi@fedoraproject.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=remi@fedoraproject.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fedoraproject.org from 217.70.183.196 cause and error) X-PHP-List-Original-Sender: remi@fedoraproject.org X-Host-Fingerprint: 217.70.183.196 relay4-d.mail.gandi.net Received: from [217.70.183.196] ([217.70.183.196:42365] helo=relay4-d.mail.gandi.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/50-32023-14469A35 for ; Tue, 24 Jun 2014 07:42:58 -0400 Received: from mfilter4-d.gandi.net (mfilter4-d.gandi.net [217.70.178.134]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id AF5CC172093 for ; Tue, 24 Jun 2014 13:42:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter4-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter4-d.gandi.net (mfilter4-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Zpy2kHaROGft for ; Tue, 24 Jun 2014 13:42:53 +0200 (CEST) X-Originating-IP: 82.241.130.121 Received: from schrodingerscat.famillecollet.com (pom51-2-82-241-130-121.fbx.proxad.net [82.241.130.121]) (Authenticated sender: contact@ll-experts.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 436F1172094 for ; Tue, 24 Jun 2014 13:42:53 +0200 (CEST) Message-ID: <53A9643C.9030603@fedoraproject.org> Date: Tue, 24 Jun 2014 13:42:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: PHP Internals References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A2A9BD.1070603@sugarcrm.com> <53A3874E.20704@sugarcrm.com> <53A65578.6000701@sugarcrm.com> <53A8626B.701@fedoraproject.org> <53A866B6.4060501@sugarcrm.com> <53A92B24.40706@fedoraproject.org> <53A92F93.2060507@sugarcrm.com> In-Reply-To: <53A92F93.2060507@sugarcrm.com> Content-Type: multipart/mixed; boundary="------------050003010007030509050105" Subject: Re: [PHP-DEV] Re: Bug 67072 resolution for 5.4/5.5 From: remi@fedoraproject.org (Remi Collet) --------------050003010007030509050105 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le 24/06/2014 09:58, Stas Malyshev a =C3=A9crit : > I understand that this creates a need that we do not cover of how to > mock such objects, and I welcome suggestions - including how to make > newInstanceArgWithoutConstructor safe. But currently I do not see how w= e > can leave the unserialize hack in for classes like SplFileObject - > unless somebody points me to a way to make it safe. Proposal, hawfull hack attached. Obviously, this doesn't make newInstanceWithoutConstructor safe ;) But this answer the need. And we can state in documentation. "force : allow to instantiate internal classes. Never use this !" And nobody could complain if this cause segfault. Remi. --------------050003010007030509050105 Content-Type: text/plain; charset=UTF-8; name="another_awfull_try.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="another_awfull_try.txt" LS0tIGV4dC9yZWZsZWN0aW9uL3BocF9yZWZsZWN0aW9uLmMub3JpZwkyMDE0LTA2LTI0IDEz OjIzOjExLjI2NTcyNTc4NyArMDIwMAorKysgZXh0L3JlZmxlY3Rpb24vcGhwX3JlZmxlY3Rp b24uYwkyMDE0LTA2LTI0IDEzOjIxOjMwLjg4MTMwMjgzOSArMDIwMApAQCAtNDI5NSwxMSAr NDI5NSwxNiBAQAogewogCXJlZmxlY3Rpb25fb2JqZWN0ICppbnRlcm47CiAJemVuZF9jbGFz c19lbnRyeSAqY2U7CisJemVuZF9ib29sIGZvcmNlID0gMDsKIAogCU1FVEhPRF9OT1RTVEFU SUMocmVmbGVjdGlvbl9jbGFzc19wdHIpOwogCUdFVF9SRUZMRUNUSU9OX09CSkVDVF9QVFIo Y2UpOwogCi0JaWYgKGNlLT5jcmVhdGVfb2JqZWN0ICE9IE5VTEwpIHsKKwlpZiAoemVuZF9w YXJzZV9wYXJhbWV0ZXJzKFpFTkRfTlVNX0FSR1MoKSBUU1JNTFNfQ0MsICJ8YiIsICZmb3Jj ZSkgPT0gRkFJTFVSRSkgeworCQlyZXR1cm47CisJfQorCisJaWYgKGNlLT5jcmVhdGVfb2Jq ZWN0ICE9IE5VTEwgJiYgIWZvcmNlKSB7CiAJCXplbmRfdGhyb3dfZXhjZXB0aW9uX2V4KHJl ZmxlY3Rpb25fZXhjZXB0aW9uX3B0ciwgMCBUU1JNTFNfQ0MsICJDbGFzcyAlcyBpcyBhbiBp bnRlcm5hbCBjbGFzcyB0aGF0IGNhbm5vdCBiZSBpbnN0YW50aWF0ZWQgd2l0aG91dCBpbnZv a2luZyBpdHMgY29uc3RydWN0b3IiLCBjZS0+bmFtZSk7CiAJfQogCg== --------------050003010007030509050105--