Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86188 invoked from network); 28 Apr 2012 04:27:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2012 04:27:57 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass 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.212.42 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:52795] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/22-06766-CC17B9F4 for ; Sat, 28 Apr 2012 00:27:56 -0400 Received: by vbjk13 with SMTP id k13so1164538vbj.29 for ; Fri, 27 Apr 2012 21:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=w8kKD5jx/yppqQqZxaMBlQ83mYLCvrteO8MDq/wtW8Y=; b=bJ+zrFw/uOhd0xtz+LxehGOEJHOWdQZxQEBPj/4RhenvPUcTKPATKgiiY6a4tt+eJR EIfQfW4tan8bpmQmL35N+QZJaPnnA+jwPvBDi2GdPcoHZdsLEQzCmpAcTx+HNAIOvipB 5mvvZf07Z4iGRWZd2/mhZFFhoq9gSeBjsBYxw91CYvhppQBRHND5ZUFm6FEsogjSCbRh +ytnQUgIWHD3GgMG8yjsjsjcPKwH9ThlIcn3yyxbTUI5J+5ESRvsBWEFh846Ov93TEFG yR8r+bn2l5caVKohWCp9P9xdrufy77oSiBnotnM5zLSw1mLDULnoNK55L5ylUQtzRBOL dXzg== MIME-Version: 1.0 Received: by 10.52.240.232 with SMTP id wd8mr11732913vdc.96.1335587273555; Fri, 27 Apr 2012 21:27:53 -0700 (PDT) Sender: kalle.php@gmail.com Received: by 10.220.1.136 with HTTP; Fri, 27 Apr 2012 21:27:53 -0700 (PDT) In-Reply-To: <4F9AFE3D.8010805@quis.cx> References: <4F9AFE3D.8010805@quis.cx> Date: Sat, 28 Apr 2012 06:27:53 +0200 X-Google-Sender-Auth: cmQKw4OP8HK6HYpWiT-cHFjZfo4 Message-ID: To: Jille Timmermans Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Function boolval() From: kalle@php.net (Kalle Sommer Nielsen) Hi 2012/4/27 Jille Timmermans : > Hi, > > I suggest we add a function boolval(). It simply converts the given argument > to a boolean, like strval(), intval() and floatval(). I already have an > implementation ready[1]. > > Why? > * It is missing in the current list of *val()-functions and people expect it > to exist. I'd say it is an inconsistency. > * It can be used as a callback, which is why a bool-cast does not suffice. Does it really matter nowadays when we got closures anyway: $bools = array_map(range('a', 'z'), function($a){ return((boolean) $a); }); -- regards, Kalle Sommer Nielsen kalle@php.net