php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67211 operator --
Submitted: 2014-05-06 07:10 UTC Modified: 2014-05-06 08:26 UTC
From: dark9 at rune dot ws Assigned:
Status: Suspended Package: Variables related
PHP Version: 5.5.12 OS: osx 10.9.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dark9 at rune dot ws
New email:
PHP Version: OS:

 

 [2014-05-06 07:10 UTC] dark9 at rune dot ws
Description:
------------
run $a-=1;
result is $a=-1;
this is ok.


but run $a--;
result is $a=null;

but expected result should be $a=-1;

Test script:
---------------
<?php
$a--;
var_dump($a);


Expected result:
----------------
int(-1)

Actual result:
--------------
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-06 08:26 UTC] requinix@php.net
-Status: Open +Status: Suspended
 [2014-05-06 08:26 UTC] requinix@php.net
I'll go out on a limb and mark this as "suspended", pending an RFC:
https://wiki.php.net/rfc/normalize_inc_dec
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC