Re: CVS update: php3/doc/chapters

From: Date: Mon, 07 Dec 1998 23:00:44 +0000
Subject: Re: CVS update: php3/doc/chapters
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-2707@lists.php.net to get a copy of this message
eschmid writes: > Date: Monday December 7, 1998 @ 17:24 > Author: eschmid > > Update of /repository/php3/doc/chapters > In directory asf:/u/temp/cvs-serv8842 > > Modified Files: > lang-syntax.sgml > Log Message: > I have found, that some doubles are actually integers, > can someone prove this and delete the ambigious lines > in this two examples? You appear to be right. Apparently the string->number conversion stuff no longer works like strtod(). For instance: <?php $foo = 5 + "10.5"; echo "Value of \$foo: $foo; type of \$foo: ".gettype( $foo )."\n"; $foo = 5 + "10.5 "; echo "Value of \$foo: $foo; type of \$foo: ".gettype( $foo )."\n"; ?> The ouput of the above is: Value of $foo: 15.5; type of $foo: double Value of $foo: 15; type of $foo: integer It's _far_ more picky about what sorts of strings will be converted to doubles. Does anybody have a spec for the new (er...since May) behaviour? I haven't had a chance to look too closely at operators.c yet today... Torben -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2707) next »