Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69656 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27171 invoked from network); 17 Oct 2013 19:25:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 19:25:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.46 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.46 mail-oa0-f46.google.com Received: from [209.85.219.46] ([209.85.219.46:39638] helo=mail-oa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/C7-12663-9B930625 for ; Thu, 17 Oct 2013 15:25:46 -0400 Received: by mail-oa0-f46.google.com with SMTP id g12so2050244oah.19 for ; Thu, 17 Oct 2013 12:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xuphDZtfu8v3j8q0pA8KeCr2+GmM7xSXUFC0rfz6feg=; b=RZ5MQDrtQJpdwriBFVMr6sr9QO9DoTbwhmk8TbBgf4rEtQuDdyI5zf+kpzPogM8M7k +dEOW7Lnhyzb8Vz22pFefHgS9IYNmtXJsmCpu5Z7cXRqCkgBBs04CYriT80QimB7VUmk 2Jpi3ijVQDO4pvxpF3FY/2dnJdbTu+r9ogJuB7Ux1t+oyWGxQb7XKRCE0roKi5PBoeoP nB8tTrTXA5ZLExACKqhA7v399kOUuCBaTLljTw8WMUdBvUjg7CvxIzcJRC5YgmMg9Vs+ nBQqQdhC9/47NY6879W4Pq8ML2DURqMaFG6dxyO9+F4wzXINuSbH/lBe0vfPj66QJIg6 hHFg== MIME-Version: 1.0 X-Received: by 10.182.250.163 with SMTP id zd3mr16489530obc.20.1382037942831; Thu, 17 Oct 2013 12:25:42 -0700 (PDT) Received: by 10.182.54.112 with HTTP; Thu, 17 Oct 2013 12:25:42 -0700 (PDT) In-Reply-To: References: <525FC834.4060501@php.net> <1534105.bNC2os93J1@rofl> <525FDAC3.6060103@php.net> <526023DF.6080203@ajf.me> Date: Thu, 17 Oct 2013 21:25:42 +0200 Message-ID: To: J David Cc: Andrea Faulds , PHP internals Content-Type: multipart/alternative; boundary=089e01634ec2a60f8504e8f4c8c5 Subject: Re: [PHP-DEV] Assertions From: nikita.ppv@gmail.com (Nikita Popov) --089e01634ec2a60f8504e8f4c8c5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Thu, Oct 17, 2013 at 8:16 PM, J David wrote: > On Thu, Oct 17, 2013 at 1:52 PM, Andrea Faulds wrote: > > In addition to all that you've said, I should point out that both Java > and > > Python have an assert statement which raises an exception, which happen= s > to > > be called AssertionError in both languages. > > And in Python you can subclass an int. This does not make that a good > idea for PHP. (Java only wishes it could subclass int, hence > Integer.) > > In Java, for better or for worse, every error is an exception. This > does not make that a good idea for PHP. > > (Shrill voice) "If all your friends jumped off a bridge=85" > Well, I'd ask myself *why* they all jumped. Since they are not dumb, there's likely a good reason for it. Maybe it's a wooden bridge and it's on fire? In that case, sure, I'd jump right after them ;) > Should require($myFile) throw an exception too? (Some people, perhaps > many, would say yes.) What about parse errors in a file include()d at > runtime? > Yes, require() should throw an exception from a modern point of view. It doesn't, because it was introduced at a time where we had no exceptions. Parse errors should theoretically also be exceptions, but with the current compiler this is simply technically infeasible. Actually "technical infeasibility" is the only sane reason I can think of to throw a fatal error. Anyway, I won't continue this pointless discussion, doesn't seem like we're getting anywhere with it. Nikita --089e01634ec2a60f8504e8f4c8c5--