Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75555 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5170 invoked from network); 15 Jul 2014 17:41:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2014 17:41:15 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:47351] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/B4-15121-9B765C35 for ; Tue, 15 Jul 2014 13:41:14 -0400 Received: by mail-wi0-f176.google.com with SMTP id bs8so4832876wib.9 for ; Tue, 15 Jul 2014 10:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=J665e71OLD6cJlmbxvPa39HKE+V8s/AhTucA9R6mA3w=; b=l5ULEcLMXnrYQyvGuH81OWrxqrgZsZaNNor8eVos00/JbCwgs5BHFp/hr4occEeRqk UbFd4+7IGwOA0VdgQxPl8Kn9TXtRQnFmSN2o8A/ekT7MwPOp8/xoF3/segpXD35O3vY2 P4nOZgAPwiEUFOyve5qoBtryuvUtiU64NOWJoYQSqR0/ivJbDB6krYWMcDrvvHyz7L++ 8v0xF+u0r5RrnWZe/daPeWO7GE8SavDcLzO/plJMMPPdowXhnPUeIFIvzJ32lUChSGGj ItWDHYM3HsWQekprB/XSFN69QxzzxJcL7B0xvHDa6hUaurMf67nVqm6FiVfcUSrw1MGf pjcw== X-Received: by 10.180.98.130 with SMTP id ei2mr7287300wib.24.1405446071422; Tue, 15 Jul 2014 10:41:11 -0700 (PDT) Received: from [192.168.0.139] ([62.189.198.114]) by mx.google.com with ESMTPSA id ch5sm34011321wjb.18.2014.07.15.10.41.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jul 2014 10:41:10 -0700 (PDT) Message-ID: <53C5673D.8030201@gmail.com> Date: Tue, 15 Jul 2014 18:39:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <16D48604-0C0A-4613-91A4-21392E3A2636@ajf.me> <53C3DB42.7090205@gmail.com> <3158105795AAC1408619EC8BA03384A93D0214F5@EXC-PUB01A.leedsmet.ac.uk> In-Reply-To: <3158105795AAC1408619EC8BA03384A93D0214F5@EXC-PUB01A.leedsmet.ac.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: rowan.collins@gmail.com (Rowan Collins) Ford, Mike wrote (on 15/07/2014): > Oh, goodness, deary me -- this sounded so familiar I just had to do some delving and hey presto! I refer you to:http://marc.info/?l=php-internals&m=124655821522388 > > (...which, interestingly, even predates Zeev's 2010 claim, and I believe may have taken inspiration from yet earlier suggestions back around 2006!!) Ooh, skimming that, I see suggestions for prefixes and suffixes to represent types of cast (or hint). That fits nicely with my thoughts on making "strict cast" a first-class citizen of the language, rather than isolating it to function signatures, e.g.: $foo = 'abc'; $foo = (int)$foo; // OK, evaluates to int(0) $foo = 'abc'; $foo = (int!)$foo; // ERROR $foo = '42'; $foo = (int!)$foo; // OK, evaluates to int(42)