Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63965 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93171 invoked from network); 19 Nov 2012 04:09:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2012 04:09:08 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 173.203.6.131 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 173.203.6.131 smtp131.ord.emailsrvr.com Linux 2.6 Received: from [173.203.6.131] ([173.203.6.131:48530] helo=smtp131.ord.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/D0-18536-3E0B9A05 for ; Sun, 18 Nov 2012 23:09:08 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp29.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id 4A9F910809A; Sun, 18 Nov 2012 23:09:05 -0500 (EST) X-Virus-Scanned: OK Received: by smtp29.relay.ord1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id EDBC0108090; Sun, 18 Nov 2012 23:09:04 -0500 (EST) Message-ID: <50A9B0E0.7040508@sugarcrm.com> Date: Sun, 18 Nov 2012 20:09:04 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Functions for getting long / double from zval with casts From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Hi internals! > > It happens quite often that you need to extract an integer from a zval and > you also want it to work for integers in strings, etc. In order to do so > you currently have to cast the zval to integer. This is always rather > complicated because you often don't want to actually change the passed Where it happens quite often outside of function arguments (where it is covered by parameter parsing APIs)? Should it handle all conversions the engine performs or only from string? We could probably expose zendi_convert_to_long() and similar ones, but I'm not sure what the use case for these would be. Could you give more background on this? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227