Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77858 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85231 invoked from network); 10 Oct 2014 20:43:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2014 20:43:20 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:48847] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/D1-06615-8E448345 for ; Fri, 10 Oct 2014 16:43:20 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 4BD522400C7; Fri, 10 Oct 2014 16:43:17 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DbmVvikm9bxI; Fri, 10 Oct 2014 16:43:17 -0400 (EDT) Received: from oa-res-26-28.wireless.abdn.ac.uk (oa-res-26-28.wireless.abdn.ac.uk [137.50.26.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 7546924005D; Fri, 10 Oct 2014 16:43:14 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Fri, 10 Oct 2014 21:43:12 +0100 Cc: Nikita Popov , internals , Stas Malyshev Content-Transfer-Encoding: quoted-printable Message-ID: <95154665-832F-47B5-B7E8-087C6F9CCCA9@ajf.me> References: <543320AB.4070606@sugarcrm.com> To: Patrick Schaaf X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: ajf@ajf.me (Andrea Faulds) On 10 Oct 2014, at 13:31, Patrick Schaaf wrote: > I would love to be able to catch, at toplevel. with an error handler = or > otherwise, both the memory limits exceeded and time limit exceeded = cases. >=20 > These two safeguards, by themselves, are not instabilities, right? The > limits could be set a bit higher and everything would continue = normally, > right? Both are problematic. There=92s no *technical* reason to prevent catching the exceeding of the = time limit=85 but that means you can circumvent the time limit. That=92s = bad. Perhaps you could catch it and have a short window to output an = error and die, though? Memory limit catching *would* cause instability, though. That=92s an = error thrown during memory allocation. Things will break horribly if it = just returns NULL and carries on, because let=92s be realistic here, an = awful lot of code doesn=92t check for NULL return values. It=92ll lead = to a segfault. PHP must bail out immediately when this happens to = prevent segfaulting. -- Andrea Faulds http://ajf.me/