diff --git a/src/wp-includes/compat.php b/src/wp-includes/compat.php
index cabe71d211..1c854a267d 100644
|
a
|
b
|
function array_replace_recursive( $base = array(), $replacements = array() ) { |
| 520 | 520 | * @return bool True if `$var` is countable, false otherwise. |
| 521 | 521 | */ |
| 522 | 522 | function is_countable( $var ) { |
| 523 | | return ( is_array( $var ) || $var instanceof Countable ); |
| | 523 | return ( is_array( $var ) |
| | 524 | || $var instanceof Countable |
| | 525 | || $var instanceof SimpleXMLElement |
| | 526 | || $var instanceof ResourceBundle |
| | 527 | ); |
| 524 | 528 | } |
| 525 | 529 | } |
| 526 | 530 | |
diff --git a/tests/phpunit/tests/compat.php b/tests/phpunit/tests/compat.php
index 0f17b2d7a8..58dafd3ae7 100644
|
a
|
b
|
public function countable_variable_test_data() { |
| 228 | 228 | array( array( 1, 2, 3 ), true ), |
| 229 | 229 | array( (array) 1, true ), |
| 230 | 230 | array( (object) array( 'foo', 'bar', 'baz' ), false ), |
| | 231 | array( new SimpleXMLElement('<xml><tag>1</tag><tag>2</tag></xml>'), true), |
| | 232 | array( new ResourceBundle('en', null), true), |
| 231 | 233 | ); |
| 232 | 234 | } |
| 233 | 235 | |