-4

Are there any advantages for using pure PHP instead of its frameworks?

I work on thesis and I need to find some pros of pure PHP. I tried to google but there is only praise the frameworks.

user7303261
  • 128
  • 12
  • 3
    This is really opinion based, any response will be bias. There are moments that requires one and other that require the other, depending on your value of 'ms of performance' and 'hours of development'. – Larandar May 11 '17 at 09:03
  • @Larandar Can you name an example that require pure form? – user7303261 May 11 '17 at 09:51
  • 1
    A single file script, or webhook for API, which don't need to load all the controllers just to insert data in db. – Larandar May 11 '17 at 11:25
  • 1
    Thank you very much @Grez. It is really hard to gain some reputation point, isn't it? :) Would it help you If I voted you up? :) – user7303261 May 11 '17 at 12:44

1 Answers1

1

I would say framework may be slower (by definition) than a raw PHP script.

First thing is routing and dispatch, and that will always be faster using the http server for routing than using PHP.

Performances will always be the largest problem with framework, but with a good cache and especially some opcache, there is not that much of a problem.

Frameworks allow to have a common layer to build the application on, and also bring a set of best practices and components. They help with the process of industrialisation mainly.

Don't forget to mention the PSR/PHP FIG in your work!

Thomas Dutrion
  • 1,844
  • 1
  • 11
  • 9