Title: PHP Fatal Error
Last modified: June 17, 2026

---

# PHP Fatal Error

 *  Resolved [jornalosaopaulo](https://wordpress.org/support/users/jornalosaopaulo/)
 * (@jornalosaopaulo)
 * [1 month ago](https://wordpress.org/support/topic/php-fatal-error-505/)
 * Hello again!
 * I’m getting an intermittent fatal error logged in my PHP error log:
 *     ```wp-block-code
       PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, false given in .../wp-content/advanced-cache.php:332
   
       Stack trace:
       #0 advanced-cache.php(301): swcfpc_fallback_cache_remove_url_parameters()
       #1 advanced-cache.php(306): swcfpc_normalize_url()
       #2 advanced-cache.php(80): swcfpc_fallback_cache_get_current_page_cache_key()
       #3 wp-settings.php(100): include('...')
       #4 wp-config.php(94): require_once('...')
       #5 wp-load.php(55): require_once('...')
       #6 wp-blog-header.php(13): require_once('...')
       #7 index.php(17): require('...')
       ```
   
 * I looked at the relevant code in advanced-cache.php:
 *     ```wp-block-code
       function swcfpc_fallback_cache_remove_url_parameters( $url ) {
       	$url_parsed       = parse_url( $url );
       	$url_query_params = [];
   
       	if ( array_key_exists( 'query', $url_parsed ) ) {
       		...
       ```
   
 * `parse_url()` returns `false` when given a malformed URL, instead of an array.
   When that happens, `$url_parsed` is `false`, and the `array_key_exists()` call
   on line 332 throws a fatal TypeError instead of failing gracefully.
 * This has happened on two separate dates so far – once on June 6th (4 occurrences
   within the same second), and again today, June 17th (9 occurrences within about
   90 seconds). I haven’t confirmed whether this results in a visible error/downtime
   for visitors on those specific requests, or whether something else recovers the
   page; I only have the error log entries.
 * I was able to correlate the timestamps with my Apache access log and found the
   likely trigger. Around the same second as the fatal errors, a scanner (using 
   curl, port-probing for exposed services) sent requests like:
 *     ```wp-block-code
       GET /:27017
       GET /:27018
       GET /:6379
       GET /:5432
       GET /:8983
       ```
   
 * These are malformed paths – a bare colon followed by a port number, with no hostname
   before it. This kind of string would likely break parse_url() in an unexpected
   way (since the part before the colon can be interpreted as a URL scheme), which
   would explain why $url_parsed comes back as false instead of an array.
 * Could this be patched in an upcoming release?
 * Thanks for your help.

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

 *  Plugin Support [Poonam Namdev](https://wordpress.org/support/users/poonam9/)
 * (@poonam9)
 * [1 month ago](https://wordpress.org/support/topic/php-fatal-error-505/#post-18941393)
 * Hi [@jornalosaopaulo](https://wordpress.org/support/users/jornalosaopaulo/),
 * Thanks so much for reporting this, and for sharing the log details.
 * It looks like certain malformed requests — most likely automated probing/scanner
   traffic — can trigger this error in the fallback cache file. At the moment, it
   seems more likely to result in PHP error log entries than a visible problem for
   regular visitors. That said, it’s still a bug, and we agree it should be handled
   more safely.
 * We’ve logged this internally and will look into making the fallback cache more
   resilient to this kind of request, so it fails safely instead of throwing a fatal
   error.
 * If you’re able to share them, it would also help to know:
    - your PHP version
    - whether you noticed any visible site errors, or only the log entries
 * Thanks again for taking the time to report it.
 *  Thread Starter [jornalosaopaulo](https://wordpress.org/support/users/jornalosaopaulo/)
 * (@jornalosaopaulo)
 * [1 month ago](https://wordpress.org/support/topic/php-fatal-error-505/#post-18942978)
 * Hi, Poonam!
 * My PHP version is 8.3; and I was not able to see if this error interferes with
   the frontend or not, as I noted this only by the log entries.
 * Thanks!
 *  Plugin Support [Poonam Namdev](https://wordpress.org/support/users/poonam9/)
 * (@poonam9)
 * [1 month ago](https://wordpress.org/support/topic/php-fatal-error-505/#post-18943540)
 * Hi [@jornalosaopaulo](https://wordpress.org/support/users/jornalosaopaulo/),
 * Thanks for sharing this information.
 * We’ve forwarded this issue to our development team for review. While we’re unable
   to provide a specific timeline at this moment, rest assured it’s being looked
   into.
 * ​Let us know if we can help with anything else.

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

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

 * ![](https://ps.w.org/wp-cloudflare-page-cache/assets/icon-256x256.gif?rev=3234997)
 * [Super Page Cache – Cloudflare Cache, Page Speed & Core Web Vitals](https://wordpress.org/plugins/wp-cloudflare-page-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cloudflare-page-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Poonam Namdev](https://wordpress.org/support/users/poonam9/)
 * Last activity: [1 month ago](https://wordpress.org/support/topic/php-fatal-error-505/#post-18943540)
 * Status: resolved