I am very new to PHP and some people said that writing PHP code without a framework is insecure. I am not sure about that!

Is it possible to write highly secure code without any frameworks? If so, how?


Frameworks are code, too. What you get from them are standard, tested, and implemented best practices.

So, sure, you can write perfectly secure code without a framework, but you have to be good enough to be able to! You have to know the best practices for PHP and be able to implement them properly.

If you are new to PHP, a framework allows you to code more securely than you can without one because you lack the experience to think about all the areas that need special care.

| improve this answer | |
  • Also, frankly, PHP's standard library is a walking dumpster fire, and most PHP frameworks I've come across work around a lot of the shortcomings of PHP's standard library. – Marcus Müller Jun 10 '18 at 11:10
  • Also, I think it's very important to stress your Frameworks are code, too. With the amount of vulnerabilities that modern WordPress instances have, for example, it's not easy to argue that using that framework encourages secure software. Then again, if people wrote PHP like they think they should, as you say, things would be even worse. (... and that's why I think that PHP might sound like a good idea, but has proven to be a bad language, ceterum censeo PHP esse delendam. There's so many nice programming languages – why do we still bring new users to PHP?) – Marcus Müller Jun 10 '18 at 11:12
  • @schoder ya i know abt em i have used larvel, but even for silly applications usings these frameworks are labourious It would be helpfull if there is some libraries to ensure the security – Sumithran Jun 10 '18 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.