Factory specialization

I just knocked this up to confirm my thinking was right:

<?php

class StdFeature {

}

class AppFeature extends StdFeature {

}

class FactoryBase {

  public function new_feature() : StdFeature { return new StdFeature; }

}

class Factory extends FactoryBase {

  public function new_feature() : AppFeature { return new AppFeature; }

}

$factory = new Factory();

$feature = $factory->new_feature();

assert( is_a( $feature, 'AppFeature' ) );

John’s PHP Extension library

Note to self: my PHP extension is here: jj5@tact:/home/jj5/repo/git/git.php.net/php-src/ext/pext

The .so file (shared object) is in modules/pext.so

I linked it in like this:

-------------------
Sun May 23 13:44:22
root@tact:/usr/lib/php/20170718
# ln -s /home/jj5/repo/git/git.php.net/php-src/ext/pext/modules/pext.so .
-------------------

Configured it like this:

-------------------
Sun May 23 13:44:47
root@tact:/usr/lib/php/20170718
# cat /etc/php/7.2/cli/conf.d/pext.ini

extension=pext.so

-------------------

And I can build it like this:

-------------------
Sun May 23 13:51:37
jj5@tact:/home/jj5/repo/git/git.php.net/php-src/ext/pext
$ make clean && make