2

I have the Pimple C extension installed and in my phpinfo() i can see that the Pimple extension is active.

I also have pimple/pimple in my composer.json and the php package is loaded.

As far as i see they dont collide as i dont get any errors, but how do i know that the extension is in use?

When i have the Pimple C extension installed, do i still need the php Pimple package?
Will the C extension silently override the php class?

Is it common behaviour that php will first check if a class is present in php itself and then fallback to a php implementation?

ivoba
  • 5,780
  • 5
  • 48
  • 55
  • I think if you install Pimple as a PHP extension, you don't need to get it throught *composer* anymore. Pimple's object became available as other extension you used to (PDO for instance ?). As far as I remember you don't need to load extension's class, and namespace is the root *\* – Fractaliste Feb 25 '15 at 08:30
  • if i look at silex (dev-master) f.e., pimple is ofc in the composer.json and so the php class will be loaded. as pimple's namespace is in root would the php_ext pimple replace the php pimple? – ivoba Feb 25 '15 at 09:48
  • I reformulate your question [here](http://stackoverflow.com/questions/28716313/priority-between-spl-autoload-register-and-extensions-function). – Fractaliste Feb 25 '15 at 10:19
  • great thx, there is already an answer there, feel free to place an answer here, i will gladly accept – ivoba Feb 25 '15 at 10:29

1 Answers1

1

PHP will use the extension's one.

This is because autoloading will only happen if you are attempting to access a class which does not already exist. Extension functions and classes will exist after PHP's startup meaning before the code starts to run.

(answers from hek2mgl user)

Community
  • 1
  • 1
Fractaliste
  • 5,777
  • 11
  • 42
  • 86