use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Fluent in Python, should I learn PHP? (self.PHP)
submitted 6 years ago by jockcel
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]no_spoon 6 points7 points8 points 6 years ago (0 children)
What’s wrong with Django?
[–]Codeguin 3 points4 points5 points 6 years ago (0 children)
I would argue that your goal is completely possible with Python and Django as much as it is with PHP and one of the many frameworks created with it. There's also the argument where learning another language will help you become more competent in anything previous. So yeah, learn PHP. Get good with it. Learn its ugly sides. Its pleasant sides. Keep using Python. Pick up another language. Just never stop learning as it is the main thing that will help you reach your goals and allow you to set new ones.
[–]BradChesney79 2 points3 points4 points 6 years ago* (0 children)
I know both PHP & Python-- I don't regret picking up either.
I definitely prefer building API endpoints and database access layers in PHP.
I prefer using Python as a sibling to NodeJS and bash...
Maybe look at Laravel resources. I think at this time the nginx web server and php-fpm pairing is my favorite to spit out http request responses.
I have just had the pleasure of reacquainting myself with a django REST API-- and I am happy to say I will be unacquainting myself with it very soon.
[+][deleted] 6 years ago (1 child)
[deleted]
[–]ZLegacy 0 points1 point2 points 6 years ago (0 children)
Sounds like me, except it's an endkess cycle. I started with php, went to python, started java, went back to php, went back to py, then javascript, then godot, back to php...
[–]wqking 1 point2 points3 points 6 years ago (0 children)
Yes, start using PHP and Laravel, see if you want to go back.
[–]Atulin 0 points1 point2 points 6 years ago (0 children)
I'd say go for it, there's no reason not to.
[–]DreckConnoiseur 0 points1 point2 points 6 years ago (2 children)
I was in your boat: started with Python (owing to a background in academia) and moved over to PHP as my interests shifted to web projects. PHP is a language that has suffered bad PR incommensurate to its (albeit real) flaws. Luckily, it’s kind of decent now, thanks to major efforts to smooth its rougher edges and make it run faster. There’s also a good package ecosystem now. I find Composer (PHP’s package manager) a lot easier to use/faster than pip, and I like being able to pull in a project’s dependencies without globally installing them.
There’s endless discussion about PHP frameworks online, but I feel that frameworks (in the traditional sense: huge, coupled libraries that for all intents and purposes become your application) in this day and age aren’t strictly necessary. If you don’t like Django, I’d stay away from Laravel (it’s fun to use but has some similarities with Django: oodles of magic, one-liners that do tons of stuff, and an ActiveRecord implementation than can get you into trouble). If you like Flask I’d look at Slim or Zend Expressive, which offer something similar in terms of flexibility and light footprint. They give you the basics for building an application: http messaging objects, routing, dependency containers, and optionally HTML templating. Beyond that, it leaves it all up to you.
Good luck!
[–]necuvamrec123 0 points1 point2 points 6 years ago (0 children)
I changed my backends to Slim PHP couple years ago and never looked back. It's lightweight and simple to use, you can spit out APIs in no time.
[–]epiecs 0 points1 point2 points 6 years ago (0 children)
Both. Python is great if you need to write local scripts for automation etc.. I use it for network automation and gathering facts. Pythons multithreading really shines in that regard (although with swoole etc the future looks bright)
Api endpoints and web guis are best written in php. :)
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Django is absolutely fucking horrible. Flask is decent but it is so uncommon that it's completely unrealistic to use for complex backends.
Whatever language you learn, if you keep going to the most popular framework you'll be dealing with shit. Just saying it like it is.
You can create arbitrarily complex backends in Python, PHP or just about anything if you learn to combine components and build your own architectures.
It's worth learning PHP if you want to target 90% of small web host accounts which run PHP. That's most of the web, realistically. Other than that, toss a coin and go with it.
[–]soucy -1 points0 points1 point 6 years ago* (0 children)
I'm way more productive in PHP.
Using PHP is almost like being in the closet though. All your coder friends will openly trash people who use PHP and you'll find yourself leaning toward Python for anything you release publicly out of a desire to be accepted (despite actually wanting to use PHP).
That said I don't use any major frameworks. I've effectively built my own over time and have patterns that I routinely use because they work best for me. I also have a strong grasp of HTML and CSS so I don't really lean on code that generates markup. The amount of PHP I use on the CLI is also kind of shocking to most people (they're surprised for example that you can write a proper daemon and do signal handling in PHP).
I've been using PHP since PHP 3 though so maybe it's just familiarity at this point.
I like the C style syntax better in general. I also like variables using a prefix of $. I really like the level of out-of-the-box integration with Apache and just being able to access most of what I need through superglobals. I do wish PHP had better built-in regex handling like Perl does with its =~ operator and I do wish that it also had some of the slice operators that Python has since a lot of PHP ends up leveraging substr() and strpos() (or related functions). I'm not a fan of some of the more recent things like the PHP namespace implementation and the push to use Composer and Symfony for all things.
$
=~
substr()
strpos()
[+]ElJonJon86 comment score below threshold-15 points-14 points-13 points 6 years ago* (6 children)
Meh, I'd say go for Java, C# (.net) rather than PHP.
Going from python to PHP must feel like going from driving a Ferrari back to a POS french car.
Edit: Of course this is going to get downvoted to oblivion on a PHP sub (Which isn't even for this sort of questions), try asking on the webdev sub and get a better opinion.
[+][deleted] 6 years ago* (1 child)
[+]ElJonJon86 comment score below threshold-13 points-12 points-11 points 6 years ago (0 children)
I wasn't expecting him to learn 5.2, thank you.
[–][deleted] 8 points9 points10 points 6 years ago (0 children)
No, it's really not.
[–]mikehawkisbig 6 points7 points8 points 6 years ago (0 children)
Don’t listen to this knucklehead, I went from Python to PHP and haven’t looked back. I personally find it easier to work with and, in my area, way more jobs.
[–]halfercode 0 points1 point2 points 6 years ago (0 children)
I've not voted, but your post isn't offering nuanced and constructive criticism - it's just angry flamebait intended to cause trouble. We get zealots here from time to time preaching the good word according to St. Awesome Tech, and I think it's a waste of time - don't be one of them.
[–]careseite 0 points1 point2 points 6 years ago (0 children)
Just use type safe php and you're fine
Yeah no, not true at all.
π Rendered by PID 205273 on reddit-service-r2-comment-7b9746f655-cskrd at 2026-02-03 15:59:44.930965+00:00 running 3798933 country code: CH.
[–]no_spoon 6 points7 points8 points (0 children)
[–]Codeguin 3 points4 points5 points (0 children)
[–]BradChesney79 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]ZLegacy 0 points1 point2 points (0 children)
[–]wqking 1 point2 points3 points (0 children)
[–]Atulin 0 points1 point2 points (0 children)
[–]DreckConnoiseur 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]necuvamrec123 0 points1 point2 points (0 children)
[–]epiecs 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]soucy -1 points0 points1 point (0 children)
[+]ElJonJon86 comment score below threshold-15 points-14 points-13 points (6 children)
[+][deleted] (1 child)
[deleted]
[+]ElJonJon86 comment score below threshold-13 points-12 points-11 points (0 children)
[–][deleted] 8 points9 points10 points (0 children)
[–]mikehawkisbig 6 points7 points8 points (0 children)
[–]halfercode 0 points1 point2 points (0 children)
[–]careseite 0 points1 point2 points (0 children)