Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32842 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63669 invoked by uid 1010); 18 Oct 2007 05:13:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63654 invoked from network); 18 Oct 2007 05:13:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Oct 2007 05:13:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.82.224 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 66.249.82.224 wx-out-0506.google.com Received: from [66.249.82.224] ([66.249.82.224:44489] helo=wx-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/D4-19466-19BE6174 for ; Thu, 18 Oct 2007 01:13:54 -0400 Received: by wx-out-0506.google.com with SMTP id s14so102066wxc for ; Wed, 17 Oct 2007 22:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; 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=NjrlnjHVmaXGWcle73mdyHB9OjelZZQdYc9d+OGhXVQ=; b=UyuflNpkRIZJ6/4miFX3nZTwar3x7AkofKHnze3hqapvHsMcue6jNvh4yF/ss68fF1LkCXOBkXkrs3g/pIKjXXWuu7cyujVLlEdFbVoK8Jp+M3+ROFNw/9g24fGy5q2bmefwXBTeWQa50ka1PJllyk2VqSDDfBBBpLku3yPvzgE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=d2TFeTHL0MwTPUQq7Do/DzCz1tvEx1FqiM1YI9JUsdV5jEfgtOurPNrmVjxAsaaHjjEQfQQywswHPHLjQRY73K34ihKZx6J04dG0hqpLFxBJ6unTZbaO3nMaCnClXcYIzJ8mfo+lIZ48Ys6EzKn9ImoBXCvnZy5g0x5t5SNxso8= Received: by 10.90.102.20 with SMTP id z20mr302642agb.1192684431518; Wed, 17 Oct 2007 22:13:51 -0700 (PDT) Received: by 10.90.91.16 with HTTP; Wed, 17 Oct 2007 22:13:51 -0700 (PDT) Message-ID: Date: Thu, 18 Oct 2007 09:13:51 +0400 To: "Stanislav Malyshev" Cc: "Rob Richards" , internals@lists.php.net In-Reply-To: <47169656.9090708@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <470D0DD8.7080100@ctindustries.net> <47169656.9090708@zend.com> Subject: Re: [PHP-DEV] Object arithmetic From: indeyets@gmail.com ("Alexey Zakhlestin") On 10/18/07, Stanislav Malyshev wrote: > > While looking at bug 42780: http://bugs.php.net/bug.php?id=42780 > > The only way not to lose precision is to explicitly cast the object to > > float or string, which just doesn't seem right to me. > > I'm not sure how this can be fixed - there should be some type used and > many objects won't provide convertor to float... Anyway, it's probably > not the best idea to rely on default conversion in this context - better > to specify it. In this case, the proper solution is to force SimpleXML to cast values to strings, because, after all, XML has nothing but strings. Then engine would be able to cast the value further to float (as the last example in bug shows) -- Alexey Zakhlestin http://blog.milkfarmsoft.com/