mikeb16 May 2026 01:05

PHP 8.5 deprecates the backtick operator for shell execution. It generates E_DEPRECATED now and will be a fatal error in PHP 9. The fix is to replace backtick expressions with shell_exec() calls.

Laravel itself does not use the backtick operator anywhere in the framework, so if you are only using stock Laravel your upgrade path is clean. The issue is application code: old Artisan commands written years ago sometimes use backticks to run system commands. Also worth checking bootstrap scripts, custom queue workers, and any CLI helpers in your project.

The Laravel-specific gotcha I saw mentioned elsewhere: some developers accidentally write things like $result = describe {$table} thinking it is SQL syntax when it is actually a PHP shell execution. Those are both bugs and now deprecated.

Replies (3)
vova16 May 2026 01:58

We had backtick usage in two Artisan commands that called ffmpeg and imagemagick. Replaced with shell_exec() and proc_open() for the one where we needed to capture stderr separately. Took about an hour across the whole codebase.

0
andriy_m16 May 2026 03:05

To find all backtick usages in PHP files: grep -rn ‘' --include="*.php" . will produce a lot of noise because backticks appear in docblocks and markdown. Better to search for the operator pattern specifically: grep -Prn '(?<![^])[^]’ will narrow it down.

0
serhiit16 May 2026 04:10

Laravel Pint and PHP CS Fixer both have rules that can detect the backtick operator. If you run either in your CI you can add those rules and catch any new occurrences automatically. Easier than a one-time grep for ongoing prevention.

0
Write a reply
Markdown. ```php blocks are runnable.