Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28077 invoked from network); 12 Sep 2015 22:44:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2015 22:44:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.99 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.99 blu004-omc2s24.hotmail.com Received: from [65.55.111.99] ([65.55.111.99:59501] helo=BLU004-OMC2S24.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/D1-06745-6CAA4F55 for ; Sat, 12 Sep 2015 18:44:22 -0400 Received: from BLU436-SMTP200 ([65.55.111.72]) by BLU004-OMC2S24.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sat, 12 Sep 2015 15:44:19 -0700 X-TMN: [3vD1qH2NzbGcJatWVS3TL2xjOclAldBg] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) In-Reply-To: <55EE1293.7020404@php.net> Date: Sun, 13 Sep 2015 00:44:14 +0200 CC: PHP Internals Content-Transfer-Encoding: quoted-printable References: <55EE1293.7020404@php.net> To: =?utf-8?Q?Fran=C3=A7ois_Laupretre?= X-Mailer: Apple Mail (2.2098) X-OriginalArrivalTime: 12 Sep 2015 22:44:16.0988 (UTC) FILETIME=[8E3721C0:01D0EDAC] Subject: Re: [PHP-DEV] strict-api - Proposing a tool to check and enforce encapsulation From: bobwei9@hotmail.com (Bob Weinand) > Am 08.09.2015 um 00:41 schrieb Fran=C3=A7ois Laupretre = : >=20 > Hi, >=20 > I have written a follow-up to my previous 'zstrict' PR. It is now = focused on a simple mechanism to detect API violations : >=20 > https://github.com/php/php-src/pull/1508 >=20 > This version just implements the mechanism and applies it to the = zend_string val/len/h elements. More details in the PR. >=20 > Please comment first. Then, when we're OK on the feature, we may talk = about the target version. >=20 > Regards >=20 > Fran=C3=A7ois While I don't disagree with the idea of making accidental direct access = harder, I see a particular disadvantage for debugging. Nobody will like to write "p = fbc->op_array.filename->zstrict_field_zend_string_val" (I hope I got it = right?) just to figure out where the targeted op_array is located. [At = least lldb only shows one character of the value when just printing the = zend_string, due to the struct hack...] Now you may say macro? Well, honestly, I don't usually use macros (as = .gdbinit isn't compatible with lldb and lldb is more stable than gdb on = OS X) While it brings a minor guarantee that the ZSTR_*() API is really used, = it makes debugging much harder; so I prefer to not merge this patch. Thanks for your efforts here though! Bob=