Skip to content

Fixes deprecated PHP 4 style constructors by renaming them to __construct()#62

Open
gdevlugt wants to merge 1 commit intophpWhois:4-stablefrom
gdevlugt:4-stable-fix-constructors
Open

Fixes deprecated PHP 4 style constructors by renaming them to __construct()#62
gdevlugt wants to merge 1 commit intophpWhois:4-stablefrom
gdevlugt:4-stable-fix-constructors

Conversation

@gdevlugt
Copy link
Copy Markdown

While using phpWhois 4-stable with PHP 7.0.8, PHP returns the following deprecation warnings because old PHP 4 style constructors are used.

PHP Deprecated: Methods with the same name as their class will not be constructors 
in a future version of PHP; Whois has a deprecated constructor in 
/home/code/phpwhois/src/whois.main.php on line 31

PHP Deprecated:  Methods with the same name as their class will not be constructors 
in a future version of PHP; WhoisClient has a deprecated constructor in 
/home/code/phpwhois/src/whois.client.php on line 30

PHP Deprecated:  Methods with the same name as their class will not be constructors 
in a future version of PHP; idna_convert has a deprecated constructor in 
/home/code/phpwhois/src/whois.idna.php on line 54

The PR fixes this by renaming the mentioned deprecated constructors to __construct.

Since the minimum required PHP version for this phpWhois version is 5.3, and because PHP 5.3 supports constructors named __construct, this won't break compatibility with older PHP versions.

@roncemer
Copy link
Copy Markdown

Why isn't this changed pushed out to composer? If you're using PHP 7.x with phpwhois installed via composer, there is currently no fix for the deprecated constructors.

Please get on the ball and push out a fix for this.

@NikoGrano
Copy link
Copy Markdown

Hi!

If you see this issue still relevant and could be fixed by this PR. Please submit it to https://github.com/niko9911/phpWhois.

I will make sure it will be checked and merged if necessary. Thank you for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants