|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-05-01 12:21 UTC] helly@php.net
[2003-05-01 12:22 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 21:00:01 2025 UTC |
Through many frustrating hours, I think found a bug. The current session documentation offers this example for setting session variables using the $_SESSION array: if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } This example, of course, works. However, it is common knowledge the the ternary operator can achieve the same results in one line: $_SESSION['count'] = (!isset($_SESSION['count']))?0:$_SESSION['count']++; However, this does not work. The session variable always seems to not be set, as it always retains the value of 0 instead of being incremented.