Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63304 invoked from network); 18 Dec 2016 13:09:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2016 13:09:34 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.163 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.163 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.163] ([81.169.146.163:27394] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/53-27550-B8A86585 for ; Sun, 18 Dec 2016 08:09:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1482066568; l=2916; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=3k43nop1ZiJcdRIa9D75pMoMxLtgXMSELLTX6VISMTo=; b=ODsVNMqcQE+uFDTw/LLrBarNPGq/yE1vZ1OrZVojlmHzUxs935q7grBvzWvlXEtJsU zf32iSj9NtKhY/iBZXPNWUsA5PUZt1PHtepcL/qrvvwIGkr0jqxpv6xjWockuKNAaagR xun2ZPexyNlXZx60fma5P1Vt8E/ly59elljzM= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoBPBqD/sh4= X-RZG-CLASS-ID: mo00 Received: from mail-qk0-f172.google.com ([209.85.220.172]) by smtp.strato.de (RZmta 39.11 AUTH) with ESMTPSA id j0882csBID9SYKS (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sun, 18 Dec 2016 14:09:28 +0100 (CET) Received: by mail-qk0-f172.google.com with SMTP id n204so135196704qke.2 for ; Sun, 18 Dec 2016 05:09:28 -0800 (PST) X-Gm-Message-State: AIkVDXIdliH51gwe+WOiUsT5V/M19zIU2ksGcLatxigKSiLmk3Xy5DFKrGycoMIBjve1npQymi4YbC1X5Xc8qQ== X-Received: by 10.55.181.198 with SMTP id e189mr3269872qkf.231.1482066567701; Sun, 18 Dec 2016 05:09:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.149.132 with HTTP; Sun, 18 Dec 2016 05:09:27 -0800 (PST) In-Reply-To: References: Date: Sun, 18 Dec 2016 14:09:27 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Wes Cc: PHP Internals Content-Type: multipart/alternative; boundary=94eb2c06ca524d3f570543ee83dd Subject: Re: [PHP-DEV][RFC][DISCUSSION] - Throwables error code's type generalization From: me@kelunik.com (Niklas Keller) --94eb2c06ca524d3f570543ee83dd Content-Type: text/plain; charset=UTF-8 2016-12-18 10:38 GMT+01:00 Wes : > Good morning nice internals PHPeople, > > I have just written a new RFC. I believe is mostly about cosmetic changes, > as what is being proposed is probably already informally supported by PHP. > > I would like your opinion about it: > https://wiki.php.net/rfc/throwable-code-generalization > > Thank you. > +1 from my side. Currently exception codes hardly see any use. Nobody wants to invent some codes that have to be documented and are hard to remember. Instead, most people just extend their exceptions to subclasses. But what if the code comes from external software? It's fine for MySQL, because MySQL provides numeric error codes. But a lot of software is now talking to remove APIs. To my experience, most of them use non-numeric error codes, simply because they're human-readable. I don't think we should allow objects there, objects are hardly codes. But allowing string|int would be great for usage with many APIs and make $code actually useful again. --94eb2c06ca524d3f570543ee83dd--