php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71578 object, mixed and numeric are not reserved words
Submitted: 2016-02-12 17:32 UTC Modified: 2016-02-24 14:13 UTC
From: david at grudl dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2016-02-12 17:32 UTC] david at grudl dot com
Description:
------------
Words *object, mixed, numeric* are listed as reserved word in documentation http://php.net/manual/en/reserved.other-reserved-words.php, but they are not reserved https://github.com/php/php-src/blob/d1b777bd992525ced913a033bd7fff9490614f52/Zend/zend_compile.c#L151


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-12 17:33 UTC] david at grudl dot com
And *resource* too
 [2016-02-12 19:32 UTC] bwoebi@php.net
-Type: Bug +Type: Documentation Problem
 [2016-02-12 19:32 UTC] bwoebi@php.net
They are reserved, but not prohibited from usage.

The emphasis is on *reserved*; that it is strongly advised to not use them, as it is not that unlikely that future code will prohibit its usage.
 [2016-02-12 21:16 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-02-12 21:16 UTC] cmb@php.net
The documentation already states:

| Some of the words are reserved to enable future PHP features
| without breaking backward compatibility.

So this is "not a bug".
 [2016-02-12 22:06 UTC] bwoebi@php.net
-Status: Not a bug +Status: Re-Opened
 [2016-02-12 22:06 UTC] bwoebi@php.net
It still is badly worded. Reading the whole:

> These words cannot be used to name a class, interface or a trait. These words are also prohibited from being used in namespaces. Some of the words are reserved to enable future PHP features without breaking backward compatibility.

It suggests that none of these words can be used currently, just that some of them don't have any use yet. It doesn't say that some of these can still be used, but is just not advised.
 [2016-02-21 23:00 UTC] tpunt@php.net
What about splitting the list into actual reserved words and soft reserved words?

Patch diff: https://gist.github.com/tpunt/906fe83e8d91dd75eaed
 [2016-02-22 10:42 UTC] cmb@php.net
That might be best, Thomas, even though we'll have to keep an eye
on changes to come. If there are no objections, I'll commit that
in a few days. BTW: `mixed` and `numeric` are also soft reserved
words.
 [2016-02-24 14:10 UTC] tpunt@php.net
Automatic comment from SVN on behalf of tpunt
Revision: http://svn.php.net/viewvc/?view=revision&revision=338660
Log: Resolve doc bug #71578
 [2016-02-24 14:12 UTC] tpunt@php.net
The patch did place `mixed` and `numeric` in the soft reservations - the svn diff just redacted it :) In any case, no concerns were raised so I've committed this now. Thanks.
 [2016-02-24 14:13 UTC] tpunt@php.net
-Status: Re-Opened +Status: Closed
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 23:00:02 2026 UTC