Topic on Extension talk:SphinxSearch

PHP 4 constructor deprecation warnings

1
Summary by Svemir Brkic

Fixed for release branches 1.31 and beyond.

Mg169706 (talkcontribs)

If you use PHP7 you might get a warning about deprecated class constructors. The simplest thing to do here is to rename the existing constructor to __construct() and create a new stub function with the old constructor name. The stub function points to the new constructor, so it'll work in both PHP 4, 5 and 7. See example below.

// PHP 4 Constructor

     function SphinxClient () {

               self::__construct();

       }

// PHP 7 Constructor

       function __construct () {

// Original constructor code goes here...

}