2 ms·
Really, the worst part of PHP in my experience has been the debugging facilities. Print-line debugging just doesn't cut it anymore, and things like xdebug and p
by bpicolo 10y ago
Really, the worst part of PHP in my experience has been the debugging facilities. Print-line debugging just doesn't cut it anymore, and things like xdebug and phpdbg just aren't elegant, are hard to configure properly, and don't work for all the relevant scenarios (trying to debug PHP running in a docker container is not a fun task).
The quality of open-source libraries in the ecosystem is also pretty below what I've come to expect from other languages, and then half of them are c-lang PHP hybrids that are more difficult to manage, update, and install.
I think the author failed to mention the downsides of no long-running processes either. Shelling out to e.g. memcached for configuration setup (especially when memcached might not live locally) isn't particularly fun. Not to mention this has made it difficult to integrate into some useful things, like GRPC[http://www.grpc.io/ http://www.grpc.io/] which can't use PHP as a server as of yet.
Then there are all sorts of random deployment gotchas, like proper opcache configuration.
PHP is a pretty wart-filled language. It's usable, but I wouldn't make it my first choice in any situation, given a choice.
- skippyta 10y agoPHP has xdebug. You can debug interactively using an IDE like IntelliJ / PHPStorm or whatever floats your boat. Is that not enough? Edit: I commented on this post before the OP edited the original with a longer form explanation. Originally it just said he didn't like the debugging and left it at that.
- bpicolo 10y agoI mentioned that in my post. Needing a full-fledged IDE for some baseline debugging isn't what I look for. And, like I said, doesn't "just work" in all scenarios. Plus, you can't do inline code execution (the interactive part) if you are using xdebug for PHPUnit tests (even in PHPstorm). It's a really flawed experience, where getting it to half-work is a frequently frustrating experience. Even the baseline REPL is flawed. PHP went again and forgot the P, so you have to figure out the correct-of-many-variant print statements and remember to put it before the code you want to run when using the 'REPL'
- securingsincity 10y agoYou should definitely try vscode. I've found it to be the easiest to set up step debugger for PHP and it's not a heavy ide like intellij
- bpicolo 10y agoStep by step with the ability to execute arbitrary expressions in the middle of it? That's the important bit. What VSCode extensions are useful here?
- kowdermeister 10y agoOfficial docs are a good starting point: https://code.visualstudio.com/Docs/languages/php#customization-articles https://code.visualstudio.com/Docs/languages/php#customizati...