Re: ++ bug or unexpected behaviour

From: Date: Sat, 10 Jun 2000 15:58:26 +0000
Subject: Re: ++ bug or unexpected behaviour
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-20924@lists.php.net to get a copy of this message
sorry.. i have to correct myself. integers and doubles: $t = $t + 1; null: $t = 1; strings: see the mentioned function (and it is perl style, not java style) On Sat, Jun 10, 2000 at 05:50:46PM +0200, Jade Nicoletti wrote: > 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/ ]== > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- =============================================================================== 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 (#20924) next »