Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27709 invoked by uid 1010); 10 Jun 2004 10:35:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 27685 invoked from network); 10 Jun 2004 10:35:02 -0000 Received: from unknown (HELO mailgate.mysql.com) (213.136.52.47) by pb1.pair.com with SMTP; 10 Jun 2004 10:35:02 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate.mysql.com (8.12.10/8.12.10) with ESMTP id i5AAYxHo009633; Thu, 10 Jun 2004 12:34:59 +0200 Received: from mail.mysql.com ([10.222.1.99]) by localhost (mailgate.mysql.com [10.222.1.98]) (amavisd-new, port 10026) with LMTP id 09625-01; Thu, 10 Jun 2004 12:34:59 +0200 (CEST) Received: from php.net (mailsend.mysql.com [10.100.1.123]) (authenticated bits=0) by mail.mysql.com (8.12.10/8.12.10) with ESMTP id i5AAYlQ6002079; Thu, 10 Jun 2004 12:34:48 +0200 Message-ID: <40C838DB.10301@php.net> Date: Thu, 10 Jun 2004 12:32:59 +0200 Reply-To: hartmut@php-groupies.de User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en, de MIME-Version: 1.0 To: dharana CC: internals@lists.php.net References: <40C5FA4A.20206@dharana.net> In-Reply-To: <40C5FA4A.20206@dharana.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailgate.mysql.com Subject: Re: [PHP-DEV] date('w') return type From: hartmut@php.net (Hartmut Holzgraefe) dharana wrote: > I know I can just cast to int, but is it ok to return an string for > things that can only be numbers? The date() and strftime() functions are expected to always return strings, no matter what the format string looks like. The same holds true for sprintf(), you wouldn't expect sprintf("%d", 42) to return an int, would you? -- Hartmut Holzgraefe