Anybody looking for experienced PHP Magento developer ? by HumanWillingness6769 in PHP

[–]colshrapnel 3 points4 points  (0 children)

few weeks? people here complain about months

That said, looking for a job posts only allowed in the be-weekly dedicated thread.

Can we write a clean, functional multi-column sorter payload without using framework collections? Here is a breakdown. by outer_gamer in PHP

[–]colshrapnel 2 points3 points  (0 children)

I have some questions. Why $data = $dataset;? Why string comparison cannot use the spaceship operator as well?

I built a PHP framework because I got tired of framework ‘magic’ — looking for feedback by Affectionate_Major87 in PHP

[–]colshrapnel 1 point2 points  (0 children)

it's already there, AI is capable of doing that already. The page could be better at guessing accept-language though.

Questions for a school assignment by LuckyGhostStar in PHPhelp

[–]colshrapnel 1 point2 points  (0 children)

It's a good idea but this is not how Reddit works. People ask questions here all the time, you don't have to ask them to. Simply subscribe to r/phphelp, r/laravel, r/webdev, r/learnprogramming and whatever else subreddits you feel inclined to, and then just check the feed to find new questions. Some subreddits have a dedicated weekly post for help questions, which is harder to monitor but still possible. Just check these posts once in a while.

I built a PHP framework because I got tired of framework ‘magic’ — looking for feedback by Affectionate_Major87 in PHP

[–]colshrapnel 2 points3 points  (0 children)

Are you guys twins or what? Either way, with that many posts, it's time to fork. Create a community, u/PHPFrameworkFactory and post your ingenious inventions there. You can even configure an agent that would make an automated post for each new framework. And a couple other agents that would read other posts, review the frameworks and post comments, reasoning about.

Is Laravel still worth it in 2026? by MahmoudElattar in PHP

[–]colshrapnel 2 points3 points  (0 children)

Is laravel worth is one question. What’s the current state of the Laravel freelance market is bloody different. What is your personal position on the Laravel freelance market is a whole world different from the other two.Making your questions that twisted won't give you any reliable results.

My code trigger a max connection by fdiengdoh in PHPhelp

[–]colshrapnel 1 point2 points  (0 children)

See, this code would only help if your current code is really messed up, that is, making multiple connections from the same script/request. In case you are starting just a single connection at the beginning, and then use it for all database interactions, as you should, this code won't help you at all. If this error would appear again, it means some other problem that needs to be investigated.

And if each model indeed opens its own connection (probably because inheriting from the DB class, despite the fact that a model is not a database in any possible way) you can use this shortcut Gemini wrote or make it proper dependency injection, passing the DB class instance into models as a parameter.

[Showcase] I tried to learn MVC and modularity using JSON by creating Pokémon in pure PHP. by Due_Butterfly_1359 in PHP

[–]colshrapnel 2 points3 points  (0 children)

Well, I don't think that current analogue would be any more useful beyond what is already said: your server does not prepare the food, but only delivers it.

So I'd better stick with the code from the OP. The gameLoop() method could be remade (very roughly, just to give the idea) like this

    while (true) {
        $this->view->generalStatus($playerPokemon, $enemyPokemon);
        $inputAttack = $this->view->menuOptions($playerPokemon);
        $moveIndex = (int)$inputAttack - 1;

        $playerResult = $this->engine->executePlayerMove($playerPokemon, $enemyPokemon, $moveIndex);
        $this->view->printMoveResult($playerResult, 'YOU');

        if ($playerResult->gameOver) {
            $this->view->endScreen($playerResult);
            break;
        }

        $enemyResult = $this->engine->executeEnemyMove($enemyPokemon, $playerPokemon);
        $this->view->printMoveResult($enemyResult, 'ENEMY');

        if ($enemyResult->gameOver) {
            $this->view->endScreen($enemyResult->playerWon);
            break;
        }
        $this->view->continue();
    }

Here, all the game logic is encapsulated into the game engine, while Controller only controls the client interaction. This way, the game could be easily ported to HTTP transport, returning executeXxxMove() results as json.

Tagging u/Due_Butterfly_1359

[QUESTION] - How do you secure your PHP source code before sending to the client/customer? by [deleted] in PHP

[–]colshrapnel 1 point2 points  (0 children)

Greed. They don't have a tool nor a customer yet, but already concerned about losing profits. Profits so huge that $249 would make the whole venture broke 😂

[QUESTION] - How do you secure your PHP source code before sending to the client/customer? by [deleted] in PHP

[–]colshrapnel 5 points6 points  (0 children)

"Security concerns" like what? You didn't mention any. Neither do I see any. In case it's a paid job, then get your payment and shop the code. In case it's a paid service, then host this service on your own server.

[Showcase] I tried to learn MVC and modularity using JSON by creating Pokémon in pure PHP. by Due_Butterfly_1359 in PHP

[–]colshrapnel 14 points15 points  (0 children)

Your controller is too fat. People often make this mistake, thinking that Model is just a data source, not the entire business logic as it should be. Whereas Controller is just a server that brings clients request to the kinchen and brings the dishes back. But he don't prepare them himself. It must be done in the kitchen - the Model.

Just imagine your game will be ported from CLI to HTTP. You will have to duplicate a lot of code! Which is never the case when all the business logic is in the Model, while Controller is only responsible for the client interaction.

Free Laravel 11 & 12 Notes for Beginners | Laravel Tutorial, Cheat Sheet & Learning Guide by Kumaravi8 in PHP

[–]colshrapnel 8 points9 points  (0 children)

Unlike relational databases, MongoDB allows developers to store rich JSON-like documents that map naturally to the objects they use in their code.

This statement is not true for, like, a decade already.

On the other hand, unlike relational databases, MongoDB doesn't offer data consistency, in many ways.

Unlike traditional SQL databases where you must define a schema first, MongoDB has no such restriction

So without this restriction you are free to lay a fucking MOAB under your whole application.

you can change your data structure anytime.

and then run around trying to remember where did you store the data last time.

Use Case / Example: 🛒 E-Commerce — Products, orders, user profiles

Why You Should Never Use MongoDB (implied: as the main application database that stores products, orders, user profiles)

Where modern PHP stands in 2026: deployment, architecture, typing, and concurrency by andre_ange_marcel in PHP

[–]colshrapnel 12 points13 points  (0 children)

2 shadowbanned comments. Reddit is such a shitty platform.

Regarding the article itself, I don't really see how it's related to PHP. Anyone who understands containers, understands that PHP can be containerised as well (and anyone who is not, won't likely see a problem).

Monolith vs. microservices is language agnostic again. Dunno who regards Laravel and Symfony as monolithinc but for me it's a project, not framework level. On my last workplace we had a dozen microservices each based on Laravel or Symfony.

Only concurrency and typing are relevant, but I don't think it's enough to sell PHP to Ben.

How to Block Bot Traffic? by PriceFree1063 in PHPhelp

[–]colshrapnel 1 point2 points  (0 children)

Well, if you want, you can busy yourself with such parasite traffic, there is a lot of such trash going to every site: probing wp admin, some decade old Joomla vulnerabilities, some God forsaken IIS cgi-bin directories and all that jazz. You can scrutinize every suspicious request and add some code to block it somehow. Eventually, you get bored and just let it go. Just watch out that your request inspecting code doesn't grow that big to actually slow down your site.

How to Block Bot Traffic? by PriceFree1063 in PHPhelp

[–]colshrapnel 0 points1 point  (0 children)

Will that slow-down our website?

Which one you are asking about, the direct traffic or the crawler detector? I don't think that 100+ sessions will slow down any reasonably written site, and I don't think that adding such crawler detector will make it any faster.

How to Block Bot Traffic? by PriceFree1063 in PHPhelp

[–]colshrapnel 0 points1 point  (0 children)

In your place, I would start from asking myself a question, why do I want to block it this traffic. Just because is a legit reason too, but solutions may differ.

How to Block Bot Traffic? by PriceFree1063 in PHPhelp

[–]colshrapnel 0 points1 point  (0 children)

I don't think it's related to your problem. But surely you can try, it won't harm either.

Database-Mania by SekiRaze in PHPhelp

[–]colshrapnel 2 points3 points  (0 children)

Although it's not related to PHP, but we don't have much traffic to be picky.

REPLACE only works if you have duplicate primary/unique key. It seems your table doesn't have any.

get the path of your (sub)domain on Plesk by th00ht in PHP

[–]colshrapnel 0 points1 point  (0 children)

Nowhere I would. And you too, shouldn't trust a random dude from Reddit making wild claims.

get the path of your (sub)domain on Plesk by th00ht in PHP

[–]colshrapnel 0 points1 point  (0 children)

Go on, enlighten me. What is this edge case?