phpinterfacesplpredefined-variables

PHP Predefined Interfaces & SPL - version check sufficient?


This is perhaps an obvious question, but I want to be sure.

I'm trying to work out in which version the "Predefined Interfaces" appeared in PHP. My assumption is 5.0.0, as this is when the SPL interfaces were added according to the docs.

Furthermore, can these ever be disabled via configuration or recompile, or can one safely assume a version check satisfies their presence? Why are they even separated from the SPL, is the differentiator just that these can't ever be turned off, whilst the SPL can be? (at least prior to 5.3.0)


Solution

  • You can find since what version each SPL interface is available here. Some were added after 5.0. And according to the manual as of PHP 5.3.0 SPL can't be disabled.