Title: PHP Warning: array_key_exists(): The first argument &#8230;
Last modified: May 26, 2022

---

# PHP Warning: array_key_exists(): The first argument …

 *  [al3ilm](https://wordpress.org/support/users/al3ilm/)
 * (@al3ilm)
 * [4 years ago](https://wordpress.org/support/topic/php-warning-array_key_exists-the-first-argument/)
 * PHP Warning: array_key_exists(): The first argument should be either a string
   or an integer in ….. /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.
   php on line 2512
 * error line:
 *  if ( array_key_exists( $base, $schema[‘properties’] ) ) {
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-array_key_exists-the-first-argument%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [al3ilm](https://wordpress.org/support/users/al3ilm/)
 * (@al3ilm)
 * [4 years ago](https://wordpress.org/support/topic/php-warning-array_key_exists-the-first-argument/#post-15682772)
 * Fix the error to:
 *  if ( array_key_exists( intval( $base ), $schema[‘properties’] ) ) {
 *  Thread Starter [al3ilm](https://wordpress.org/support/users/al3ilm/)
 * (@al3ilm)
 * [4 years ago](https://wordpress.org/support/topic/php-warning-array_key_exists-the-first-argument/#post-15682809)
 * Resolved
    -  This reply was modified 4 years ago by [al3ilm](https://wordpress.org/support/users/al3ilm/).

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

The topic ‘PHP Warning: array_key_exists(): The first argument …’ is closed to new
replies.

## Tags

 * [array_key_exists](https://wordpress.org/support/topic-tag/array_key_exists/)
 * [base](https://wordpress.org/support/topic-tag/base/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [al3ilm](https://wordpress.org/support/users/al3ilm/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/php-warning-array_key_exists-the-first-argument/#post-15682809)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
