-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Store default values of parameters of internal functions in arginfo #5353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ea43d8c
Store default parameter values of internal functions in arg info
kocsismate fe52d36
Update stubs
kocsismate d45d179
Update tests
kocsismate 4a8a22d
Address code review comments
kocsismate 4266358
Try to reorganize language scanner dependencies
kocsismate 62f170e
Revert "Try to reorganize language scanner dependencies"
nikic 7cf5852
Fix typo
nikic a3d1850
Extract as zend_compile_string_to_ast() function
nikic 157f390
Remove reflection part of genfiles
nikic 59b902f
Handle simple cases more efficiently
nikic 1942986
Forward declare _zend_arena struct
nikic 18ddd11
Handle a few more cases in the fast-path
nikic 1cdbe90
Code cleanup
nikic dd62bcd
Initialize file context
nikic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update tests
- Loading branch information
commit d45d179b3fdaf71a2e388c91b418ae286a58080e
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
Zend/tests/parameter_default_values/internal_declaration_error_class_const.phpt
This file contains hidden or 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-- | ||
The default value is a class constant in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
class MyDateTimeZone extends DateTimeZone | ||
{ | ||
public static function listIdentifiers() | ||
{ | ||
} | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of MyDateTimeZone::listIdentifiers() must be compatible with DateTimeZone::listIdentifiers(int $what = DateTimeZone::ALL, ?string $country = null) in %s on line %d |
12 changes: 12 additions & 0 deletions
12
Zend/tests/parameter_default_values/internal_declaration_error_const.phpt
This file contains hidden or 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-- | ||
The default value is a constant in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
class MyDateTimeZone extends DateTimeZone | ||
{ | ||
public function getTransitions() | ||
{ | ||
} | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of MyDateTimeZone::getTransitions() must be compatible with DateTimeZone::getTransitions(int $timestamp_begin = PHP_INT_MIN, int $timestamp_end = PHP_INT_MAX) in %s on line %d |
11 changes: 11 additions & 0 deletions
11
Zend/tests/parameter_default_values/internal_declaration_error_false.phpt
This file contains hidden or 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-- | ||
The default value is false in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
|
||
interface MyDateTimeInterface extends DateTimeInterface | ||
{ | ||
public function diff(); | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of MyDateTimeInterface::diff() must be compatible with DateTimeInterface::diff(DateTimeInterface $object, bool $absolute = false) in %s on line %d |
12 changes: 12 additions & 0 deletions
12
Zend/tests/parameter_default_values/internal_declaration_error_int.phpt
This file contains hidden or 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-- | ||
The default value is an integer in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
class MyDateTime extends DateTime | ||
{ | ||
public function setTime(int $hour, int $minute, int $second = 0, bool $microseconds = false) | ||
{ | ||
} | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of MyDateTime::setTime(int $hour, int $minute, int $second = 0, bool $microseconds = false) must be compatible with DateTime::setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0) in %s on line %d |
12 changes: 12 additions & 0 deletions
12
Zend/tests/parameter_default_values/internal_declaration_error_null.phpt
This file contains hidden or 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-- | ||
The default value is null in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
class MyDateTime extends DateTime | ||
{ | ||
public static function createFromFormat() | ||
{ | ||
} | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of MyDateTime::createFromFormat() must be compatible with DateTime::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = null) in %s on line %d |
25 changes: 25 additions & 0 deletions
25
Zend/tests/parameter_default_values/userland_declaration_error_class_const.phpt
This file contains hidden or 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,25 @@ | ||
--TEST-- | ||
The default value is a constant in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
|
||
use Foo\Bar; | ||
|
||
class A | ||
{ | ||
public function foo( | ||
$param1 = \Foo\Bar::CONSTANT, | ||
$param2 = Foo\Bar::CONSTANT, | ||
$param3 = Bar::CONSTANT | ||
) { | ||
} | ||
} | ||
|
||
class B extends A | ||
{ | ||
public function foo() | ||
{ | ||
} | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of B::foo() must be compatible with A::foo($param1 = Foo\Bar::CONSTANT, $param2 = Foo\Bar::CONSTANT, $param3 = Foo\Bar::CONSTANT) in %s on line %d |
25 changes: 25 additions & 0 deletions
25
Zend/tests/parameter_default_values/userland_declaration_error_const.phpt
This file contains hidden or 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,25 @@ | ||
--TEST-- | ||
The default value is a constant in the parent class method's signature. | ||
--FILE-- | ||
<?php | ||
|
||
use const Foo\CONSTANT; | ||
|
||
class A | ||
{ | ||
public function foo( | ||
$param1 = \Foo\CONSTANT, | ||
$param2 = Foo\CONSTANT, | ||
$param3 = CONSTANT | ||
) { | ||
} | ||
} | ||
|
||
class B extends A | ||
{ | ||
public function foo() | ||
{ | ||
} | ||
} | ||
--EXPECTF-- | ||
Fatal error: Declaration of B::foo() must be compatible with A::foo($param1 = Foo\CONSTANT, $param2 = Foo\CONSTANT, $param3 = Foo\CONSTANT) in %s on line %d |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -32,4 +32,3 @@ Function [ <user> function ReflectionParameterTest ] { | |
Parameter #1 [ <optional> $test2 = NULL ] | ||
} | ||
} | ||
|
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.