Implement PHP7 null coalesce operator
Summary: Implement the PHP7 null coalesce operator. This operator, '??', behaves
similarily to the '?:' operator, except if the left hand side does not exist, no
warning is issued.
To implement the required semantics, three new bytecodes had to be
added. 'CGetQuietL', 'CGetQuietN', and 'CGetQuietG', which behave like the
non-quiet versions, but never warn. Two other approaches were considered. The
first was adding flags to the CGet bytecodes to indicate whether to warn or
not. This became quite intrusive as these bytecodes are used everywhere. The
second approach was to lower the coalesce operator into an Isset followed by the
appropriate CGet. This generated very messy bytecode, however, and would require
at least one new bytecode anyways (to duplicate multiple values off the top of
the eval stack).
Reviewed By: swtaarrs
Differential Revision:
D2592125
fb-gh-sync-id:
1e6b9c67657938e28f4c0e1b8dd1b2657fbea213