Skip to content
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

Deprecations for PHP 7.3 #3366

Merged
merged 6 commits into from Jul 21, 2018
Merged

Deprecations for PHP 7.3 #3366

merged 6 commits into from Jul 21, 2018

Conversation

nikic
Copy link
Member

@nikic nikic commented Jul 4, 2018

Implementation for https://wiki.php.net/rfc/deprecations_php_7_3 (apart from the ones linked there).

@nikic nikic added the RFC label Jul 4, 2018
@KalleZ
Copy link
Member

KalleZ commented Jul 4, 2018

You can just merge the patches I wrote and linked in the RFC as apart of this PR

@Majkl578
Copy link
Contributor

Majkl578 commented Jul 5, 2018

@nikic: Hi, are you still open to proposals to include in the RFC?
I would like to suggest few more things here. It shouldn't affect the RFC itself as each proposal is to be voted on on its own.

  • __CLASS__ in favor of self::class (obsolete as of PHP 5.5)
  • get_class() in favor of static::class (obsolete as of PHP 5.5)
  • get_called_class() in favor of static::class (obsolete as of PHP 5.5)
  • array_key_exists() with object argument

@nikic
Copy link
Member Author

nikic commented Jul 5, 2018

@Majkl578 We can't add anything to this RFC anymore due to timing constraints, but please add your ideas to the next RFC (https://wiki.php.net/rfc/deprecations_php_7_4) so they will not be forgotten.

@Majkl578
Copy link
Contributor

Majkl578 commented Jul 5, 2018

Alright. 👍 Is it okay if I edit the RFC directly myself, adding paragraphs for each of those? Should I note myself there (as the one who proposed them)?

@nikic
Copy link
Member Author

nikic commented Jul 5, 2018

@Majkl578 Yeah, feel free to edit directly.

@Majkl578
Copy link
Contributor

Majkl578 commented Jul 5, 2018

Thanks, updated. (For __CLASS__, I used invisible space, otherwise underscores were interpreted by the doc engine).

I didn't include get_class() as I realized PHP still doesn't support $instance::class. 😢 Not a big deal.

@nikic
Copy link
Member Author

nikic commented Jul 5, 2018

@Majkl578 You can use ''%%__CLASS__%%'' to disable interpretation.

@nikic nikic changed the title [WIP] Deprecations for PHP 7.3 Deprecations for PHP 7.3 Jul 5, 2018
@nikic
Copy link
Member Author

nikic commented Jul 5, 2018

@Majkl578 Not really the place to discuss this, but you can still deprecate get_class() without an argument, which is the part that's equivalent to self::class. The use with an argument would remain.

Also my 2c, I don't think it makes sense to deprecate __CLASS__. Especially as we still keep a bunch of other magic constants around, this doesn't seem to buy us much and may increase inconsistency rather than decrease it. If we have __FUNCTION__ and __TRAIT__ -- but no __CLASS__? That seems odd.

@KalleZ
Copy link
Member

KalleZ commented Jul 5, 2018

I agree with @nikic here, I think CLASS should remain for consistency, some doubles are fine imo.

@KalleZ
Copy link
Member

KalleZ commented Jul 14, 2018

@nikic since we opted to add the new ADD_SLASHES filter for ext/filter the deprecation should be reverted and the patch for pdo_odbc.db2_instance_name should be added and we're good (looking at the current vote)

@cmb69
Copy link
Contributor

cmb69 commented Jul 17, 2018

@nikic Is this basically good to merge (with the omission of the magic_quotes filter deprecation)? Also the pdo_odbc.db2_instance_name php.ini directive deprecation is not yet implemented. The following patch fixes the 5 failing tests under Windows:

 ext/standard/tests/file/fgetss_basic2-win32-mb.phpt  | 2 ++
 ext/standard/tests/file/fgetss_basic2-win32.phpt     | 2 ++
 ext/standard/tests/file/fgetss_variation1-win32.phpt | 2 ++
 ext/standard/tests/file/fgetss_variation3-win32.phpt | 2 ++
 ext/standard/tests/file/fgetss_variation5-win32.phpt | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt b/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt
index 783e6c3edd..c875024718 100644
--- a/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt
+++ b/ext/standard/tests/file/fgetss_basic2-win32-mb.phpt
@@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
 ?>
 --FILE--
 <?php
+error_reporting(E_ALL & ~E_DEPRECATED);
+
 /*
  Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] );
  Description: Gets line from file pointer and strip HTML tags
diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt
index 1fac3afb15..c7f3aa4c06 100644
--- a/ext/standard/tests/file/fgetss_basic2-win32.phpt
+++ b/ext/standard/tests/file/fgetss_basic2-win32.phpt
@@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
 ?>
 --FILE--
 <?php
+error_reporting(E_ALL & ~E_DEPRECATED);
+
 /*
  Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] );
  Description: Gets line from file pointer and strip HTML tags
diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt
index 7cd49333bf..688f5e624a 100644
--- a/ext/standard/tests/file/fgetss_variation1-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt
@@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
 ?>
 --FILE--
 <?php
+error_reporting(E_ALL & ~E_DEPRECATED);
+
 /*
  Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] );
  Description: Gets line from file pointer and strip HTML tags
diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt
index fc7561dff5..19699b2fb3 100644
--- a/ext/standard/tests/file/fgetss_variation3-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation3-win32.phpt
@@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
 ?>
 --FILE--
 <?php
+error_reporting(E_ALL & ~E_DEPRECATED);
+
 /*
  Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] );
  Description: Gets line from file pointer and strip HTML tags
diff --git a/ext/standard/tests/file/fgetss_variation5-win32.phpt b/ext/standard/tests/file/fgetss_variation5-win32.phpt
index a2d4a705e8..211c158ae2 100644
--- a/ext/standard/tests/file/fgetss_variation5-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation5-win32.phpt
@@ -8,6 +8,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
 ?>
 --FILE--
 <?php
+error_reporting(E_ALL & ~E_DEPRECATED);
+
 /*
  Prototype: string fgetss ( resource $handle [, int $length [, string $allowable_tags]] );
  Description: Gets line from file pointer and strip HTML tags

@php-pulls php-pulls merged commit fb0e8c6 into php:master Jul 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants