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

[php] PHP 8 compatibility #9964

Open
1 of 3 tasks
RealyUniqueName opened this issue Nov 26, 2020 · 3 comments
Open
1 of 3 tasks

[php] PHP 8 compatibility #9964

RealyUniqueName opened this issue Nov 26, 2020 · 3 comments
Assignees
Labels
platform-php Everything related to PHP
Milestone

Comments

@RealyUniqueName
Copy link
Member

RealyUniqueName commented Nov 26, 2020

  • - new \Socket and \AddressInfo classes instead of related resource types (details). This creates a conflict between extern definitions for PHP7 & PHP8
  • attributes
  • various situations of int<->float coercion is deprecated and generate E_DEPRECATED notice
@RealyUniqueName RealyUniqueName self-assigned this Nov 26, 2020
@RealyUniqueName RealyUniqueName added the platform-php Everything related to PHP label Nov 26, 2020
@RealyUniqueName RealyUniqueName added this to the Hotfix milestone Nov 26, 2020
@cedx
Copy link
Contributor

cedx commented Nov 26, 2020

Another important issue with PHP 8: Haxe allows required parameters to be after optional ones. So this:

public function new(method:Method, url:Url, protocol:Protocol = HTTP1_1, fields)

Is compiled to that:

public function __construct ($method, $url, $protocol = null, $fields)

And it raises the following exception:

Uncaught ErrorException: Required parameter $fields follows optional parameter $protocol

More info: https://php.watch/versions/8.0/deprecate-required-param-after-optional

@RealyUniqueName How can we customize the error handler? Setting error_reporting = E_ALL & ~E_DEPRECATED in php.ini doesn't avoid the ErrorException.

@RealyUniqueName
Copy link
Member Author

Another important issue with PHP 8: Haxe allows required parameters to be after optional ones.

This is already fixed in development and 4.1_bugfix branches.

Error reporting is forced here:

var previousLevel = Global.error_reporting(Const.E_ALL);

You can redefine it in static function main or in the static function __init__ of your main class.

@cedx
Copy link
Contributor

cedx commented Nov 27, 2020

This is already fixed in development and 4.1_bugfix branches.

@RealyUniqueName Thanks for all your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-php Everything related to PHP
Projects
None yet
Development

No branches or pull requests

2 participants