Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75148 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33491 invoked from network); 30 Jun 2014 18:11:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2014 18:11:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.172 as permitted sender) X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:42025] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/32-19922-438A1B35 for ; Mon, 30 Jun 2014 14:11:00 -0400 Received: by mail-lb0-f172.google.com with SMTP id c11so6210437lbj.31 for ; Mon, 30 Jun 2014 11:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=P7JczoGx8Ei8bzBjQl48L8MIlwYcYxCoqz70gH5uSyk=; b=NMcaznGpuELr7aLxqRssFXeAiJmJuP2lCgEOAZs4voSgD8gJ3AoDgFgN7CVRaTbl+0 RPSeDUL3dTVBBaWLY9yi5sLE0UvEmRv2VJ4rrHm7FmiirG1OBcrzqrSpLJZyYRjytkV+ g4cPRVA3ZI8wYq15E7Q5WHn8gAYw4tccIIjOwqPKRgFsTg7cHWKvGkY42XHDJOk6Sgws klJeW9fwQ53bbReh1s+RCmeUrq/DsX5o0wkDyB1FqQlfxKkPV/Rmp8tE7tR4v6fxqhz2 Ig+Qt/JqFq3CeVqafJXK2tKaQA/8m23oOkG4O2TcSOLmq6ntn4D+lIju87yrKt80wTpl fLGA== X-Received: by 10.152.207.37 with SMTP id lt5mr32741980lac.10.1404151857472; Mon, 30 Jun 2014 11:10:57 -0700 (PDT) Received: from [10.0.1.8] ([46.252.161.106]) by mx.google.com with ESMTPSA id h12sm24404965lbo.8.2014.06.30.11.10.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 11:10:56 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B29D53D4-4470-4EF7-AACB-9F0DA9E4EBEE"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.1 (8a210ce+) In-Reply-To: <53B10D59.4060206@sugarcrm.com> Date: Mon, 30 Jun 2014 22:10:45 +0400 Cc: Marco Pivetta , Ferenc Kovacs , Sebastian Bergmann , Julien Pauli , Remi Collet , PHP Internals Message-ID: References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A2A9BD.1070603@sugarcrm.com> <53A3874E.20704@sugarcrm.com> <53A62AFF.4080302@sugarcrm.com> <53B10D59.4060206@sugarcrm.com> To: Stas Malyshev X-Mailer: Apple Mail (2.1878.2) Subject: Re: [PHP-DEV] Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: indeyets@gmail.com (Alexey Zakhlestin) --Apple-Mail=_B29D53D4-4470-4EF7-AACB-9F0DA9E4EBEE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 30 Jun 2014, at 11:10, Stas Malyshev wrote: > I think we should move away from the practice of using serializer for > something it was never made for, namely a weird way of instantiating > classes. Serializer should be working only with serialized data. > Now, the question is can we instantiate the internal class without > calling its ctor, and the answer here would probably be "no", at least > not safely. While in the case of user class the engine can be = reasonable > sure even if you don't call the ctor the basic structures are > initialized properly, in the case of the internal class all bets are > off. I'm not sure yet which use cases require ctor not to be called, = but > I'm not sure how we can deliver on internal classes here. Sorry, I=92m a bit late to discussion and might be missing something = obvious. As far as I remember, internal classes have 2 constructors. 1. implementation of __construct() function 2. create_object hook It should be possible to keep unsafe stuff in create_object which is = called unconditionally and leave safe initialisation in __construct. so, in case when __construct is not called object will have properties = initialised with nulls, empty strings, etc. I understand that is a lot of work on case-by-case basis but it is = doable. -- Alexey Zakhlestin CTO at Grids.by/you https://github.com/indeyets PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc --Apple-Mail=_B29D53D4-4470-4EF7-AACB-9F0DA9E4EBEE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBCgAGBQJTsagtAAoJEMkJcRxZdR27OcMH/16vvGhFDRrA7HwkqIczptP/ zbtPfA8rCE0vPi6WDb+daomjNawKWVcA5AmOhmKIA4FrMO8bEQSE7i6FLXFsqTww w0NI8so5nUCxpiFASf9Dli0a5r1YJU1ArV/WVSSB4WyuhpX0Cm70l9SnrdPWFohG DcFtQB8cqv1UZNytTFJU1fAW8d7DDG5Qqnid7/kgaZFKjW0pYtHKTwHGSmpe9SiL C8RB0DabYzV+Njiuk48N0ivfDgCQxRi/RTHz1I4yWdy1NSOS3TZwz9UF0owtLP1Z Z/Xz0M7chvlu9NbWZmMych5yOtBoV65ynOb14XkPPUxLIDbUUG38ZUgzA/+ZflM= =yRFC -----END PGP SIGNATURE----- --Apple-Mail=_B29D53D4-4470-4EF7-AACB-9F0DA9E4EBEE--