Stop using the error control operator on filesystem calls (e.g. @unlink())

Created on 25 November 2013, almost 11 years ago
Updated 1 July 2024, 5 months ago

I just wasted half a dozen hours trying to debug why my module's stream wrapper tests were suddenly dying with no output, only to discover that the mysterious silent death was coming from Drupal core's use of the @ operator. I had a typo in my code, which should have caused PHP to throw a nice, descriptive fatal error before dying... but instead PHP said absolutely nothing, and still died.

As you can see in the attached file, core uses the error control operator on over 170 filesystem calls (unlink(), fread(), copy(), etc.), and a few other types of calls. I would like to request that the @ operator be replaced with proper exception handling, so that module authors like myself who are developing stream wrappers don't get bitten by this overpowering language feature.

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
File systemΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States coredumperror

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024