Pankaj Khairnar
Pankaj Khairnar

Reputation: 3118

Is PHP minification helpful?

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?

Upvotes: 2

Views: 1221

Answers (6)

Matt Fellows
Matt Fellows

Reputation: 6532

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...

Upvotes: 5

Brian
Brian

Reputation: 8616

It is only (very slightly) useful if you intent to distribute your PHP while still retain some control... however obfuscating PHP is largely pointless as even in a obscured state any decently experienced person will be able to easily work it out.

Upvotes: 1

Bjoern
Bjoern

Reputation: 16304

Minifying to php code doesn't really speed up the server parsing and executing the php scripts.

To speed up websites I recommend having a look at YSlow.

Upvotes: 0

user562854
user562854

Reputation:

Neither minification nor obfuscation will improve execution of a php script. What are you looking for is Optimization.

Upvotes: 3

genesis
genesis

Reputation: 50974

  • Obfuscation is just slowing down code a bit, because it's filling a lot of variables
  • If PHP would be faster in case of minified version, users/programmers would use it a lot more. Did you see any minified PHP ? No

so No and No

Upvotes: 1

alex
alex

Reputation: 490423

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.

Upvotes: 3

Related Questions