Title: Undefined array key | Passing null to parameter
Last modified: June 24, 2025

---

# Undefined array key | Passing null to parameter

 *  Resolved [Pawa Tecnologia](https://wordpress.org/support/users/pawatecnologia/)
 * (@pawatecnologia)
 * [11 months, 1 week ago](https://wordpress.org/support/topic/undefined-array-key-passing-null-to-parameter/)
 * Eu procurei o codigo de vocês no github para abrir uma issue, mas não achei. 
   Então vou postar aqui mesmo.
 * Existem vários `Undefined array key`. que poderia facilmente ser resolvido com
   uma valida se a chave existe no array.
 * Exemplo: em `wp-content/plugins/woo-asaas/includes/split/repository/class-split-
   legacy-repository.php` na linha 13 mudar DE: `return null !== $gateway->settings[
   self::LEGACY_WALLET_COUNT_KEY ];` PARA: `return ($gateway->settings[self::LEGACY_WALLET_COUNT_KEY]??
   null) !== null;` .
 * Tem também um `preg_replace(): Passing null to parameter #3` que é resultado 
   mais uma vez de falta de verificação da existência da chave no array. Lá em `
   wp-content/plugins/woo-asaas/includes/meta-data/class-customer.php` linha 315
   basta mudar DE: `preg_replace( $phone_clean_regex, '', $data['billing_cellphone'])`
   PARA: `preg_replace($phone_clean_regex, '', (string) ($data['billing_cellphone']??''))`
 * Bom isso são so exemplos de implementação existe várias outras formas como fazer
   uma função única que valida a presença da chave no array, etc.
 *     ```wp-block-code
       LOG do servidor:[24-Jun-2025 22:01:14 UTC] PHP Warning: Undefined array key "billing_cellphone" in /site/public_html/wp-content/plugins/woo-asaas/includes/meta-data/class-customer.php on line 315[24-Jun-2025 22:01:14 UTC] PHP Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /site/public_html/wp-content/plugins/woo-asaas/includes/meta-data/class-customer.php on line 315[24-Jun-2025 22:01:15 UTC] PHP Warning: Undefined array key "wallets" in /site/public_html/wp-content/plugins/woo-asaas/includes/split/repository/class-split-legacy-repository.php on line 13[24-Jun-2025 22:01:18 UTC] PHP Warning: Undefined property: stdClass::$split in /site/public_html/wp-content/plugins/woo-asaas/includes/split/repository/class-split-order-repository.php on line 17[24-Jun-2025 22:01:18 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /site/public_html/wp-content/plugins/woo-asaas/includes/split/repository/class-split-order-repository.php on line 17[24-Jun-2025 22:07:21 UTC] PHP Warning: Undefined array key "wallets" in /site/public_html/wp-content/plugins/woo-asaas/includes/split/repository/class-split-legacy-repository.php on line 13[24-Jun-2025 22:09:27 UTC] PHP Warning: Undefined array key "url" in /site/public_html/wp-content/plugins/woo-asaas/includes/webhook/class-webhook-ajax.php on line 199[24-Jun-2025 22:09:27 UTC] PHP Warning: Undefined array key "url" in /site/public_html/wp-content/plugins/woo-asaas/includes/webhook/class-webhook-ajax.php on line 205[24-Jun-2025 22:09:27 UTC] PHP Warning: Undefined array key "api_key" in /site/public_html/wp-content/plugins/woo-asaas/includes/webhook/class-webhook-ajax.php on line 215[24-Jun-2025 22:10:05 UTC] PHP Warning: Undefined array key "wallets" in /site/public_html/wp-content/plugins/woo-asaas/includes/split/repository/class-split-legacy-repository.php on line 13
       ```
   

The topic ‘Undefined array key | Passing null to parameter’ is closed to new replies.

 * ![](https://ps.w.org/woo-asaas/assets/icon.svg?rev=2648015)
 * [Asaas Gateway for WooCommerce](https://wordpress.org/plugins/woo-asaas/)
 * [Support Threads](https://wordpress.org/support/plugin/woo-asaas/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-asaas/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-asaas/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-asaas/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Pawa Tecnologia](https://wordpress.org/support/users/pawatecnologia/)
 * Last activity: [11 months, 1 week ago](https://wordpress.org/support/topic/undefined-array-key-passing-null-to-parameter/)
 * Status: resolved