PHP and Flask are two completely different things. One is a programming language and the other is a framework. To say "PHP doesn't provide enough to compare" to a microframework shows a gross ignorance of what PHP can do and a grand exaggeration of what Flask is actually doing.
> But I tell you, writing clean, understandable, side-effect free and secure code in PHP is much harder in comparison than I expected.
If you were talking about Ada or a similar language, I might agree with you, but you're talking about Python. It's just as easy to write bad Python as it is to write bad PHP.
From the rest of the post, it seems like the problem isn't that PHP is bad, but that you don't know (even remotely) how to write good PHP.