Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107667 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 74034 invoked from network); 24 Oct 2019 21:56:29 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 24 Oct 2019 21:56:29 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 6D4D72CA6CD for ; Thu, 24 Oct 2019 12:42:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Thu, 24 Oct 2019 12:42:56 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id w12so30960812iol.11 for ; Thu, 24 Oct 2019 12:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=AA8EF6lsyxD8j0bUPH1r0vlxIs/9FBopKb+NBZqb/IQ=; b=kXwljJpm35yhMYTTIcjzW76RuV1pKQuRmelQdAtneH7nMY3Xrq9GQ86ktBHi/9sIsj CkA02IP86YGPW4Pb78zgAO5tnuEdliS9XX4+8C6n8gFAvOP5BK4jbzaXo7LNn3Up/dr0 3FLWcL6wfbLmRYlL7HTsDP/jz4J/0zvKmDgIy5rCPnkTilzQiBt8qffUfBCCO2Gv7OjY PJ+qv/XKCrCxxbIwa1sx+Bj7IPofqj3uxYRJm3CUtb5XLc5dbAlZM55jcsc7PvE60rJM ORp7NA/gcE3uiL33BzAA4P7HaqqYHnC8RUD17EHKEz3Q2O87m2jsJGvFQQxl/JX4iUJW jl6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=AA8EF6lsyxD8j0bUPH1r0vlxIs/9FBopKb+NBZqb/IQ=; b=K/K8TBD/3PYV5BQEOFQb/Z/d1+z+hNOu2IOsQTTgX9N6lNbr0P55CV6XW89NMGgJ+M FIgGk9sv5JqzZkuG99b9LER152QyqveWylUXTzWjGc2+cWx1DJO0bbU6lR9VHD/I/LFI wNqxFuU4ih+5K7Pf748qCgmcGxaf0yNu82KHI1XqLFyU0G820w9OGkMs6zzXBwb9Aqe4 82kJfM0T3WsxJ9htUYSxWnpYFDXY3TmLqCEhUAQ4MsYA5fT9kXEfSbT3Ua5HJEAmLksD z8UYc1a1KDgP1l6UOOSmIbwC+OSs4Xn4TamzdtydJTBLiwfaZmxVWHbC+QojF9YDL2wO I9Vg== X-Gm-Message-State: APjAAAXVjtJ3sR/SSFfZtHR9xEkRnHLfuKz/vtTi9ZU21QsypPiCCvoj 21FOrMhcit3/7B4yNQKj6N1Idw== X-Google-Smtp-Source: APXvYqxpEgq+ecLXEwthifB6rnB/oJ5SGp07XT9cw5SBjvs9ETVU6XKT7UlwPESPK0UlMo/Ou60CVQ== X-Received: by 2002:a05:6602:2250:: with SMTP id o16mr6264308ioo.164.1571946176058; Thu, 24 Oct 2019 12:42:56 -0700 (PDT) Received: from [10.10.9.160] ([65.110.97.181]) by smtp.gmail.com with ESMTPSA id v13sm965083ili.65.2019.10.24.12.42.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Oct 2019 12:42:54 -0700 (PDT) Message-ID: <2A2E0ECF-7831-4221-B8A8-855251336761@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_C333B9B0-7348-44E3-8624-3ACE3E7FA911" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Thu, 24 Oct 2019 15:42:49 -0400 In-Reply-To: Cc: PHP internals To: Rowan Tommins References: <5f8115ce-0f89-c401-c8b8-9f865e76edd3@xs4all.nl> <11C11DE1-9D3B-4CB1-8226-AD48A0CE7A33@newclarity.net> X-Mailer: Apple Mail (2.3445.104.11) X-Envelope-From: Subject: Re: [PHP-DEV] Reclassifying some PHP functions warning as exceptions From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_C333B9B0-7348-44E3-8624-3ACE3E7FA911 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 24, 2019, at 12:31 PM, Rowan Tommins = wrote: >=20 > On Thu, 24 Oct 2019 at 16:38, Mike Schinkel = wrote: >=20 >>> Here, try() would swallow only FileException, other exceptions are = still >>> thrown. I'm not sure if this construct is worth introducing though, = the >>> difference compared to a proper try / catch is much smaller. >>=20 >> I would want it to capture every exception. Why not? >=20 > Because you might want to convert = "FileLockedByAnotherProcessException" to > a locally-handled error, but allow "ServerIsOnFireException" to bubble = up > to a higher-level exception handler. That's why catch blocks = basically > force you to specify class/interface names: you should catch only the > exceptions you actually know how to handle in that particular piece of = code. I totally understand that, for those wanting to program with exceptions.=20= But if we added a try() "function", the goal of that function IMO would = be to capture all exceptions and return them as errors for those who = don't want to use exceptions. But I could just as easily has logic that = says "if it is ServerOnException exception, I can throw it again" If I = want too. Or I can handle it another way. The point it, I am asking to be put 100% in control and be able to = choose how to handle errors, not have to figure out which exceptions = somethings throws because a function can throw many different types and = those types are not always well documented.If it it is returned, I will = always get it, even if my code did not expect it. -Mike= --Apple-Mail=_C333B9B0-7348-44E3-8624-3ACE3E7FA911--