Title: php-scoper getallheaders() conflict
Last modified: March 17, 2026

---

# php-scoper getallheaders() conflict

 *  Resolved [Ryan Neudorf](https://wordpress.org/support/users/ohryan/)
 * (@ohryan)
 * [4 weeks ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/)
 * The `ralouphie/getallheaders` package is a polyfill that defines the global `
   getallheaders()` PHP function. When php-scoper renames it to `ameliavendor_getallheaders()`,
   the global function is never defined, but the Composer autoload file guard (hash`
   7b11c4dc42b3b3023073cb14e519683c`) is still set. This prevents other plugins 
   that depend on the same polyfill from loading their copy, leaving no `getallheaders()`
   function available at all.
 * This causes fatal errors in any plugin that calls `getallheaders()` and loads
   its Composer autoloader after Amelia.
 * `getallheaders` should be excluded from php-scoper.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [urosjovanovic](https://wordpress.org/support/users/urosjovanovic/)
 * (@urosjovanovic)
 * [3 weeks, 6 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18855646)
 * Hello Ryan,
 * Thanks for reporting this. To better understand the issue with the `getallheaders()`
   polyfill and php-scoper, could you please let me know which version of the Amelia
   plugin you currently have installed?
 * This will help us verify the behavior and provide a precise recommendation.
 * Kind regards,
   Uroš
 *  Thread Starter [Ryan Neudorf](https://wordpress.org/support/users/ohryan/)
 * (@ohryan)
 * [3 weeks, 5 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18856933)
 * Hi.
 * So the issue is as follows:
    - The hash for `/ralouphie/getallheaders/src/getallheaders.php` in this plugin
      is `7b11c4dc42b3b3023073cb14e519683c` (you can see that here: [https://plugins.svn.wordpress.org/ameliabooking/trunk/vendor/composer/autoload_files.php](https://plugins.svn.wordpress.org/ameliabooking/trunk/vendor/composer/autoload_files.php)
    - This is the same hash that composer will generated for an unmodified version
      of `ralouphie/getallheaders`.
    - You have modified `getallheaders.php` to rename the funciton, here: [https://plugins.svn.wordpress.org/ameliabooking/trunk/vendor/ralouphie/getallheaders/src/getallheaders.php](https://plugins.svn.wordpress.org/ameliabooking/trunk/vendor/ralouphie/getallheaders/src/getallheaders.php)
    - When another plugin also includes `ralouphie/getallheaders`, if Amelia loads
      first, composer will skip loading that plugin’s version of `ralouphie/getallheaders`(
      since they share hashes).
    - Amelia has renamed `getallheaders()` to `ameliavendor_getallheaders` here:
      [https://plugins.svn.wordpress.org/ameliabooking/trunk/vendor/ralouphie/getallheaders/src/getallheaders.php](https://plugins.svn.wordpress.org/ameliabooking/trunk/vendor/ralouphie/getallheaders/src/getallheaders.php)
    - So when code outside of the Amelia plugin runs and that code needs a `getallheaders()`
      polyfill, it will result in a fatal error due to the method being undefined.
 * Here are some related issues: 
   [https://github.com/composer/composer/issues/7942](https://github.com/composer/composer/issues/7942)
   [https://github.com/humbug/php-scoper/issues/298](https://github.com/humbug/php-scoper/issues/298)
 * It seems that the composer hashing behaviour may have been resolved in php-scoper
   v0.18.0. So rebuilding with the latest version of scope my resolve the issue.
   
   However, in my opinion, it would be best just to exclude `ralouphie/getallheaders`
   from php-scope entirely since it is a polyfill for a PHP core method.
 *  Plugin Support [urosjovanovic](https://wordpress.org/support/users/urosjovanovic/)
 * (@urosjovanovic)
 * [3 weeks, 4 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18857621)
 * Hi Ryan,
 * Thank you for the detailed report. We’ve reviewed the issue with the `ralouphie/
   getallheaders` polyfill and php-scoper. This is a known interaction, and it will
   be resolved in one of the upcoming** **Amelia updates.
 * In the meantime, if you would like us to provide a** **temporary fix so your 
   setup works immediately, just let us know and we can send it over.
 * Kind regards,
   Uroš
 *  Thread Starter [Ryan Neudorf](https://wordpress.org/support/users/ohryan/)
 * (@ohryan)
 * [3 weeks, 4 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18858095)
 * Great news!
 * Due to a platform plugin we run, this is affecting all of our customers who use
   your plugin.
 * What is the temporary fix you’d recommend?
 * Thanks,
   Ryan
 *  Plugin Support [urosjovanovic](https://wordpress.org/support/users/urosjovanovic/)
 * (@urosjovanovic)
 * [2 weeks, 6 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18862110)
 * Hello Ryan,
 * Here is the version of the Amelia plugin containing this fix: [https://we.tl/t-LUw8WY4MrGceGAiX](https://we.tl/t-LUw8WY4MrGceGAiX)
 * Please let us know if you have any other questions.
 *  Thread Starter [Ryan Neudorf](https://wordpress.org/support/users/ohryan/)
 * (@ohryan)
 * [2 weeks, 6 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18862429)
 * Thanks.
 * Will this be available for general release soon?

Viewing 6 replies - 1 through 6 (of 6 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-scoper-getallheaders-conflict%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/ameliabooking/assets/icon-256x256.png?rev=3429091)
 * [Booking for Appointments and Events Calendar - Amelia](https://wordpress.org/plugins/ameliabooking/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ameliabooking/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ameliabooking/)
 * [Active Topics](https://wordpress.org/support/plugin/ameliabooking/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ameliabooking/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ameliabooking/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Ryan Neudorf](https://wordpress.org/support/users/ohryan/)
 * Last activity: [2 weeks, 6 days ago](https://wordpress.org/support/topic/php-scoper-getallheaders-conflict/#post-18862429)
 * Status: resolved