Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60337 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46070 invoked from network); 27 Apr 2012 20:14:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Apr 2012 20:14:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=jille@quis.cx; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jille@quis.cx; sender-id=unknown Received-SPF: error (pb1.pair.com: domain quis.cx from 85.223.64.10 cause and error) X-PHP-List-Original-Sender: jille@quis.cx X-Host-Fingerprint: 85.223.64.10 10-64-223.ftth.xms.internl.net Received: from [85.223.64.10] ([85.223.64.10:16607] helo=istud.quis.cx) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/15-16466-14EFA9F4 for ; Fri, 27 Apr 2012 16:14:58 -0400 Received: from boom-ubuntu.quis.cx (vhe-430065.sshn.net [195.169.212.153]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by istud.quis.cx (Postfix) with ESMTPSA id 2BB9110C4A for ; Fri, 27 Apr 2012 22:14:54 +0200 (CEST) Message-ID: <4F9AFE3D.8010805@quis.cx> Date: Fri, 27 Apr 2012 22:14:53 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Function boolval() From: jille@quis.cx (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. -- Jille [1] https://github.com/php/php-src/pull/60