Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105525 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7211 invoked from network); 30 Apr 2019 21:47:32 -0000 Received: from unknown (HELO mail-pg1-f171.google.com) (209.85.215.171) by pb1.pair.com with SMTP; 30 Apr 2019 21:47:32 -0000 Received: by mail-pg1-f171.google.com with SMTP id i21so3806039pgi.12 for ; Tue, 30 Apr 2019 11:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j1btRfpyWTz/+8NmSUYc4KncVewPlwEr3iH95t2eajQ=; b=TWIHZPFRlrRicvY+MBvFlzuj7nsyWNday3mooNe1nU1sfQ7M5GSHYbZL6OKC3TIZ1D Rhm8bTX/bt++c4NaZVnf6Azsa+t+tTeliIcbBz5KSUiXvOuqPj2okqtVtgrYmo3eAa4e KALxKobmvFg1zEZLW8QDTDPrQLHK3YQMp0wNsV2INvLVuQcIR9YBqY2qxo0MqSFh281F x2DT5mvBGfbGBA6fs9woYy0LOYBt0/st2qjdMA4wY5CE1c8WEQYIKOd72fCDkhmwNzcL qD0zN1se+BdHkJeaB/NkFfg/zL7b3KSnjnXt+DwivEHFrAQGxtNwJkX8UA85oiM1DZ60 gq4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=j1btRfpyWTz/+8NmSUYc4KncVewPlwEr3iH95t2eajQ=; b=PJqPG7UvrKPKmtng2orbq8QaFsZODH781SMVSldOMt3/q4J8TZBqp3vsvEFe1XHQTg Vpsu9SUmhLcHT0KmGFYUQ0aQwhkvsMxvuC6CIoUnzstWwKZjloCrXjrAgFkJhlanNi9x D/Hdmm4J3NiD+XcxwKtfHE9PCnlJ4XEDR2IBAMnp/YQe8m2f6K2YeXnmoCVNoYziRJeP LfKvDErPwmqne0gapXrq2jSJUkUFzbtjLOVkdGyotksavCOy7XPeZnPbecTs0LKJ5IEJ egIBy1Sq5ZOZouYR5q9UpO+VyKws2mESr2JKgcRsRJzGj85faI9NT07QG9RpcTNVII75 rBxg== X-Gm-Message-State: APjAAAUfB1/zHcDelwZa5T91eQTQpUD8CUzQFY7fBUBnWz9CkSVPaOcx +JhqCLXkOb1zn1WIW/tIU3Gff2WWaw== X-Google-Smtp-Source: APXvYqz1t0VLYnhmvORsX+jXr9wTasPVOp3FP1vX0+jwIlXc1eK0SSXnEB/inRipdUvAy0dcfRr0/Q== X-Received: by 2002:a65:6656:: with SMTP id z22mr50824538pgv.333.1556650183456; Tue, 30 Apr 2019 11:49:43 -0700 (PDT) Received: from Stas-Pro-2016.local ([2601:646:8d01:8ee0:7124:9406:1e43:8b91]) by smtp.gmail.com with ESMTPSA id o66sm44889376pfb.184.2019.04.30.11.49.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 11:49:42 -0700 (PDT) To: Dan Ackroyd , Nikita Popov Cc: PHP internals References: Openpgp: preference=signencrypt Autocrypt: addr=smalyshev@gmail.com; prefer-encrypt=mutual; keydata= mQMuBE9mqaARCACFSqcGmNunkjQQu3X+yXnTmFeEkvM4JXZTOBdR8aEevNGmmFEfyvjaDjWi 9hcwp4E/lYtC+P7VsVjM1OSX9eq0jC/lGL0ZyRXek+mNy0n5H1NSuTpf9Y18LMqhc4G+RU+L cNiZ9K0DJuOOvNLPxW7OHZguxb3wdKPXNVa2jyRfJAKm2uaJJMT1mTmFT9a0Q8SKr+mUrrJk uG0H2o6SzrKt8Wwoint1eh67zVsJaJtQFchnEZnlawIcqP2yC4nLGR3MkubowxoEBYCZet18 aHVVRbvpG2Qtob8Lu5xrsGbmXymTkHTdpvkfcJFADa8MzOL90zO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8fgpZpR856ulT1q6uCG++CX ubEvip/eJkZl93/84h04KQJwsgOrAh0Om3OePRn8Pr+++0LNS0EL8uX/YHeTOGOnnmTqYTey SBVFdov6L4mepddfjekicKQqhL7mZh/xuq29JijT0uNNX8v4vDWQDu5dlAcdd+uB3gcXMD/P ginD11zp+6wtrWCm/+yBqpvDwXQX5PGUnwvbRfl7Ay3MmwmoXiecZMg0dwTSc7e0lhB4HGRH ZdBMJB4rHUVGdzqujK/ctOvrAAMFB/0Utb76Qe6sCMlHxVAmeE/fbo7Pi05btZ/x01r67dHf aMSP0riCKJ7M0OW+jAXtu9+z/BVnYisW67WWfxl2cS5tZDgiHgJARXWUOO72+sScHP8KQmTl 1z16gyKbwY3SmyBkwcpOL35nhUWNLy93syPoY6sZUTikr2bZYukHDQ33XBPs4e6MbWKfsa9q aVmnlOF3k5UqChjutfHaEa4Q7VP4wBIpphHBi9MI16oJIzzBPbGl2uoedjwiZ6QeQZnSuOVY ZxU2d3lRA8PrtfFN1VSlpEm/VcAvtieHUYWHN0wOu+cp3Slr5XJVNjTjJhl28SlinMME54mK AGf2Ldr/dRwXiGEEGBEIAAkFAk9mqaACGwwACgkQL3lWvF2gS126EQD/VVd3FgjLKglClRQP zdfU847tqDK4zJjbmRv5vLLwoE0A+wbrQs7jVGU3NrS0AIl5vUmewpp2BKzSkepy23nWmejw Message-ID: <2b141597-e68e-1843-51f5-16d6ed8c41fa@gmail.com> Date: Tue, 30 Apr 2019 11:49:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Allow throwing exceptions from __toString() From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Please could someone anyone who understands the implications for what > this means for the internals of the PHP engine provide some detailed > reasons for why this shouldn't be approved, if there are any reasons. > > Otherwise voters might 'irresponsibly' vote yes, without being aware of them. This is the tricky one because it gets into one of the corner cases of the engine that has never worked perfectly. We have a bunch of places where we can get some code executed in the middle of other code executed, and it never worked particularly well. One of such places is (un)serialization, another is error and exception handling. Generally, running code from the guts of the engine is dangerous, because there might be stale pointers, race conditions (not the parallel kind but the kind "we checked it above, but below it may no longer be the case because we run code in between"), shared mutable state, etc. and it's nigh impossible to ensure nothing gets broken by it. That said, the work done on the patch is super impressive. I am reasonably sure that Nikita caught as many instances of something going wrong when string conversion fails as humanly possible. And I agree that banning exceptions didn't actually solve the problem anyway, because error handlers present the same exactly issue - exceptions are just much more prominent and immediate in their effects, but with some hostile coding - or even some inadvertently convoluted one - you'd run into the same issues again. Some extensions will probably have some trouble - though with high likelyhood they already do anyway. I think since the reason why it was banned is largely gone with this patch it's a good step forward. There are probably still some corner cases that would not work properly - I am especially worried about variables left un-initialized in places where they are expected to be initialized - like internal classes - but I think the awesome job done on this patch is a good step forward and unless we discover some critical issue blocking it, it makes sense to do it. I plan to try and review the patch in my copious free time, but so far I do not have any objections beyond "yet another place where things could go wrong". Since that place effectively already existed, I think this RFC is good. -- Stas Malyshev smalyshev@gmail.com