This is an annoying edge-case for canonicalization.
. Passing the result of a (non-reference) list() assignment by reference is
consistently disallowed now. Previously this worked if the right hand side
was a simple (CV) variable and did not occur as part of the list().
+ . `<?php` at the end of the file (without trailing newline) will now be
+ interpreted as an opening PHP tag. Previously it was interpreted either as
+ `<? php` and resulted in a syntax error (with short_open_tag=1) or was
+ interpreted as a literal `<?php` string (with short_open_tag=0).
- BCMath:
. BCMath functions will now warn if a non well-formed number is passed, such
--- /dev/null
+<?php
\ No newline at end of file
--- /dev/null
+--TEST--
+File with just a <?php tag should be valid
+--FILE_EXTERNAL--
+php_tag_only.inc
+--EXPECT--
RETURN_OR_SKIP_TOKEN(T_OPEN_TAG);
}
+<INITIAL>"<?php" {
+ /* Allow <?php followed by end of file. */
+ if (YYCURSOR == YYLIMIT) {
+ BEGIN(ST_IN_SCRIPTING);
+ RETURN_OR_SKIP_TOKEN(T_OPEN_TAG);
+ }
+ /* Degenerate case: <?phpX is interpreted as <? phpX with short tags. */
+ if (CG(short_tags)) {
+ yyless(2);
+ BEGIN(ST_IN_SCRIPTING);
+ RETURN_OR_SKIP_TOKEN(T_OPEN_TAG);
+ }
+ goto inline_char_handler;
+}
<INITIAL>"<?" {
if (CG(short_tags)) {
--- /dev/null
+--TEST--
+Tokenization of only the <?php tag
+--FILE--
+<?php
+
+foreach (token_get_all("<?php") as $token) {
+ echo token_name($token[0]), "\n";
+}
+echo "\n";
+foreach (token_get_all("Foobar<?php") as $token) {
+ echo token_name($token[0]), "\n";
+}
+
+?>
+--EXPECT--
+T_OPEN_TAG
+
+T_INLINE_HTML
+T_OPEN_TAG