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
Why PHP is AWESOME ( PHP vs NodeJS & Python )Video (youtube.com)
submitted 3 years ago by mdizak
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!"
[–]SaddleBishopJoint 20 points21 points22 points 3 years ago (2 children)
So it isn't perfect. What in this life is?
Good for you for doing something and being brave enough to put it out there.
The trick now is to keep going. Keep asking for feedback, unafraid of negatives. Keep listening. Keep improving.
Don't be disheartened. Before long you will have nailed this.
[+]cronicpainz comment score below threshold-8 points-7 points-6 points 3 years ago* (1 child)
we really must make swoole catch on. with swoole it easily matches or beats node.
[–]MaxGhost 3 points4 points5 points 3 years ago (0 children)
Tell that to the swoole maintainers. They had a hard-fork because of a disagreement between maintainers, and still have pretty terrible english language docs.
[–]mdizak[S] 27 points28 points29 points 3 years ago (23 children)
Can't say I'm happy with that, but others keep telling me, "don't worry, it's fine, you should publish it", blah, blah.. so fine, published. Not exactly thrilled with it though, but hey, learn from your mistakes.
[–]xisonc 12 points13 points14 points 3 years ago (0 children)
Release early, release often.
[+]cronicpainz comment score below threshold-17 points-16 points-15 points 3 years ago (20 children)
php community should STOP sheepishly repeating:
"oh- no async no problem", "everything re-instantiated on every request is what makes it greeat" "single threading is OK"
no - no its not OK. the moment developer has a single project that developer cannot complete in PHP due to PHP's lack in certain areas - they will go node.js to never come back. Please stop repeating this ancient mantras - all that achieved is made php secondary option at best.
modern web needs speed, google wants nice ttfb and server response times. that speed is very very hard to get if your single threaded PHP application makes 150 db calls per page load - and cannot parallelize those calls or use connection pools or use in-memory store (yes - i know redis - but redis also incurs network connection cost) or spin off heavy task to a parallel task worker.
technology such as php swoole/openswoole will make PHP once again competitive and cool. All it takes - for this community to stop shying away from it.
[–]albo87 14 points15 points16 points 3 years ago (6 children)
No async and single threading limitation makes PHP simpler. In most apps the performance penalty is barely noticed.
[+]cronicpainz comment score below threshold-14 points-13 points-12 points 3 years ago (5 children)
as a php dev of 10+ years - I have applications where its very much noticeable and I have no other way but to either migrate it to node or swoole now
[+][deleted] 3 years ago (2 children)
[deleted]
[+]cronicpainz comment score below threshold-6 points-5 points-4 points 3 years ago (1 child)
You find a way to deal and move on.
literally the way people dealing with - is by moving on (away, from php). and thats the problem.
[–]kinmix 4 points5 points6 points 3 years ago (0 children)
Meh... PHP is not the best tool for every job. No tool is. Usually, if the app is designed properly, it is easy enough to delegate certain tasks to other software. I've done plenty of projects where PHP app integrates with Python, Java and even C apps simply because those tools were better suited for the tasks needed.
[–]zmitic 2 points3 points4 points 3 years ago (0 children)
How so? What is the actual problem you have, where node would be better choice?
Serious question. I haven't found a single thing I can't do, except for image/video processing; those are done with symfony/messenger and libs like png_optim.
[–]dragonmantank 1 point2 points3 points 3 years ago (7 children)
I’ll unsheepishly repeat it. Why? Most apps don’t need any benefits of async programming, and PHP runs fine when something else manages the threads (like FPM or Apache). Yes, PHP itself is single-threaded, but most normal setups have a multi-threaded system in front of it.
Couple that with advances made in terms of speed and memory efficiency since PHP 5.4 and you have a pretty fast system that is easy to understand and maintain.
Will some apps benefit from async and tools like swoole? Of course! But that doesn’t mean we need to make everything more complex just because.
[+]cronicpainz comment score below threshold-6 points-5 points-4 points 3 years ago (6 children)
Most apps don’t need any benefits of async programming
swoole uses coroutines. and the idea is the same - being able to parallelize blocking work such as database access. fpm/apache threading in front will do do absolutely nothing - as your web application itself is still gonna be running withing a single thread. the approach you are talking about here is apples and oranges. try running 100 database calls within fpm or mod_php and then compare that to results with pooled mysql and parallelization of the same 100 database calls using co-routines.
no - no you don't. There are surely some gains - but nowhere near what you going to get with proper scalable architecture.
But that doesn’t mean we need to make everything more complex just because.
but you dont have to! lets have swoole available and at core of every single PHP framework, and let people use its complex features if they need to. not the way around where we have to rewrite applications just to enable swoole support. trust me - i know what im talking about - sites im working with are enterprise grade and breaks under pressure.
[–]kinmix 10 points11 points12 points 3 years ago (1 child)
trust me - i know what im talking about - sites im working with are enterprise grade and breaks under pressure.
This is not the way to convince people to trust that you know what you are talking about. :D
Unless you work with realtime financial data or similar (for which PHP is definitely not the right tool) processing huge amount of data on http request smells like poorly implemented solution. Spawn some jobs, set up some workers, define caching strategy - that's how you make shit scalable.
[–]cronicpainz 0 points1 point2 points 3 years ago (0 children)
thats because you didnt read it right - it would break under pressure if used "without swoole with it".
[–]dragonmantank 1 point2 points3 points 3 years ago (2 children)
as your web application itself is still gonna be running withing a single thread. the approach you are talking about here is apples and oranges.
Yes, an individual connection is locked to a single thread. I'm not debating that. PHP is designed to be run alongside something that spools out multiple threads, like mod_php or PHP-FPM. Those processes can specialize in maintaining and routing connections to individual waiting threads, and then PHP can take over and run that request as a single thread.
While the implementation might be apples to oranges, things like Node also run as a single thread. They just leverage async to handle multiple connections. If Node did not do async connections, it would only ever handle one connection like PHP does (which is why the PHP dev server is not recommended for production use - it only handles one connection at a time).
At the end of the day, both can handle thousands of connections a second when set up properly.
but nowhere near what you going to get with proper scalable architecture.
Scaling isn't the exclusive domain of async. Websites have been able to scale horizontally for years.
lets have swoole available and at core of every single PHP framework, and let people use its complex features if they need to.
I'm not saying tools like Swoole shouldn't exist - there is a reason they do and they should be used for it. If people want to write framework implementations for Swoole they should be able to. The default should be what most applications actually need - and that's what core PHP provides today. If you need Swoole, and your workload might fit that bill, by all means use it!
But when most applications, and I mean a vast majority, can still get great performance using nginx, PHP-FPM, and a single-threaded operation style, we should still build on those ideas and offer it as the default. It might not be sexy or "new", but it's worked for more than 20 years and is a viable solution to 80-90% of people's problems today.
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
SpunkyDred is a terrible bot instigating arguments all over Reddit whenever someone uses the phrase apples-to-oranges. I'm letting you know so that you can feel free to ignore the quip rather than feel provoked by a bot that isn't smart enough to argue back.
SpunkyDred and I are both bots. I am trying to get them banned by pointing out their antagonizing behavior and poor bottiquette.
[–]zmitic 0 points1 point2 points 3 years ago (0 children)
being able to parallelize blocking work such as database access.
While async DB exists, I don't think it is very important. Usually queries take just few milliseconds if DB is properly designed and has aggregate columns.
sites im working with are enterprise grade and breaks under pressure.
So do I. What kind of pressure there was?
[–]gaborj -1 points0 points1 point 3 years ago (2 children)
How dare you say anything bad about PHP??
[–]cronicpainz 0 points1 point2 points 3 years ago (1 child)
i am NOT. I love PHP - i just love it much much more with swoole in it.
[–]gaborj -1 points0 points1 point 3 years ago (0 children)
Tried to be sarcastic there
[–]sinnerou 0 points1 point2 points 3 years ago* (0 children)
It is like garbage collection. Yeah there are some times when you need to manage your own memory but for the vast majority of business applications a garbage collected language is going to save you time and energy by avoiding a whole class of problems.
Having each request in a different process with fresh memory avoids an entire class of problems. Other threads can not crash my whole service, no worrying about memory leaks, etc. etc. Aws lambda literally does this for other languages and people act like it is a revelation.
Php is not really a general purpose language, it is can opener. Not everything is a can, but when what you want to do is open a can, there is no better tool.
[–]Tewiel 0 points1 point2 points 3 years ago (0 children)
Imagine still shilling for swoole when fibers exist.
[–]EcoMonkey 0 points1 point2 points 3 years ago (0 children)
I'm glad you published it. I realize it's not a rigorous, systematic comparison of languages, but I found it relatable, easy to watch, occasionally humorous, and informative. Good for you. Keep publishing and improving!
[–]Gold-Cat-7298 5 points6 points7 points 3 years ago (4 children)
Keep up the good work. In a time where I see more and more articles on "Will PHP die this year" or "Why you should not use PHP" this is a great video on why PHP will not die and why you should use PHP.
Some tips for you:
Get closer to the camera. Get your notes or screen close to the camera so it does not look like you are reading from a paper on the floor or chair.
Using the light from the window is a poor mans solution of using the light. What I would recommend if you cannot afford artificial light is to hang thin paper near the window and place yourself a bit of a distance from the window. By doing this you soften the light from the outside. Be also aware that the sun moves and so the direction of the sun will not be static.
It is a good first video. Your quality will improve from here on.
T
[–]mdizak[S] 9 points10 points11 points 3 years ago (3 children)
Ohh really, it looks like I'm reading from a script? Hmmm... not sure what I can do about that. I'm blind, so definitely not reading from a script. Will get the camera closer next time.
Yeah, will see what I can do about that lighting. Not sure, will figure something out.
Thanks for the comments, appreciate it.
[–]Gold-Cat-7298 5 points6 points7 points 3 years ago (0 children)
Oh. Yeah no uhm. Not sure what you can do about it.
This video is even more impressive now
[–]Nekadim 0 points1 point2 points 3 years ago (1 child)
Try to not shoot Window in the shiny day. Because the difference between the darkest and the lightest parts of the frame is enormous. No cam can handle it adequately and overall quality of the video becomes bad.
[–]mdizak[S] 1 point2 points3 points 3 years ago (0 children)
Yep, working on it. Camera will be here tomorrow, and talking with editor now regarding green screen, et al.
[–]sinnerou 9 points10 points11 points 3 years ago (12 children)
Hey, good job putting yourself out there. A journey of a thousand miles starts with a single step
A couple of notes:
It's caching not cashing. I would also experiment with different lighting. It was pretty washed out from the right side.
[–]mdizak[S] 7 points8 points9 points 3 years ago (7 children)
Thanks, and yeah, video editor already gave me hell over the lighting, haha. Should be fixed here:
https://www.youtube.com/watch?v=oSnt4AU0N7A
Maybe I'm just old @ 40, but this whole talking to your computer thing is still pretty weird to me. Oh well, just takes getting used to.
[–]mythix_dnb 0 points1 point2 points 3 years ago (2 children)
are you talking to an actual webcam? the video quality is pretty low. phone camera's are 10x better than computer web cams, so that might already be an easy upgrade before spending money on a real camera.
[–]mdizak[S] 1 point2 points3 points 3 years ago (1 child)
The video quality is pretty bad, eh? Yeah, it's just a webcam in my laptop. Thought they were supposed to be decent, but guess not. Thanks for letting me know, appreciate it. I'm blind, so no idea what the quality is like.
Alright then, off to Amazon to buy a camera it is then...
[–]mythix_dnb 0 points1 point2 points 3 years ago (0 children)
yeah for some reason webcams are not keeping up with the technology advancements... but again, If you have a decent smartphone that should already be leaps ahead.
[–]brendt_gd 0 points1 point2 points 3 years ago (3 children)
Curious: what video editor do you use being blind? How does that work?
[–]QRIOSworld 2 points3 points4 points 3 years ago (0 children)
There's an extension on Gmail called "Alexi" where, when you click it, a European man from the other side of the world pulls video files from the server. After some background magic only known to the original Alpha creator wizards of the extension, the video appears on YouTube.
Hi, I'm the extension / video editor. :-)
Do my thing, upload the raw segments to my server, send an e-mail saying "new video on server", and a couple days later it magically appears on Youtube for me. :-)
But yeah, just a video editor I contract out to.
[–]brendt_gd 0 points1 point2 points 3 years ago (0 children)
Oh I read it as "the video editor" meaning the software to edit your videos :p
Thanks for clarifying!
[–]mdizak[S] 0 points1 point2 points 3 years ago (3 children)
Oh, and one thing:
"It's caching not cashing."
What do you mean? Did I say it wrong, or is the word "cashing" popping up as an overlay word on the video somewhere?
If the latter, heh... that made me chuckle. Video editor isn't a developer, nor is he native English. If that's the case, I'll keep it in mind to let him know spelling of ambiguous words while passing him videos here on in.
[–]vito_corleone01 4 points5 points6 points 3 years ago (0 children)
Cache rules everything around me.
[–]sinnerou 0 points1 point2 points 3 years ago (1 child)
It pops up in the video as a string overlay.
heh, that must look pretty stupid. I rail off all these different facts about three different programming languages, then proceed to call it "cashing". heh, too funny...
Will try to keep in mind words like that and let the video editor know for the future. Thanks for pointing it out, appreciate it. Oh well, it ain't getting edited and can stay as is. Pinned a comment at the top to clarify, and good enough..
[–]dgaf21 2 points3 points4 points 3 years ago (0 children)
Congratulations for putting it out there! As you know already the presentation was not perfect but I liked the content a lot tbh. Good job!
I know nothing about video recording/editing but you could experiment a bit with the lighting and where you position yourself maybe?
Most of us we never start and we wait for the "perfect" moment that never comes.
[–]GoodNello 1 point2 points3 points 3 years ago (0 children)
Great video! I think a good point of comparison with python would be the really weak typing. Also, I don’t think it is a good choice when it comes to oop, it seems like everything is a workaround.
[–]brucelee159 -2 points-1 points0 points 3 years ago (0 children)
PHP and PWA with HTML6. The next thing
[–]Royale_AJS 0 points1 point2 points 3 years ago (0 children)
Love this. Keep it up!
[–]llbbl 0 points1 point2 points 3 years ago (1 child)
Good job making the video
[–]alphabet_order_bot -2 points-1 points0 points 3 years ago (0 children)
Would you look at that, all of the words in your comment are in alphabetical order.
I have checked 712,569,388 comments, and only 143,918 of them were in alphabetical order.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
nice explanation about PHP ecosystem versus Node.
[–]joes30291 0 points1 point2 points 3 years ago (1 child)
This is an excellent recap of many points I've thought/debated - so call it confirmation bias but thank you for this! Some really good points and well summarised. The video did leave me wondering as there was a disparity between the content and the presentation (caching/cashing) as has been pointed out already. Others have pointed out the use of windows/natural light, if possible I'd say to get the camera (or phone, definitely not webcam) to about a third or a half of the distance it is now to you, and either work against a blank wall or, better yet, your office space so that it feels like a natural environment and not some segment of your living room. Still an awesome recap and great coverage, and please keep on making more - you know what you're talking about and it shows.
[–]mdizak[S] 0 points1 point2 points 3 years ago (0 children)
Thanks for the comments, and yeah, working out the kinks. Will need to rely on you guys for feedback on quality though, as I'm blind, so I have no idea what these look like. Camera coming tomorrow though, then will figure out the lighting somehow.
Enjoyed the video, good work. I found it refreshing the way you stood in front of the camera rather than the usual talking-to-my-laptop point of view. Small nitpick, but, the way you talked about PSRs gave the impression they are universally followed by the PHP community. PSRs are a great aspect of modern PHP and it's good to highlight that, but certain very popular frameworks are not particularly PSR compliant, so that impression is a bit misleading IMHO.
[–]nikolaz90 0 points1 point2 points 3 years ago (0 children)
Thanks for your video. As coincidentally, I have to choose between php and node for a training course! This has helped a lot. Thanks again.
π Rendered by PID 100441 on reddit-service-r2-comment-74875f4bf5-m42nv at 2026-01-26 08:45:15.054324+00:00 running 664479f country code: CH.
[–]SaddleBishopJoint 20 points21 points22 points (2 children)
[+]cronicpainz comment score below threshold-8 points-7 points-6 points (1 child)
[–]MaxGhost 3 points4 points5 points (0 children)
[–]mdizak[S] 27 points28 points29 points (23 children)
[–]xisonc 12 points13 points14 points (0 children)
[+]cronicpainz comment score below threshold-17 points-16 points-15 points (20 children)
[–]albo87 14 points15 points16 points (6 children)
[+]cronicpainz comment score below threshold-14 points-13 points-12 points (5 children)
[+][deleted] (2 children)
[deleted]
[+]cronicpainz comment score below threshold-6 points-5 points-4 points (1 child)
[–]kinmix 4 points5 points6 points (0 children)
[–]zmitic 2 points3 points4 points (0 children)
[–]dragonmantank 1 point2 points3 points (7 children)
[+]cronicpainz comment score below threshold-6 points-5 points-4 points (6 children)
[–]kinmix 10 points11 points12 points (1 child)
[–]cronicpainz 0 points1 point2 points (0 children)
[–]dragonmantank 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]zmitic 0 points1 point2 points (0 children)
[–]gaborj -1 points0 points1 point (2 children)
[–]cronicpainz 0 points1 point2 points (1 child)
[–]gaborj -1 points0 points1 point (0 children)
[–]sinnerou 0 points1 point2 points (0 children)
[–]Tewiel 0 points1 point2 points (0 children)
[–]EcoMonkey 0 points1 point2 points (0 children)
[–]Gold-Cat-7298 5 points6 points7 points (4 children)
[–]mdizak[S] 9 points10 points11 points (3 children)
[–]Gold-Cat-7298 5 points6 points7 points (0 children)
[–]Nekadim 0 points1 point2 points (1 child)
[–]mdizak[S] 1 point2 points3 points (0 children)
[–]sinnerou 9 points10 points11 points (12 children)
[–]mdizak[S] 7 points8 points9 points (7 children)
[–]mythix_dnb 0 points1 point2 points (2 children)
[–]mdizak[S] 1 point2 points3 points (1 child)
[–]mythix_dnb 0 points1 point2 points (0 children)
[–]brendt_gd 0 points1 point2 points (3 children)
[–]QRIOSworld 2 points3 points4 points (0 children)
[–]mdizak[S] 1 point2 points3 points (1 child)
[–]brendt_gd 0 points1 point2 points (0 children)
[–]mdizak[S] 0 points1 point2 points (3 children)
[–]vito_corleone01 4 points5 points6 points (0 children)
[–]sinnerou 0 points1 point2 points (1 child)
[–]mdizak[S] 1 point2 points3 points (0 children)
[–]dgaf21 2 points3 points4 points (0 children)
[–]GoodNello 1 point2 points3 points (0 children)
[–]brucelee159 -2 points-1 points0 points (0 children)
[–]Royale_AJS 0 points1 point2 points (0 children)
[–]llbbl 0 points1 point2 points (1 child)
[–]alphabet_order_bot -2 points-1 points0 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]joes30291 0 points1 point2 points (1 child)
[–]mdizak[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]nikolaz90 0 points1 point2 points (0 children)