forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into merge-fastcgi
- Loading branch information
Showing
79 changed files
with
3,088 additions
and
1,147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
Test to check static method calls syntax regression | ||
--FILE-- | ||
<?php | ||
|
||
class Foo { | ||
public static function function(){ echo __METHOD__, PHP_EOL; } | ||
} | ||
|
||
Foo::function(); | ||
|
||
Foo:: | ||
function(); | ||
|
||
Foo:: | ||
function(); | ||
|
||
|
||
Foo:: | ||
function( | ||
|
||
); | ||
|
||
echo "\nDone\n"; | ||
|
||
--EXPECTF-- | ||
|
||
Foo::function | ||
Foo::function | ||
Foo::function | ||
Foo::function | ||
|
||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test to ensure ::class still works | ||
--FILE-- | ||
<?php | ||
|
||
class Foo {} | ||
|
||
var_dump(Foo::class); | ||
|
||
var_dump(Foo:: class); | ||
|
||
var_dump(Foo:: CLASS); | ||
|
||
var_dump(Foo:: | ||
|
||
CLASS); | ||
|
||
--EXPECTF-- | ||
string(3) "Foo" | ||
string(3) "Foo" | ||
string(3) "Foo" | ||
string(3) "Foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--TEST-- | ||
Test to ensure ::class is still reserved in obj scope | ||
--FILE-- | ||
<?php | ||
|
||
class Obj | ||
{ | ||
const CLASS = 'class'; | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: A class constant must not be called 'class'; it is reserved for class name fetching in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--TEST-- | ||
Test possible function naming regression on procedural scope | ||
--FILE-- | ||
<?php | ||
|
||
class Obj | ||
{ | ||
function echo(){} // valid | ||
function return(){} // valid | ||
} | ||
|
||
function echo(){} // not valid | ||
|
||
--EXPECTF-- | ||
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting identifier (T_STRING) or '(' in %s on line 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Test possible constant naming regression on procedural scope | ||
--FILE-- | ||
<?php | ||
|
||
class Obj | ||
{ | ||
const return = 'yep'; | ||
} | ||
|
||
const return = 'nope'; | ||
|
||
--EXPECTF-- | ||
Parse error: syntax error, unexpected 'return' (T_RETURN), expecting identifier (T_STRING) in %s on line 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--TEST-- | ||
Test to ensure const list syntax declaration works | ||
--FILE-- | ||
<?php | ||
|
||
class Obj | ||
{ | ||
const DECLARE = 'declare', | ||
RETURN = 'return', | ||
FUNCTION = 'function', | ||
USE = 'use'; | ||
} | ||
|
||
echo Obj::DECLARE, PHP_EOL; | ||
echo Obj::RETURN, PHP_EOL; | ||
echo Obj::FUNCTION, PHP_EOL; | ||
echo Obj::USE, PHP_EOL; | ||
echo Obj:: | ||
|
||
USE, PHP_EOL; | ||
echo "\nDone\n"; | ||
|
||
--EXPECTF-- | ||
declare | ||
return | ||
function | ||
use | ||
use | ||
|
||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--TEST-- | ||
Test to ensure semi reserved words allow deference | ||
--FILE-- | ||
<?php | ||
|
||
class Foo { | ||
const use = 'yay'; | ||
|
||
public static function new() { | ||
echo __METHOD__, PHP_EOL; | ||
return new static(); | ||
} | ||
|
||
public function self() { | ||
echo __METHOD__, PHP_EOL; | ||
return $this; | ||
} | ||
} | ||
|
||
Foo::new()::new()::new(); | ||
|
||
var_dump( | ||
(new Foo)->self()::new()->self()->self()::use | ||
); | ||
|
||
Foo::{'new'}(); | ||
|
||
var_dump(Foo::use); | ||
|
||
echo "\nDone\n"; | ||
|
||
--EXPECTF-- | ||
Foo::new | ||
Foo::new | ||
Foo::new | ||
Foo::self | ||
Foo::new | ||
Foo::self | ||
Foo::self | ||
string(3) "yay" | ||
Foo::new | ||
string(3) "yay" | ||
|
||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Test to check regressions on string interpolation with class members access | ||
--FILE-- | ||
<?php | ||
|
||
class Friday { | ||
public $require = "fun"; | ||
} | ||
|
||
$friday = new Friday; | ||
|
||
echo "$friday->require ($friday->require) {$friday->require}", PHP_EOL; | ||
|
||
echo "\nDone\n"; | ||
|
||
|
||
--EXPECTF-- | ||
|
||
fun (fun) fun | ||
|
||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Test to check regressions on use statements and lexer state | ||
--FILE-- | ||
<?php | ||
|
||
use A\B\C\D; | ||
|
||
class Foo | ||
{ | ||
private static $foo; | ||
|
||
} | ||
|
||
echo PHP_EOL, "Done", PHP_EOL; | ||
|
||
--EXPECTF-- | ||
|
||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Test to check regressions on T_IMPLEMENTS followed by a T_NS_SEPARATOR | ||
--FILE-- | ||
<?php | ||
|
||
interface A{} | ||
|
||
class B implements\A {} | ||
|
||
echo "Done", PHP_EOL; | ||
|
||
--EXPECTF-- | ||
|
||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Testing instantiation using namespace:: prefix | ||
--FILE-- | ||
<?php | ||
|
||
namespace foo; | ||
|
||
class bar { | ||
} | ||
|
||
class_alias('foo\bar', 'foo\baz'); | ||
|
||
var_dump(new namespace\baz); | ||
|
||
?> | ||
--EXPECTF-- | ||
object(foo\bar)#%d (0) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--TEST-- | ||
Testing for regression on const list syntax and arrays | ||
--FILE-- | ||
<?php | ||
|
||
class A { | ||
const A = [1, FOREACH]; | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
|
||
Parse error: syntax error, unexpected 'FOREACH' (T_FOREACH), expecting ']' in %s on line %d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--TEST-- | ||
Testing for regression with encapsed variables in class declaration context | ||
--FILE-- | ||
<?php | ||
|
||
class A { function foo() { "{${$a}}"; } function list() {} } | ||
|
||
echo "Done", PHP_EOL; | ||
|
||
?> | ||
--EXPECTF-- | ||
|
||
Done |
Oops, something went wrong.