Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84835 invoked from network); 27 Jul 2014 06:58:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2014 06:58:48 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:35160] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/8C-22380-623A4D35 for ; Sun, 27 Jul 2014 02:58:47 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 315DD80630; Sun, 27 Jul 2014 02:58:54 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp12.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 35DB1803FF; Sun, 27 Jul 2014 02:58:53 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net [108.66.6.48]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.10); Sun, 27 Jul 2014 06:58:54 GMT Message-ID: <53D4A32C.9060105@sugarcrm.com> Date: Sat, 26 Jul 2014 23:58:52 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Pierre Joye CC: Julien Pauli , Ferenc Kovacs , Nikita Popov , Alexey Zakhlestin , Marco Pivetta , Sebastian Bergmann , Remi Collet , PHP Internals References: <53A62AFF.4080302@sugarcrm.com> <53B10D59.4060206@sugarcrm.com> <53D440ED.8020709@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > It would be good to have a section in UPGRADING.INTERNALS explaining > in details what should be done, very important for non core extensions > (pecl or other repositories). Probably a good idea but I'm not sure what exactly to write there, besides "initialize everything, check everything" :) There are many places (esp. in SPL, but not only) where checks are present in some methods, but not others, or some values are checked while others do not, there are also places where some checks produce errors and some exceptions, sometimes even within one class. We don't need to clean that up right now but it's a good idea to keep in mind we need to. There's also a more tricky problem since many clone functions don't do the right thing too. E.g. this script: class MyPDO extends PDO { function __construct() {} } $pdo = new MyPDO(); $pdo2 = clone $pdo; $pdo2->query("123"); Produces a segfault, even though without clone it works fine. I wonder if one overrides __clone wouldn't more things break. I wrote a simple fuzzer to test classes, here: https://gist.github.com/smalyshev/f4d0c1502fa2411478ff Note: it runs random functions with random arguments, so don't run it anywhere it could hurt real data. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/