Page MenuHomePhabricator

D8031.diff
No OneTemporary

D8031.diff

Index: src/parser/xhpast/__tests__/PHPASTParserTestCase.php
===================================================================
--- src/parser/xhpast/__tests__/PHPASTParserTestCase.php
+++ src/parser/xhpast/__tests__/PHPASTParserTestCase.php
@@ -56,6 +56,10 @@
case 'comment':
// Human readable comment providing test case information.
break;
+ case 'rtrim':
+ // Allows construction of tests which rely on EOF without newlines.
+ $body = rtrim($body);
+ break;
default:
throw new Exception(
pht(
Index: src/parser/xhpast/__tests__/data/php-foreach-list.php.test
===================================================================
--- /dev/null
+++ src/parser/xhpast/__tests__/data/php-foreach-list.php.test
@@ -0,0 +1,2 @@
+# fail-syntax, comment="Wrong, supported in PHP 5.5, see T4334."
+<?php foreach ($x as list($y, $z)) {}
Index: src/parser/xhpast/__tests__/data/php-heredoc-terminal.php.test
===================================================================
--- /dev/null
+++ src/parser/xhpast/__tests__/data/php-heredoc-terminal.php.test
@@ -0,0 +1,4 @@
+# fail-syntax, rtrim, comment="Wrong, supported in PHP 5.5, see T4334."
+<?php
+<<<HEREDOC
+HEREDOC;
Index: src/parser/xhpast/__tests__/data/php-literal-index.php.test
===================================================================
--- /dev/null
+++ src/parser/xhpast/__tests__/data/php-literal-index.php.test
@@ -0,0 +1,2 @@
+# fail-syntax, comment="Wrong, supported in PHP 5.5, see T4334."
+<?php [1][0]; "X"[0];
Index: src/parser/xhpast/__tests__/data/php-yield.php.test
===================================================================
--- /dev/null
+++ src/parser/xhpast/__tests__/data/php-yield.php.test
@@ -0,0 +1,11 @@
+# fail-syntax, comment="Wrong, supported in PHP 5.5, see T4334."
+<?php
+
+function g() {
+ yield;
+ yield $x;
+ yield $y => $z;
+
+ $data = (yield $a);
+ $data = (yield $b => $c);
+}

File Metadata

Mime Type
text/plain
Expires
Mar 14 2025, 9:09 AM (5 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7652643
Default Alt Text
D8031.diff (1 KB)

Event Timeline