Re: ++ bug or unexpected behaviour

From: Date: Sat, 10 Jun 2000 15:50:46 +0000
Subject: Re: ++ bug or unexpected behaviour
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-20921@lists.php.net to get a copy of this message
On Sat, Jun 10, 2000 at 05:35:54PM +0200, waldschrott wrote: > I think "$t++" and "$t=$t+1" should produces the same results, shouldn´t > they? Only if t is an integer. If t is a string, it is only incremented when the last char is alphanumeric. See increment_string() in zend_operators.c for details. IIRC this is java style. > 1) This does not work as expected, $t is not converted to an integer, > although it does not contain any character. > <?php > $t=''; // $t=0; will help... $t = '0'; // will help too -Jade. -- =============================================================================== Jade Nicoletti Nicoletti Net Services Tel. 01 240 4774 Geschäftsleitung Postfach 2519 Fax 01 240 4775 System-Administration 8021 Zürich ============================================[ Weitere Infos: http://nns.ch/ ]==

« previous php.dev (#20921) next »