Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85762 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86002 invoked from network); 9 Apr 2015 23:32:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2015 23:32:28 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.216.42 mail-vn0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:33395] helo=mail-vn0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/A2-03620-B0C07255 for ; Thu, 09 Apr 2015 19:32:28 -0400 Received: by vnbf1 with SMTP id f1so717111vnb.0 for ; Thu, 09 Apr 2015 16:32:24 -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=34fcRqMJg9rSTHPIosMQmknvNuFqlrKLIs7UGi/25L8=; b=Imqx5GArB/pGLIoztPOJcpKMkIbJKeGLteFg792gEH9qlAMTXkgpPWudxt+coso3ZS uMFc4+jpOc9K+V9gLODF8bzzfY3XgwC+HAKTCDXFvV6t/rHFi/SI1j1+gghrdJZuidnG nEHqqLcuM27385ipOAqaNI18SGSvbgLt4EMJZFDhL/sZ2X7wCTRkWh3x7FoAgYFXQUkF DDLuyfWiiyI+lZ7g/YL2QAxhsxNsYjj8js94pSHsVpdD2SMlMAhqFTckItlmxnr3of2e 3DrLo9dc3nfbve+FSjXUjqS2+M7B5Qioe1qImnGQhmginPTtFRpWwrd715MlIu5Hk1i+ JXXg== X-Gm-Message-State: ALoCoQnIBoD/oRNHffL4k7yJ1b5CBAmx5hKq6Zud5i/HPrA9rAwUeDhXAOep7RfLZ9EzebNTGEgCjSqVgUwMCj3laEy5DfFBwwQATuKmDrXwTgy0AA9yEJksHQSU5U2RaMNexaUwDhiY0iPdwEvp/6+PuwFVgyVfGw== MIME-Version: 1.0 X-Received: by 10.52.137.235 with SMTP id ql11mr25686963vdb.49.1428622344706; Thu, 09 Apr 2015 16:32:24 -0700 (PDT) Received: by 10.52.248.36 with HTTP; Thu, 9 Apr 2015 16:32:24 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Apr 2015 02:32:24 +0300 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary=bcaec51b9a515ff4b40513530fa8 Subject: Re: [PHP-DEV] Exception message cleanup From: dmitry@zend.com (Dmitry Stogov) --bcaec51b9a515ff4b40513530fa8 Content-Type: text/plain; charset=UTF-8 On Thu, Apr 9, 2015 at 11:04 AM, Nikita Popov wrote: > Hi internals! > > A lot of people have been confused about engine exceptions currently > displaying as normal fatal errors (if they aren't caught). We'll have to > change this to use exception messages. > > Before doing this I'd like to clean up the messages a bit to make them more > friendly for CLI usage. Currently the messages are so cluttered that it's > hard to find the actual error message if you're in an 80 char window. > > Patch is here: https://github.com/php/php-src/pull/1226 > > Previous message: > > Fatal error: Uncaught exception 'UnexpectedValueException' with message > 'Failed to open directory ""' in %s:%d > Stack trace: > #0 %s(%d): DirectoryIterator->__construct('\x00/abc') > #1 {main} > thrown in %s on line %d > > New message: > > UnexpectedValueException: Failed to open directory "" in %s on line %d > Stack trace: > #0 %s(%d): DirectoryIterator->__construct('\x00/abc') > #1 {main} > > Essentially exceptions would display like ordinary error, but with "Fatal > error" / "Warning" / ... replaced by the exception name, and showing a > stack trace after the error. > > A side-effect of the change is that uncaught exceptions will always be > displayed canonically and not based on __toString output. To modify display > of exception output, people should modify the respective properties of the > exception. > > Any objections to this? > We will have to change half of PHPT tests. New tests with fatal errors are going to be incompatible between PHP-5 and PHP-7. Log analysers written for PHP-5 won't work with PHP-7. Thanks. Dmitry. > > Thanks, > Nikita > --bcaec51b9a515ff4b40513530fa8--