Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86281 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5238 invoked from network); 17 May 2015 00:20:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2015 00:20:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.213.46 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.213.46 mail-yh0-f46.google.com Received: from [209.85.213.46] ([209.85.213.46:36313] helo=mail-yh0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/33-14891-FBED7555 for ; Sat, 16 May 2015 20:20:16 -0400 Received: by yhrr66 with SMTP id r66so42078170yhr.3 for ; Sat, 16 May 2015 17:20:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=I8gtZkTMfu1QsR77F1YZhadqYtiRk/K0VjixEYP9/dA=; b=VdJE+0vZruLTLjpKTn58xjF7OzIUaIVrll11HqZl2Dyq10qv5V49i1yvp/P6kE2xYd F0jcq2oBE+oxCgxzbbqVtfd/N7ScLWv/nY0f9sLdfTf8qKo4XO2vane/l9bq0zyF1nNw O44dur2kmwSv3gdg+TOIncQBT4IuryHoxeSC7khH+y9suZqWKd00Els1kIdjVjV9Tb1e MzOF0yc3Y97vkr1k6mfsMikiCUmfN4gzqKMr2cdkxqv/OXNFm5JbNOn6cdZ6WG85HiBD rkWbFo7BMCzXIxNAfN7AQ9/9tlpG4Zd2vWwp3Ke10nRos5ejQSj93fZgj1/cJAVnjUeG MrEg== X-Gm-Message-State: ALoCoQn75ymhnAKqnpIxqP9EG0/8VcXai33RpL6IxjrwdcNgojlcVZNt0Q+Om5mfgBO0D9OgbxWB MIME-Version: 1.0 X-Received: by 10.236.53.130 with SMTP id g2mr16105725yhc.23.1431822013080; Sat, 16 May 2015 17:20:13 -0700 (PDT) Received: by 10.129.108.75 with HTTP; Sat, 16 May 2015 17:20:13 -0700 (PDT) X-Originating-IP: [89.242.229.174] In-Reply-To: References: Date: Sun, 17 May 2015 00:20:13 +0000 Message-ID: To: Xinchen Hui Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Bug #69640 Unhandled EngineExceptions thrown from userland do not produce any output From: danack@basereality.com (Dan Ackroyd) On 15 May 2015 at 14:38, Xinchen Hui wrote: > I'd prefer to > disallow initializing a engine exception from user land.. > like if you try to initialize a engine/type/parser exception, an E_ERROR of: > what do you think? Someone reminded me that TypeExceptions are almost certainly going to be re-used by users for the cases where PHP's type system isn't powerful enough to handle their use cases: function handleFooOrBar($instance) { if(!$instance instanceof Bar && !$lol instanceof Foo) { throw new TypeException('$instance must be either an instance of Bar or Foo'); } ... } Re-using the built-in TypeException for this would be the right thing to do and so it needs to be creatable in userland. cheers Dan