Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is PHP minification helpful?

Tags:

php

minify

I can understand that by minifing js code will reduce its size and will be helpful for sending over the network but will it be useful to minify php?

also how obfuscation will be helpful in execution in php?

like image 906
Pankaj Khairnar Avatar asked Mar 12 '26 11:03

Pankaj Khairnar


2 Answers

Minifying php is pointless from a network bandwidth perspective, minifying the output of the php might be beneficial however as the html that is output is transmitted. The original php will be hard to maintain if it's minified. Which is also the point of obsfucation. If someone gets hold of your php, then it will prevent them knowing what it does without more effort...

like image 160
Matt Fellows Avatar answered Mar 14 '26 18:03

Matt Fellows


PHP code is (generally) not transmitted over HTTP (unlike CSS, JavaScript & HTML) so minifying it would be pointless, not to mention making your code unnecessarily unreadable.

like image 22
alex Avatar answered Mar 14 '26 20:03

alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!