note 45076 added to language.operators.increment
| From: | timo at frenay dot net | Date: | Wed, 25 Aug 2004 15:45:52 +0000 |
| Subject: | note 45076 added to language.operators.increment | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75244@lists.php.net to get a copy of this message | ||
JMcCarthy AT CitiStreet DOT com:
As for your March 31 post, at least in PHP version 4.3 this no longer holds for 'D'. Your
point is still valid for 'e' or 'E' and worth noting.
Your comment from May 12 is simply not true, although it might be a bug in your specific version of
PHP but that would seem very strange.
<?php
$Align = array('a', 'b', 'c');
$i = 0;
echo $Align[$i++]; // Prints 'a', as expected
?>
It might be interesting to know that pre-/postincrement assumes a value of 0 for undefined
variables, but pre-/postdecrement does not:
<?php
echo var_dump(++$foo); // int(1)
echo var_dump(--$bar); // NULL!
?>
----
Manual Page -- http://www.php.net/manual/en/language.operators.increment.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45076
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45076&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45076&report=yes
Search -- http://master.php.net/manage/user-notes.php