Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33484 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23348 invoked by uid 1010); 28 Nov 2007 11:38:15 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23333 invoked from network); 28 Nov 2007 11:38:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2007 11:38:15 -0000 Authentication-Results: pb1.pair.com header.from=marco.kaiser@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=marco.kaiser@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.186 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: marco.kaiser@gmail.com X-Host-Fingerprint: 64.233.182.186 nf-out-0910.google.com Received: from [64.233.182.186] ([64.233.182.186:34373] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/05-08781-4235D474 for ; Wed, 28 Nov 2007 06:38:15 -0500 Received: by nf-out-0910.google.com with SMTP id e27so1165681nfd for ; Wed, 28 Nov 2007 03:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references:in-reply-to:subject:date:mime-version:content-type:content-transfer-encoding:x-mailer:thread-index:content-language:message-id; bh=SlDLknX+kkC5Aoygezka2mjazTgsPYEPX1C/krbFw4U=; b=vrYFEfyEs1nGV1q1SBrIO+wGejnjxtk1l77V9ep6yZnS/40z5bHNZPFb7iieY7Cvb6BV8+LpM3k9wHfPNpbyP6YuNQGDyq68cuy005qbmCzL+5aPZp0N9KTgiPVMVnhKZJ5pxsIFcM8UJXPRLpAm9mbnHY1heaN+ue1UbiGxVIQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:from:to:references:in-reply-to:subject:date:mime-version:content-type:content-transfer-encoding:x-mailer:thread-index:content-language:message-id; b=WFNmm/VH7RGxVjMaks6aBzUm/aSqC4DBD2s9wqI/t8u9P6iprDG7HaWylksOlXSs1uT5s7+eaAuVHmQYE/yVqsc/2ZF3wJvRLVqqhmn8+nhfGiN8QujkcVnLtkgbCcDTQZ9Xi0QKAzPchQ536flWy3o1DHBeuOnfgfYng09uCM0= Received: by 10.86.84.5 with SMTP id h5mr4883978fgb.1196249889278; Wed, 28 Nov 2007 03:38:09 -0800 (PST) Received: from think ( [217.7.237.75]) by mx.google.com with ESMTPS id 13sm6114509fks.2007.11.28.03.38.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Nov 2007 03:38:08 -0800 (PST) To: "'Dirk Thomas / 4wd media'" , References: <46.93.08781.F374D474@pb1.pair.com> In-Reply-To: <46.93.08781.F374D474@pb1.pair.com> Date: Wed, 28 Nov 2007 12:33:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcgxrDTMOx9cr/zMRUyYsnjmU+l/MAABKfCg Content-Language: de Message-ID: <474d5320.0d135e0a.43d0.ffffd2b3@mx.google.com> Subject: RE: [PHP-DEV] question regarding type hinting parameters of php functions (array_slice) From: marco.kaiser@gmail.com ("Marco Kaiser") Hi Dirk, > When calling > "array_slice($array, 0, (float)2);" > the resulting array is EMPTY. > When using the right type > "array_slice($array, 0, (int)2);" > it works as expected. i think this should print a warning like other array functions. But i looked into the src and this looks more like a casting bug inside this function. $input = array('a', 'b', 'c', 'd', 'e'); var_dump(array_slice($input, 1, "1")); var_dump(array_slice($input, 1, 1)); var_dump(array_slice($input, 1, (FLOAT)1)); var_dump(array_slice($input, 1, 1.0)); output: array(1) { [0]=> string(1) "b" } array(1) { [0]=> string(1) "b" } array(0) { } array(0) { } So i think the float value isnt correct casted as int value here. Maybe someone else can proof this. -- Marco