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 remote-tracking branch 'origin/master' into native-tls
* origin/master: (31 commits) Fixed C++ incompatibility update the certificate used for the test, as it expired recently Fixed immutable arrays support Fix counting of "R:" references in serialize() Remove dead code Test use($this) being an error Move list() condition into assign_znode typo NEWS Fix bug #68074 Allow to use system cipher list instead of hardcoded value Avoid double checks the order of the blocks should be Core, then exts in alphabetical order add missing NEWS entry for the phpdbg compilation fix add NEWS entry for #68088 Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR. Removed useless helper Drop unused result argument Fix ct binding for cuf/cufa functions Fix detection of write to built-in function for references Test use of string names with \ prefix ...
- Loading branch information
Showing
46 changed files
with
1,111 additions
and
1,177 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--TEST-- | ||
Cannot use built-in functions in write context (assignment) | ||
--FILE-- | ||
<?php | ||
|
||
strlen("foo")[0] = 1; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use result of built-in function in write context 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,10 @@ | ||
--TEST-- | ||
Cannot use built-in functions in write context (reference) | ||
--FILE-- | ||
<?php | ||
|
||
$ref =& strlen("foo"); | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use result of built-in function in write context 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,10 @@ | ||
--TEST-- | ||
Cannot access self::class when no class scope is active | ||
--FILE-- | ||
<?php | ||
|
||
var_dump(self::class); | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot access self::class when no class scope is active 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
11 changes: 11 additions & 0 deletions
11
Zend/tests/constant_expressions_dynamic_class_name_error.phpt
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,11 @@ | ||
--TEST-- | ||
Dynamic class names can't be used in compile-time constant refs | ||
--FILE-- | ||
<?php | ||
|
||
$foo = 'test'; | ||
const C = $foo::BAR; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Dynamic class names are not allowed in compile-time class constant references in %s on line %d |
11 changes: 11 additions & 0 deletions
11
Zend/tests/constant_expressions_invalid_offset_type_error.phpt
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,11 @@ | ||
--TEST-- | ||
Can't use arrays as key for constant array | ||
--FILE-- | ||
<?php | ||
|
||
const C1 = 1; // force dynamic evaluation | ||
const C2 = [C1, [] => 1]; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Illegal offset type in %s on line %d |
10 changes: 10 additions & 0 deletions
10
Zend/tests/constant_expressions_static_class_name_error.phpt
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,10 @@ | ||
--TEST-- | ||
Cannot use static::FOO in constant expressions | ||
--FILE-- | ||
<?php | ||
|
||
const C = static::FOO; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: "static::" is not allowed in compile-time constants 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,12 @@ | ||
--TEST-- | ||
Duplicate labels are not allowed | ||
--FILE-- | ||
<?php | ||
|
||
foo: | ||
foo: | ||
goto foo; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Label 'foo' already defined 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,26 @@ | ||
--TEST-- | ||
Test use of magic constants in the global scope | ||
--FILE-- | ||
<?php | ||
|
||
var_dump( | ||
__LINE__, | ||
__FILE__, | ||
__DIR__, | ||
__FUNCTION__, | ||
__METHOD__, | ||
__CLASS__, | ||
__TRAIT__, | ||
__NAMESPACE__ | ||
); | ||
|
||
?> | ||
--EXPECTF-- | ||
int(4) | ||
string(%d) "%s" | ||
string(%d) "%s" | ||
string(0) "" | ||
string(0) "" | ||
string(0) "" | ||
string(0) "" | ||
string(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,10 @@ | ||
--TEST-- | ||
Cannot use special class name as namespace | ||
--FILE-- | ||
<?php | ||
|
||
namespace self; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use 'self' as namespace name 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,10 @@ | ||
--TEST-- | ||
Cannot use special class name as alias | ||
--FILE-- | ||
<?php | ||
|
||
use Foo\Bar as self; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use Foo\Bar as self because 'self' is a special class name 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,10 @@ | ||
--TEST-- | ||
Cannot use special class name as trait name | ||
--FILE-- | ||
<?php | ||
|
||
trait self {} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use 'self' as class name as it is reserved 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,14 @@ | ||
--TEST-- | ||
Cannot use $this as lexical variable | ||
--FILE-- | ||
<?php | ||
|
||
class Foo { | ||
public function fn() { | ||
return function() use ($this) {}; | ||
} | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot use $this as lexical variable 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
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
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
Oops, something went wrong.