Fabien Potencier 4d9dc79516 bug #2659 [v1] Fixed counting children of SimpleXMLElement object (webimpress)
This PR was merged into the 1.x branch.

Discussion
----------

[v1] Fixed counting children of SimpleXMLElement object

It works correctly in v1.32 and since v1.33 it is not working correctly.
See: https://github.com/twigphp/Twig/compare/v1.32.0...v1.33.0#diff-d7378002f67a61c458c1de0468eef74fR1265

Test code:
```php
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><doc><elem/><elem/></doc>');

var_dump($xml instanceof \Countable);
echo 'Count: ' . count($xml), PHP_EOL;
echo 'Strlen: ' . strlen($xml), PHP_EOL;
echo 'MB Strlen: ' . mb_strlen($xml), PHP_EOL;
```

Results:
```
bool(false)
Count: 2
Strlen: 0
MB Strlen: 0
```

https://3v4l.org/VvUXG

Commits
-------

4a23bdc3 Fixed counting children of SimpleXMLElement object
2018-03-14 08:27:12 -07:00
2018-03-03 08:22:00 -08:00
2017-07-22 11:19:18 +02:00
2017-08-16 08:18:33 +02:00
2018-01-07 18:54:25 +01:00

Twig, the flexible, fast, and secure template language for PHP
==============================================================

Twig is a template language for PHP, released under the new BSD license (code
and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.

More Information
----------------

Read the `documentation`_ for more information.

.. _documentation: http://twig.sensiolabs.org/documentation
Languages
PHP 99.9%