Install SPL_Types on PHP 7.1 compiled from source

1.3k views Asked by At

I am trying to install SPL_Types extension in my PHP 7.1.8 compiled from source.

I have tried with sudo pecl install SPL_Types and compiling the extension from source, but I get the following output:

https://mega.nz/#!WE5WjajQ!QyVxMYWrsUiDF6Gq09psYBpR5Y336v26PusnlBNd8bg

I know it's not cool to post links, but I was not able to put the hole output here.

1

There are 1 answers

1
Timurib On BEST ANSWER

This extension is outdated now and cannot be build with PHP 7.x. Latest version of this lib released at 2012 and supports only PHP 5.4. Native scalar type declarations support makes this extension mostly useless (maybe except for SplEnum).

With PHP 7.x many of internal PHP API was have significantly changed. As you can see in the attached output, source code of the extension uses dozens of outdated APIs (most of errors caused by missing macros, wrong data types, etc).

For the extension to be built with the new version, it must be updated accordingly: Upgrading PHP extensions from PHP5 to NG. If you are not familiar with C you can try to use unofficial fork or polyfill.