php/php-langspec

Null-Coalescing Assignment Operator is Missing

Closed this issue · 4 comments

I'm in the early stages of writing a PHP parser and while I was looking through the language specification here I noticed that ??=, the null-coalescing assignment operator, is absent from the specification.

As you can see on the RFC page, a patch with a working implementation of the language change was approved to be merged in April of 2016 by a 37-4 vote.

As far as I can tell this information would only need to be added to the sections on operators and punctuators in the 'lexical structure' page and compound assignment in the 'expressions' page.

Hi,
I had an issue open a while ago (#265). Also because I stepped over some things while implementing an PHP interpreter :)

One of the maintainers of the php-src repo wrote that this document is not going to be maintained anymore.

See #265 (comment)

I see, thanks for the heads up!

I've been looking at the language spec here as a supplement, I assume that one is more up to date?

I used this spec for the beginning of my implementation of the interpreter. For details I looked at php.net.

Honestly, I would recommend learning yacc/bison and then looking at https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y for accurate information.