Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49172 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18289 invoked from network); 29 Jul 2010 15:19:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2010 15:19:04 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:36228] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/99-06514-6EB915C4 for ; Thu, 29 Jul 2010 11:19:02 -0400 Received: by gyh4 with SMTP id 4so179381gyh.29 for ; Thu, 29 Jul 2010 08:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=dzhJGNL4M7X2jgDWqzkZIiY89Q6Y7ucM2kdmDy2QLD0=; b=hOMbFNxstNsVPbkjp94+v+wp68SKzB5ZEIe/W8z5K+qaiYEFSWBPuaxLWMczyZLX8J AIW8p5H+MWXh86GSk2yzYLyV4ERz9qDJisS5UF7S/0gHzhMzRNVYnoJQ/vObYgwR2mmO o1lOMF8pvOBAgfRnZr7iNp1JqLRMbyOCEGZfI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ajTPtufJbZK+K3vIwk5IIQ70xoziQ9yxfHij9SS7ko2hHm0p0VkXqKA3ZkxGZSqV2a C8wBs2uQ1iCFRnCUQPf/17HmOWPyanEBmK4PqZA5FApMm/nqxI/K1EsGwHYwNICTgNDd xPOMV9ak0bSkTJeQJR8HbsWfVa3TkA9dXsnCc= MIME-Version: 1.0 Received: by 10.90.102.7 with SMTP id z7mr834556agb.107.1280416739545; Thu, 29 Jul 2010 08:18:59 -0700 (PDT) Sender: kalle.php@gmail.com Received: by 10.42.1.80 with HTTP; Thu, 29 Jul 2010 08:18:59 -0700 (PDT) In-Reply-To: <7.0.1.0.2.20100729151449.0f884440@zend.com> References: <7.0.1.0.2.20100729151449.0f884440@zend.com> Date: Thu, 29 Jul 2010 17:18:59 +0200 X-Google-Sender-Auth: i56iVyUO6-asOZfxdwQ5lsbyXkc Message-ID: To: Zeev Suraski Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Re: [PHP-DEV] Type hinting From: kalle@php.net (Kalle Sommer Nielsen) Hello Zeev 2010/7/29 Zeev Suraski : > With the revived interest in the neighbourhood of type hints in the last few > days I'm resending this email from a few weeks ago. > > In a nutshell, use auto-conversion for scalar type hints, and modify the > conversion rules throughout PHP to handle 'senseless' conversions that > result in data loss differently - by emitting E_TYPE. > > Zeev Ill be very much against adding a new error level for typing, E_NOTICE or E_WARNING should be *enough* for letting the user know of any data loss. I don't think it would be a good idea for adding a new error level for specific language features, if we went to use exceptions for everything it would however have been a sleek solution but we don't. As for which solution we should take, we need a userland vote and a core vote foreach of the 3 solutions we have atm.: * Strict typehinting (as whats currently in trunk) * Weak typehinting (with silent autoconvertion) * Weak typehinting (that emits warnings/notices/type warnings) It would be nice to have such a vote so the coming RM's also have control over which solution is preferered and eventually why its preferered. -- regards, Kalle Sommer Nielsen kalle@php.net