[Xapian-devel] PHP Latest

Olly Betts olly at survex.com
Sat Apr 22 06:09:12 BST 2006


On Fri, Apr 21, 2006 at 05:11:24PM +0100, Sam Liddicott wrote:
> I didn't realise anything here was specific to php5.

I just took a look.  Here are the things which PHP4 moans about:

* "abstract class Foo" - "abstract" is new in PHP5.  Reading the docs
  removing it just seems to mean that the user can create an instance of
  such a class, so I guess we could remove it from the wrapper if it was
  the only thing stopping it working with both.

* "public function foo() {[...]}" - public is new in PHP5, but is the
  default anyway, so there doesn't seem to be a good reason to specify
  it explicitly.

* "public $foo=[...];" - public is new in PHP5, and in PHP4 it seems
  we'd use "var $foo=[...];" instead, though the PHP5 docs say:

    Note:  The PHP 4 method of declaring a variable with the var keyword
    is no longer valid for PHP 5 objects. For compatibility a variable
    declared in php will be assumed with public visibility, and a E_STRICT
    warning will be issued.

* "public static function foo() {[...]}" - static doesn't seem to exist
  in PHP4, though the PHP5 manual doesn't mention that.  I can't see a
  sane fix for this which doesn't degrade use with PHP5 - wrapping the
  static class functions as non-class functions seems the best option.

So I think we'd need to generate a separate wrapper for PHP4.

Making the above changes to the wrapper gives me a segfault on "make
check".  I've not investigated why yet.

Cheers,
    Olly



More information about the Xapian-devel mailing list