Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60869 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56184 invoked from network); 17 Jun 2012 19:06:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2012 19:06:30 -0000 Authentication-Results: pb1.pair.com header.from=karoly@negyesi.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=karoly@negyesi.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain negyesi.net from 209.85.216.170 cause and error) X-PHP-List-Original-Sender: karoly@negyesi.net X-Host-Fingerprint: 209.85.216.170 mail-qc0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:50758] helo=mail-qc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/80-49496-5BA2EDF4 for ; Sun, 17 Jun 2012 15:06:29 -0400 Received: by qcmt36 with SMTP id t36so2961680qcm.29 for ; Sun, 17 Jun 2012 12:06:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=Xzib2YXH0N+dAjD4QK+0JM3EQGGmh4+KBqOZcAUEWPU=; b=Xt9OcjrVo793JXdFUM8m1YrgFaDH1NO5KFBPtOfCZDdNPBt1nPZwZ+afe6jIrhWZme U6oKTRA6vjdyeEv4JG5J1T+ajv2hIRffodX3W/2Yup3BmIZPiRq0jaguQ1qJWHuO3MSo N6usZbVpzkYnmIR7HGRb3AKIql9E2WtNiamca/Agkc9bWzwz3UYMuuKtQ8TfU1zT/Yhi hCOZWq7nMfoCmM88L2KhmPDSreIGb2SuGJ1RJ/l65rZt85sk6xio2127uJNqXez6sRm6 EbgwR1pl41JsCYmizO87lcWwNHtAOkBmj/VqkgVEmQsdYQsZXUMAAiTDbOD0hWFRcK+d vr+g== Received: by 10.224.117.129 with SMTP id r1mr23303316qaq.31.1339959985833; Sun, 17 Jun 2012 12:06:25 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id dq7sm36445997qab.0.2012.06.17.12.06.24 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jun 2012 12:06:25 -0700 (PDT) Received: by vbbfs19 with SMTP id fs19so2973353vbb.29 for ; Sun, 17 Jun 2012 12:06:24 -0700 (PDT) Received: by 10.52.92.129 with SMTP id cm1mr5219872vdb.126.1339959984267; Sun, 17 Jun 2012 12:06:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.21.84 with HTTP; Sun, 17 Jun 2012 12:06:03 -0700 (PDT) Date: Sun, 17 Jun 2012 12:06:03 -0700 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlwfbp54rRdb8olkVaoe18IltQEXfDXCI73ghRdjc0KMK6G34iHsVDp235ykVHYG/DPZITm Subject: How hard should PHP try to finish a script? From: karoly@negyesi.net (Karoly Negyesi) Hi, PHP often throws fatal errors when it could throw an exception. Take PHP Fatal error: Non-abstract method foo::bar() must contain body this error for example. It would be possible to mark this class as 'invalid' instead and when doing a new foo , throw an exception. Or if you try really hard then only the method call should throw an exception. Or, I was extending ReflectionClass and got Fatal error: ReflectionClass::getFileName(): Internal error: Failed to retrieve the reflection object (same happens if you try serialzie / unserialzie on ReflectionClass as a comment in the manual points out). I could argue this is an exception and not a fatal. Let me quote documentation: Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted. I do not see the above or , indeed , most of fatals I see this sort of error. Sure, if a malloc call fails, the world has ended and it's time to die. Otherwise, could we just get an exception so that it can be handled ? Thanks Karoly "chx" Negyesi