r/PHP • • Jul 11 '12

Will all of you noobs PLEASE post elsewhere!? I can't find the good stuff!

11 Upvotes

Would all of you absolute beginners please take your questions elsewhere? I don't know, like /r/phphelp, or maybe, just maybe, StackOverflow where I enjoy helping noobs all the time? (I'm Top 10% in PHP5 over there).

Posts like this need to stop (from the current top 20 posts):

  1. How to display each mysql row in a table column via PHP?

  2. /r/PHP, What's the best way to get this form data into these relational database tables?? I'm stumped.

  3. how can I make script like embed.ly? [REALLY? You don't know the difference between Javascript and PHP?!]

  4. Need some help with PHP and HTML web forms...

  5. Parsing HTML as PHP-CGI

  6. I'm about to /wrists, MySQL string with variables. [Definitely http://codereview.stackexchange.com/]

At the very least, us seasoned professionals grow weary of seeing such VERY BASIC questions on the forums. But heck, if you do have these questions, gather at least 5 others with very basic knowledge of PHP and I'll mentor all of you at once. We could do these sessions once a month and I could get you all up to past this level in about 3 such sessions.


r/PHP • • Jun 21 '19

I am all for donating to PHP and supporting projects. But this is uncalled for and doesn't belong in phpinfo().

1 Upvotes

There is a link in phpinfo() to the patreon of XDebug. https://i.imgur.com/K2khXEQ.png

EDIT: If it is absolutely necessary for you to place your donation link in phpinfo at least link it to your homepage and not directly to an external entity. Also don't make it red with giant font.


r/PHP • • Feb 05 '23

Discussion I hate the deprecation of dynamic properties.

0 Upvotes

Yep. You read that right. Hate it. Even caught this: https://www.reddit.com/r/PHP/comments/r2jwlt/rfc_deprecate_dynamic_properties_has_passed/ where folks largely support this change and someone even commented "I still expect people to complain about this for quite a while". Yet I still post this.

Why?

I see this as a breaking change in code and in the expectations devs have had of the language since they started with it. The worst part is (and ultimately the reason I post this): I don't see the upside of doing it. I mean - I get things change and evolve, but for this?! From my perspective, this doesn't seem like it was all that well thought through.

Now, after reading the comments in the link I posted, I'm guessing you probably disagree - maybe even vehemently. Downvote the snot out of me if you must, but I would call this change a net-negative and I'd go as far as to liken it to python's change to `print` which has companies still relying on 2.7 a decade and a half after 3's release. Not equally - but in effect, it parallels. Suffice to say there will be large swaths of the PHP ecosystem that don't make the jump once this deprecation lands on fatal.

On the other hand, as a freelance dev for a large portions of my career, perhaps I should be thankful; tons of businesses will need help updating their code... But I'm not. These jobs would be absolute monkey work and the businesses will loathe everyone involved in the process. Not to mention they'll think you're an idiot for writing code the way you did... my reputation aside though, I still don't get it.

So help a fellow developer understand why this is a good thing. Why is this an improvement? Outside of enforcing readability and enabling IDE's to punch you in the face before you finish writing whatever line of code you're on, what does this buy us?

Am I the only one who thinks this is a giant misstep?


r/PHP • • Mar 19 '14

I attended the Midwest PHP conference and just finished refactoring 300k code base. I cannot recommend @pmjones new book enough! What motivates you r/php? [testimonial]

0 Upvotes

Talk about motivation! I am going to be buying Paul Jones beers and cigars next time I see him! His talk was called It was like that when I got here and discusses everything every developer goes through.

His recent blog entry also has a video post on the same talk he did in Nashville. I recommend everyone watch this, even veterans. You need to do the following:

My code base TL;DR: Spaghetti monster is becoming tamed by a refactoring machine right now.

The code base I refactored was for a client that I programmed about 5 years ago when I got started in PHP. It is still a spaghetti monster of a mess but I can just now see the light at the end of the tunnel. The code base is HUGE for me and I did it all myself: 300k lines... holy crap... There is definitely copy-pasted noob code in there. I didn't know where to begin. The thing is, every time I would make feature adds and try upselling the client on features... the program would break.

The main function of the program is to handle a manufacturer's quoting, job management, packing lists, payroll, job level reporting, invoicing, etc. It is a full blown system. I always wanted to sell more licenses or installs to clients and more importantly open it up for others. Every time I had a developer look at it I could see them get green in the face. They also always recommended to "nuke it from orbit". Man, I was going to. I was even writing up explanations to the customer a week before about how I had to nuke it and recode it. Until I met Paul and heard his talk on legacy code.

I was motivated. I wrote my autoloader and started testing out the code in production... just kidding :). I started testing it locally and found that moving code into "classes" and removing includes worked beautifully. I got carried away and spent the whole day refactoring and started seeing this amazing MVC structure start to form.

Awesome, I am on my way!

My question for Reddit What talks or people have motivated you in your development world lately? Who are the key influences in your life?

Thanks for reading!


r/PHP • • Jan 28 '16

Why Is Everyone Outraged?

Thumbnail
philsturgeon.uk
18 Upvotes

r/PHP • • Sep 19 '25

Meta This sub should have a rule not to promote Laravel packages.

0 Upvotes

Almost every day, I see developers here promoting their Laravel packages. They forget that this is a framework-specific extension.

This sub is for questions, news and comments on general PHP subjects. Framework-agnostic packages are also welcome to be promoted here. But damn, not everyone uses Laravel. There's also Symfony and about 7128 other frameworks. Use the appropriate sub for that. Thanks.


r/PHP • • Jun 29 '14

Stop abusing arrays in PHP

Thumbnail nomad.so
0 Upvotes

r/PHP • • Mar 27 '22

Discussion Support Ukrainian Developers

4 Upvotes

Hey redditors of the world!
Im a developer from Ukraine, who have created a large community of developers from Ukraine who were effected by war. We are a part of a volunteer IT organization StandForUkraine which includes more than 1,000 specialists in the technical and business fields in Ukraine with average 3-5 years of experience. Our devs specialize in ML, web/app development, and cyber security. Right now Im trying to find projects for the to work on. Ukrainian developers will really appreciate any support from you - if you have some tasks to be done, have a friend who needs some devs, or can just spread a word we will be very thankful to you. Thanks to all of you in advance!

Direct message me please for contact information


r/PHP • • Feb 18 '18

Why mail is dangerous in PHP

Thumbnail
blog.ripstech.com
9 Upvotes

r/PHP • • Jul 07 '26

I keep trying other languages... and somehow always end up back in PHP

2 Upvotes

Over the years I've worked with Java, Python and a few other languages.

They're all good at different things, but somehow I always end up writing PHP again. I guess it just feels like home. Open the project and everything feels so familiar. ))

That gave me the idea to make a funny parody of the one classic hit song (from the 70s), but for PHP developers.

Nothing serious, no language wars – just a bit of fun for anyone who's ever left PHP and then came back.

🎬 https://youtu.be/SoqAP4gSDac

Has anyone else had the same experience like me?


r/PHP • • Jun 23 '17

Kickstart your next PHP command line tool with Laravel Zero

Thumbnail
github.com
4 Upvotes

r/PHP • • Mar 31 '26

Does anyone else prefer developing directly on a VPS instead of local environments?

0 Upvotes

I’ve been hopping between Docker, Lando, and recently Laravel Herd. While they’re great, I keep running into small "environmental drift" issues, extensions behaving differently, or Nginx config tweaks that don't translate perfectly when I move to production.

Lately, I’ve started just spinning up a small $5/mo VPS for my active projects. I use VS Code with the Remote SSH extension, and it feels like I'm working locally but with 1:1 production parity.

My current setup is pretty simple: Just a Ubuntu instance where I've been using Webinoly to handle the LEMP stack and SSL. It’s fast, and since I use the same tool for my prod servers, the deployment is basically a non-event.

I feel like I'm saving a lot of time on DevOps headaches, but I'm curious:

- Am I missing out on some huge benefit of local development?
- What’s your go-to for keeping dev and prod as identical as possible?


r/PHP • • May 24 '26

News A app built 100% in PHP is now live on Google Play and the App Store.

0 Upvotes

Remember that weekend project you never finished?

Mine started as a Saturday "let me try running Laravel inside a Tauri webview" thing some weeks ago. I thought it would be a joke. Today both the iOS and Android Portal apps just hit the stores, and you can boot a real Laravel + Livewire app on your phone in under 10 seconds without compiling anything.


What is NativeBlade

It is a framework that runs your Laravel + Livewire app inside PHP-WASM, packaged as a Tauri 2 native shell. Same Blade, same Livewire components, same Eloquent, same artisan, same routes. Plus the native plugins (camera, biometric, NFC, push, geolocation, haptics, filesystem, clipboard, scanner) exposed through a NativeBlade:: facade.

You write this:

public function checkIn()
{
    return NativeBlade::biometric(fn ($b) => $b->reason('Confirm check in'))
        ->vibrate()
        ->toResponse();
}

And it runs offline, on the device, with the user's fingerprint prompt, and Livewire stays in charge of the UI.


Portal is live on both stores

Portal is the companion app that loads any NativeBlade bundle from a URL. You point it at a hosted bundle or at your laptop running nativeblade:dev, and your app boots in seconds. No Xcode, no Android Studio, no rebuild loop while iterating.


Try it without installing PHP, Laravel, or anything

Install Portal from one of the links above, open it, and paste this URL:

https://nativeblade.github.io/demo-bundle

That URL serves a pre-built Laravel + Livewire bundle the same way php artisan nativeblade:dev --platform=portal would serve your local app, and the same way php artisan nativeblade:bundle packages a bundle for production. The Portal app downloads it, boots PHP-WASM, and you are inside a working app in a few seconds.

When you want to build your own:

composer require nativeblade/nativeblade
php artisan nativeblade:install
php artisan nativeblade:dev --platform=portal --host=192.168.0.10

Scan the QR in the terminal and Portal loads your local app live. Edit a Blade file, watch HMR push the change to the device.


Your AI assistant already speaks NativeBlade

The framework ships a built-in MCP server (Model Context Protocol). Claude Code, Cursor, and Windsurf can connect to it and introspect your live project: which plugins you declared, every method on the NativeBlade:: facade, the architecture recipes, and the framework docs. So instead of the agent hallucinating outdated Laravel patterns, it queries the real source of truth in your repo.

Practical effect: you can ask the AI "build me a checkout screen with biometric confirmation and a barcode scanner" and it will know the exact facade signature, the right Form Object pattern, the state wrapper convention, and the matching Blade components — because the MCP server told it.

To go even faster, point the agent at the right UI kit for your form factor:

  • Mobile — nativeblade/ui-mobile. Konsta-inspired Blade components, iOS and Material themes auto-detected per platform. composer require nativeblade/ui-mobile.

  • Desktop — The README recommends Flux UI (the official Livewire UI kit by Caleb Porzio). Any Livewire-compatible library also works (Filament, mary-ui, TallStackUI, Wireui).

With MCP plus a UI kit, the AI has structural knowledge of the framework and the component vocabulary to use. From zero to working screens is measured in minutes.


What is actually shipping in the box

  • Full Livewire 3 with wire:nb-navigate for native-feeling transitions

  • SQLite on device, auto persisted to IndexedDB so it survives cold starts

  • Cache::* auto wired to the same SQLite, no config

  • Native plugins: camera, gallery, video picker, biometric, barcode/QR, NFC, push (FCM and APNs), geolocation, haptics, clipboard, opener, OS info

  • OTA bundle updates without going through the store

  • Component primitives: header, bottom nav, drawer, modal, safe area, animate, icon, image

  • Codegen for the AppServiceProvider config flowing into the Android manifest, iOS Info.plist, Tauri capabilities, and Cargo features


Why I think this is worth your time

If you already know Laravel and Livewire, you do not need to learn React Native, Swift, Kotlin, or even Tauri internals. You write a Livewire component, you ship it on iOS and Android. The framework handles the bridges.

The repo is here: github.com/NativeBlade/NativeBlade

Docs, recipes, and the architecture guide are in the README. I would love to hear what you try to build with it, and what breaks. Issues, PRs, and "this is dumb because X" comments all welcome.


r/PHP • • Jun 30 '19

THERE ARE 300 PLUS MICRO FRAMEWORKS FOR PHP. WE DON'T NEED ANOTHER ONE FROM YOU.

0 Upvotes

Contribute to existing frameworks or don't, but the last thing we need is another stupid framework that doesn't do anything the others don't do. Your tiny little difference, is pointless.

Yes, i am aware I will downvoted, but seriously we don't need anymore simple pointless projects that are going to be abandoned in 6 months...


r/PHP • • Sep 25 '21

Developing with procedural PHP.

0 Upvotes

Not all of us are fans of OOP boilerplate and ceremony. PHP is a perfectly fine procedural language and a well-organised procedural codebase can be easier to manage in many ways. So, is anyone developing with procedural PHP beyond single-file scripts?


r/PHP • • Mar 07 '18

Why do people release untested open source software as 1.0 in the php community?

5 Upvotes

Serious question. I see this all the time. There's some new Laravel thing, or some new Package for some new feature and it's not tested. It's released as 1.0 to the wild. IMO, that's not even 1.0 that's 0.1 - it's a proof of concept, not a fully fleshed out project. When you ask how they tested it, they respond with "Well it works in such and such project" or "I tested it in the browser" or some other ludicrous example.

I get that some jobs think testing is a waste of time, or time consuming so they only test specific aspects like models or domain logic or even just controllers or in most cases, nothing at all. (most cases being most of my cases in my job experience).

How ever, this is open source, this is a package that potentially (but realistically will never) see tons of stars and have high traffic. So why not test?

IMO: It makes you look unprofessional when you have 0 tests for an open source 1.0 release of some PHP (never mind the language) project.

And don't get me started on documentation and poorly put together Readmes.


r/PHP • • 12d ago

Phast: a drop-in Composer alternative written in Rust (beta, feedback wanted)

5 Upvotes

Hi r/PHP,

I've been a PHP backend engineer for a bit more than a decade, and seeing more and more dev tooling get rewritten in Rust (uv and Ruff for Python, Biome for JavaScript), I thought the PHP community kinda deserves that too.

It wasn't meant to be a big project, and it still isn't! But somehow I've been spending my evenings for about seven months now, after the classic 9-to-5, building Phast, a package manager for PHP. And yes, it's written in Rust. It's a tool in its own right, not a Composer clone :) Batteries included: fast installs, supply-chain safeguards, a TOML manifest you'll actually (read: hopefully) enjoy reading, and monorepos without the path-repository wiring.

It also makes switching painless, just point Phast at your existing composer.json: it installs from Packagist, Private Packagist or Satis, and generates a vendor/autoload.php your app uses exactly as before, \Composer\InstalledVersions included. Nothing in your project has to change to try it, but I'd be extremely grateful for any kind of feedback, as I truly want to get it right.

The numbers, on koel, a real app with 202 packages, one of them pulled straight from a git repository. Median of 5 runs, same machine, scripts off, isolated caches:

cold install (no lock, no cache)   Phast  7.00s   Composer  67.32s
from a lock, empty cache (CI)      Phast  5.20s   Composer  17.17s
warm cache                         Phast  2.16s   Composer   7.41s
nothing to do                      Phast  0.53s   Composer   3.12s

Another example: the Laravel skeleton, where the gap is not that impressive, 2.4x for a cold install, because there's less to resolve and fetch. The benchmark script and the raw runs are in the repo, so you can check it on your own projects.

Beyond speed, there's a readable phast.toml manifest (optional, composer.json works as is), workspaces for monorepos with one lock and one vendor/, phast audit against Packagist and OSV advisories, and resolution errors that tell you which requirement conflicts with which.

Even though it's only a beta, it already covers the CLI commands a developer would find handy in daily work. And of course, it's just the beginning. A package manager is never really done, and there's plenty still to be implemented.

Installation on Linux and macOS is fairly simple:

curl -fsSL https://raw.githubusercontent.com/phast-sh/phast/main/install.sh | sh

Then run phast install in any Composer project.

I'll be more than happy to hear from anyone willing to give it a shot!


r/PHP • • May 23 '25

PHPUnit website redesign: a new look for a historic tool

9 Upvotes

Hi PHP devs,

I'm currently working on redesigning PHPUnit's official website. A must for our projects, but let's face it: its site was no longer up to scratch.

  • Modernized interface

  • Revamped user experience

  • Landing page generated with the help of AI to test a faster, iterative and responsive approach

The main content (the doc) is now elsewhere, so we had to rethink the very function of the site: inform, orient, reassure.

👉 New site : https://phpunit-restyle-project.lovable.app/

Your feedback is welcome: bugs, suggestions, or even harsh criticism. I'll take it all!


r/PHP • • May 25 '18

Always use `/` as directory seperator in php

Thumbnail
dev.to
1 Upvotes

r/PHP • • Jun 10 '21

Using WordPress as a PHP framework

9 Upvotes

I know a lot of real developers will disregard WordPress for many (often subjective) reasons.

I'm a full stack developer, I work a lot with Node.js and frontend frameworks, I know what a framework is, both in the PHP world as well as in other languages.

Nevertheless, I've been using and developing with WordPress for ages. More often than not, WordPress is the best choice for the project at hand because a lot of built-in features just match. We all know the drill, DON'T REPEAT YOURSELF.

What really bothered me when building non-trivial projects is that there are too many moving parts: every 10 minutes, there are plugins that need updating.

On each update, behaviours might change, and it's really a hassle to test everything that often.

I wanted plugins (and WordPress) to be managed like dependencies, the same way it works in npm and composer. So I reached out to composer to manage everything and npm to manage the theme's assets.

It's the kind of workflow you can expect from any modern framework (PHP or JS world) and you get the same kind of performance:

  • tree shaking and code splitting for JavaScript,

  • dynamic loading for CSS,

  • gzip & brotli pre-compression for everything,

  • webp versions of all theme's images.

The starter is called Steroids and takes inspiration from Wordplate, but code splitting and styles dynamic loading is a cinch.

Do you guys have real development experience with WordPress? What's your take on that? Let me know what you think

https://github.com/Buzut/steroids


r/PHP • • Nov 10 '23

Laravel whyyy

60 Upvotes

I'm a PHP developer with 25+ years of experience with PHP. I have been in business since before Symfony was released back in 2005-ish. Have worked with almost every bigger frameworks since then.

The last 15 years i have worked primary with Drupal for projects and Symfony for API's and such.

I have been on quite a few projects made with Laravel, but hell i dont like it. Hate the facades, and the thing where they want to make magic out of default DI.

What I see from the projects i have been on, built with Laravel, it's quite a pile of crap, it's so easy to make ugly code, just like Wordpress.

I know it's not laravels problem, but the developers building projects with Laravel, looks like Laravel could be where you go if you are not an advanced developer.

I know good projects built with Laravel as well.


r/PHP • • Jun 10 '24

News Notice for windows users: Nasty bug with very simple exploit hits PHP just in time for the weekend

Thumbnail
arstechnica.com
3 Upvotes

According to arstechinca.com "A critical vulnerability in the PHP programming language can be trivially exploited to execute malicious code on Windows devices, security researchers warned as they urged those affected to take action before the weekend starts."

I don't know if there are people actually hosting php website on a windows machine, especially with XAMPP, but i feel the need to share this.

I'm sorry If this is already posted.


r/PHP • • Mar 29 '24

Is effective PHP development is possible without PHPStorm/Idea?

0 Upvotes

Just a simple question.

Is effective PHP development is possible without PHPStorm/Idea?

And effective, I mean full autocomplete, template language support, refactor, a lot of inspections, development on the remote host/docker etc.

And if any acceptable alternative is even exist (VS / VS Code maybe), then what about extensibility of it.

P.S. (added) I use PHPStorm for the last 10 year minimum. Tried other editors sometimes but it was incomparable to phpstorm. But maybe now something is changed and some new player appeared on the market