|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #282 decrement operator(--) not working for vars from URL
Submitted: 1998-04-17 12:45 UTC Modified: 1998-04-17 12:59 UTC
From: miko at cnt dot pl Assigned:
Status: Closed Package: Other
PHP Version: 3.0 Release Candidate 3 OS: Linux RH5.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 + 42 = ?
Subscribe to this entry?

 [1998-04-17 12:45 UTC] miko at cnt dot pl
My setup:
linux RH5.0
mysql-3.21.29 (compiled in mysql support)
no php3.ini file - defaults compiled in)

A "--" operator doesn't work when the variable is set in URL
(didn't tested POST method, only GET). At the same time, however,
the "++" operator works.

Script "decrtest.html"
echo "$a"; $a++; echo "$a"; $a++; echo "$a";
$a--; echo "$a";$a--;echo "$a";
$a++; echo "$a";$a++; echo "$a";

121012 (this is OK, the first $a=="" so it's not visible)

5677789 (BUG - no decrementing)

After uncommenting #$a=0:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-04-17 12:59 UTC] zeev
The reason is that $a is set to "5" and not 5 (type string and not integer), and the decrement operator isn't defined for strings (the increment operator is).
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 13:01:28 2024 UTC