Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34562 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 243 invoked by uid 1010); 6 Jan 2008 22:31:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 205 invoked from network); 6 Jan 2008 22:31:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2008 22:31:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.184 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 209.85.198.184 rv-out-0910.google.com Received: from [209.85.198.184] ([209.85.198.184:48232] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/4D-16968-0C651874 for ; Sun, 06 Jan 2008 17:31:34 -0500 Received: by rv-out-0910.google.com with SMTP id k15so5785089rvb.23 for ; Sun, 06 Jan 2008 14:30:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=dBM0eabfeC4LtauEknmMYudHyKroKsZAg4P5YVXdUd4=; b=XwlkL7z+P8wUg3vuxZckClClXYtplLeBDMyqnS/AruFxy9axUOEI26XHv4gGBz4YAkYxNgomxfhHl2BzDjIdiCP0VLzYxg7dtzo3tPSfKx57v+UGAxpkxemrcoU1GJaLXyUkux2qyUchhhljPcGuzVNrQcIK/q51/B8cN7Qbkxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Dc77AuPMcnMbSAjUrcsnMS50P3na4NoEPlYAHXd1DUq2jSi3HG4NWL6smHqJ/4Eh7r8vp+grQhht6/2m0jcrbn26wV3C59/Tn3VDgfiWFVboli3DEXq+5+XL9ob+RrxPt95DdRyqoJ3dFIOS0LLgVwbeRMYpjLP2cecxP1Z92HI= Received: by 10.142.89.9 with SMTP id m9mr3616285wfb.35.1199658648536; Sun, 06 Jan 2008 14:30:48 -0800 (PST) Received: by 10.142.192.6 with HTTP; Sun, 6 Jan 2008 14:30:48 -0800 (PST) Message-ID: <7f3ed2c30801061430o25c1a01ua1f489a5e141598a@mail.gmail.com> Date: Sun, 6 Jan 2008 23:30:48 +0100 To: "Markus Fischer" Cc: "php-dev List" In-Reply-To: <478138AA.4050101@fischer.name> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47812E04.3070705@fischer.name> <7f3ed2c30801061204h2c1cf64dwb3a2e207e89e0f9b@mail.gmail.com> <478138AA.4050101@fischer.name> Subject: Re: [PHP-DEV] Source type.c says settype($var, "double") is deprecated From: hannes.magnusson@gmail.com ("Hannes Magnusson") On Jan 6, 2008 9:23 PM, Markus Fischer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > Hannes Magnusson wrote: > | No, the comment is correct. > | > | "for historical [read: BC] reasons "double" is returned in case of a > | float, and not simply "float"" > | > | See http://docs.php.net/settype && http://docs.php.net/gettype > > Thanks for the pointers, but I don't quite understand what "deprecate" > now means. It means that maybe someday it will be removed. Unlikely? Sure, but the preferred name is 'float' so why not use it? > Doing gettype(1.5) returns "double". There's not way that gettype() > returns "float". Right. Due to historical reasons this functions returns 'double'. Just like for historical reasons implode() can take its argument in either order. > I don't see the implications of this "deprecation" here. What does it > say? The comment in the sourceis there since around 2002 or so. But > there aren't plans to change the behavior or gettype(), are there? It means that in PHP the type name is 'float' and referred to as 'float' throughout the manual For convenience you can use "double" (is_double($f), (double)$f, settype($f, "double")..), just like you can use is_integer() instead of is_int()... :) -Hannes