Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105547 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24089 invoked from network); 1 May 2019 19:06:04 -0000 Received: from unknown (HELO mail-pf1-f176.google.com) (209.85.210.176) by pb1.pair.com with SMTP; 1 May 2019 19:06:04 -0000 Received: by mail-pf1-f176.google.com with SMTP id v80so4207842pfa.3 for ; Wed, 01 May 2019 09:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bTZ54JrTx8kXJZ815TSfjZhs3xoZNqiXvthhnRunlTg=; b=b7z6pYvclwfSPUCuR2aqTREDCmdchHph752R1bfcF6g0kfRduACf6duD65s5v9vZCR Ltluy0HsKDjahEIsabMPHJ+iltfMaz41n4FxqyTgfY4r4i9C1ShvelfnC2IXKzhPT7Gn vkVYjH2tqfmWZ3A/Cq+Fnq7dIzjT4AInt4t6T04CvvdjHVfvIvlSmyE/z3q5RfBEm3UK jMG8JVdLXjKDNi3hbXA317D94lJIItMsEETarXL3HG1wc5mIs2bq3nKMTLTqjdH993LK 5o6xsAWMA/XHlpEMxhlmMg5z+DRJmOCHcGBsYi1QeGAIWtDPBTWYmSPP1sMTgBb5fJYJ /vOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bTZ54JrTx8kXJZ815TSfjZhs3xoZNqiXvthhnRunlTg=; b=RTLtzkvsC4qkxbJeDm23qbRkGqcFZEFbb47IUZ626FIaFr36qZSz4rSVjpLpCB6ka4 YfPCeePEZQ16pTAM+7x19p84jwVRe8y0CQlJO5DhX0WDftoBFkju/p73KdevdyJlzZXx GhZXJLrW/QQAdTj8x1ljjEWZ+062HykHCLsHhBfsikV8wWlrHrn61n9jpF9CHvXUP2NF 1wawwie5z7fHXK0d5J2pWQBMoelNtIWCZlVrr1p6UgTFUHyUasPLuR3ZVkP7ZoNSla5i xQC7oM1ktyOVBZpslNpzHitEat9qXl+1JgmvhkKyJJdcamI3yprIHtR6EWtv+h5nRdzr jgjQ== X-Gm-Message-State: APjAAAUCT58yUgbs7JD+Ut+YPwhNHNAa5Al0mbZ/sF4gZwWAtkjPdmwn RzAiCq3TaQM4WjZRIxuMHAFcl/Z+RvvUkExJ3eo= X-Google-Smtp-Source: APXvYqzIg6Wh11MMae4wpzeuYP8U01kXSCExDkWgWhYqEj6K3LBUPLFlQF3ZLA+i6AFmPW8oGAqaPT3AebCxhW3FypQ= X-Received: by 2002:a63:1820:: with SMTP id y32mr22456551pgl.287.1556726909419; Wed, 01 May 2019 09:08:29 -0700 (PDT) MIME-Version: 1.0 References: <2b141597-e68e-1843-51f5-16d6ed8c41fa@gmail.com> In-Reply-To: Date: Wed, 1 May 2019 09:08:18 -0700 Message-ID: To: bishop@php.net Cc: Dan Ackroyd , PHP internals Content-Type: multipart/alternative; boundary="00000000000072c5970587d5baf5" Subject: Re: [PHP-DEV] [RFC] Allow throwing exceptions from __toString() From: mo.mu.wss@gmail.com ("M. W. Moe") --00000000000072c5970587d5baf5 Content-Type: text/plain; charset="UTF-8" Hello, the _convert_to_string return signature should be changed i.e returning a status; hence, accordingly to this status, within a context caller, you may decide to trigger an exception or not ; that's not the role of a conversion function to handle those concerns; thus the realm is wider than what it is sold here. Cheers! On Wed, May 1, 2019 at 7:53 AM Bishop Bettini wrote: > On Wed, May 1, 2019 at 7:36 AM Dan Ackroyd wrote: > > > On Wed, 1 May 2019 at 03:54, Bishop Bettini wrote: > > > > > > But I'd still think this would be a "many eyes needed" kind of PR, > > especially from extension maintainers. > > > > Hypothetically, what should these extension maintainers be looking for? > > > > Other than "Mmm-hmm. Mmm-HMM. I know some of these words!" ? > > > > Indeed. I'm by no means an expert, but here's what I did for phar and imap > extensions. I read the RFC and "got to know" the new helper methods for > resolving stringy content. I then looked at the PR for all changes to phar > and imap, verifying that I understood the changes Nikita made. Then I went > to master and PHP-7.4 branches and looked for any other cases that might > need to be changed, and while there took mental note of improvement > opportunities should this RFC pass. > > When I was in there, I was basically looking for "convert_to_string" (and > friends) and if I found any that Nikita hadn't already found, replacing > those with one of the new helpers and making sure I understood the choice > Nikita made and commenting if I disagreed. I was also looking for any case > where the conversion touched data that persisted and made sure it wasn't > going to get trashed by a bad conversion. > > I also went through code outside phar and imap looking for things I didn't > understand or surprised me or didn't look correct. Suffice to say, there's > a lot of code to look through. Some code surprised me, like that the (new > DateInterval(...))->{$badStr} unhappy path didn't adhere to the > has_property contract, so that was a bugfix Nikita made as an artifact of > this sweep, which is great and I think emblematic of the reason to get more > eyes on this: might be more of those lurking in the code base. > --00000000000072c5970587d5baf5--