php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #28223 unary minus operator is not documented
Submitted: 2004-04-29 22:49 UTC Modified: 2004-07-27 23:31 UTC
From: krenya at inf dot bme dot hu Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.6 OS: any
Private report: No CVE-ID: None
 [2004-04-29 22:49 UTC] krenya at inf dot bme dot hu
Description:
------------
"Table 10-1. Operator Precedence" and "Table 10-2. Arithmetic Operators" tables do not include the "unary minus" operator although it exists in php.

Please add itt to the two table above.

Thanx

Reproduce code:
---------------
<?
$a = 1;
$a = -$a;
echo $a;
?>

Expected result:
----------------
PARSE error as there's no unary minus operator according to the docs

Actual result:
--------------
ouputs "-1"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-27 23:31 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Thanks for a bit of fun with

Expected result:
----------------
PARSE error as there's no unary minus operator according to the docs
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Nov 20 11:00:02 2025 UTC