PHP Collective
Discussions
Browse discussion posts about PHP.
Newest — sorts discussions by their creation dates, with the newest at the top.
Latest activity — sorts discussions by their reply, creation or edited dates (latest first).
Highest score — sorts discussions by their total votes (highest first).
Your sorting method preferences will be saved.
Best Practices for Rendering Reusable HTML Components in PHP
In PHP, I have been using functions to render reusable HTML components instead of using `include` or `require`. This approach allows me to pass parameters and dynamically modify the generated output. ...
Fig/PSR MailerInterface. Would it be useful?
I've noticed that MailerInterface is a very common interface among frameworks and components. I recently created one myself so that I can provide different adapters for different mailer components in ...
Why do people keep shouting "PHP is Dead" always?
So, there are a lot of toxic devs who keep saying PHP is sh*t and is dead. It has no future etc. But for me, I really love it. So why do some hate it so much? And does it actually have no future? And ...
Best approach for scheduling recurring tasks in PHP?
Hey, community! I'm developing a system in PHP, hosted on a Linux server, and I need to implement recurring tasks, such as executing a job every 7 days or monthly. Since I don’t have much experience ...
What inspired you to program?
Hey everyone, I've been pondering a question for a while now a singular question which is: What inspired you to start programming? For me, it was the realization that there are no boundaries, and I ...
Use seperate settings for S3
In my case in the project I maintain I use S3Client directly and I am looking for a way to make it as a service. Using a 3rd party lib will result a large scale refactor. Also using 3rd party libs is ...
What is Design pattern?
I am little bit confused about design pattern. Is it necessary to use design pattern in every application? If not where we should use and why?
Why does PHP have a "bad reputation" among some developers? Does it still have a strong future?
I’ve often come across developers who dismiss PHP, saying it's outdated or lacking compared to other languages. But personally, I’ve found PHP to be reliable and effective, especially when using ...
Security tips when submitting a form in php
Hello, I would like to ask about submitting a form ( in php ) and the questions I have about it.I hope it will be a comprehensive discussion and everyone will benefit from it. Thank you and I ...
Does it make sense to throw an exception in a try block in PHP?
So, does this code make sense, and if yes, under what circumstances? try { throw new \Exception('First exception...'); } catch (\Exception $e) { throw ...
What are some uses of Enums?
I occasionally come across mention of Enums but I haven't been able to find a good use case for them in my code. Take this example from the PHP documentation: <?php enum SortOrder { case Asc; ...
What Age Do Programmers Typically Reach Their Peak Performance?
I'm curious about the typical career trajectory for programmers in terms of peak performance. Is there a specific age range or number of years of experience after which a programmer is generally ...
Project to help me get a job
I came back to SO in attempt to re-ask this and I saw the 'new' discussions page. This is exactly what I was looking for. I put posts up to 'the coding forums' in attempt to get help with this with no ...
Pros and Cons of JavaScript (Node.js) vs. PHP for Email and File Handling?
I am developing a cloud service application in C++ that interacts with a database (SQLIte3) and manages user accounts, file uploads/downloads, and metadata. While most of the backend functionality is ...
Why use abstract classes when method overriding can achieve the same functionality in php?
I’m trying to understand the practical importance of abstract classes in object-oriented programming, particularly in PHP. From my understanding, abstract classes enforce child classes to implement ...
Simply submit a proposal, get it approved, and publish it.
See how the process works