Bug #15003 Updated: problem with range() function

From: Date: Fri, 11 Jan 2002 23:09:27 +0000
Subject: Bug #15003 Updated: problem with range() function
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76713@lists.php.net to get a copy of this message
ID: 15003 Updated by: rasmus Reported By: jolt@mail.contactdesigns.com Old Status: Open Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux 2.4 PHP Version: 4.1.1 New Comment: Not a bug. settype() returns true/false. In your case it returned true in both cases so your range was actually range(1,1) which doesn't make much sense. If you want to cast arguments use (int)$var inside that call. Previous Comments: ------------------------------------------------------------------------ [2002-01-11 18:03:41] jolt@mail.contactdesigns.com problem with range() function: $test = range(settype($seats[1], 'integer'), settype($seats[2], 'integer')); First argument equals 1 second equals 25 confirmed by this var_dump: [1]=> int(1) [2]=> int(25) var_dump($test) returns: array(1) { [0]=> int(1) } PHP configure setup: ./configure --with-mysql=/usr/local/mysql --with-zlib --with-apache=../$apache --enable-track-vars --with-config-file=$target/conf ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=15003&edit=1

« previous php.dev (#76713) next »