You are viewing an old revision of this post, from May 31, 2017 @ 06:19:15. See below for differences between this version and the current revision.

Fix – Methods with the same name as their class

PHP4-style constructors still work on PHP7, they are just been deprecated and they will trigger a Deprecated warning. What you can do is define a __construct method, even an empty one, so that the php4-constructor method won't be called on a newly-created instance of the class. [php]class foo{ function foo(){ // Constructor's functionality here, if you have any. } }[/php] Change to: [php]class foo{ function __construct(){ // Constructor's functionality here, if you have any. } }[/php]

Revisions

  • May 31, 2017 @ 06:19:15 [Current Revision] by PeterLugg
  • May 31, 2017 @ 06:19:15 by PeterLugg

Revision Differences

There are no differences between the May 31, 2017 @ 06:19:15 revision and the current revision. (Maybe only post meta information was changed.)

Tags: ,

No comments yet.

Leave a Reply