dompdf / php-svg-lib

SVG file parsing / rendering library
GNU Lesser General Public License v3.0
1.4k stars 77 forks source link

Fix for PHP7.2 count() #37

Closed lfaoanl closed 6 years ago

lfaoanl commented 6 years ago

PHP changed the way they count by requiring a Countable to be inserted as value for the count() function The _tagStart method tried to count $this->attributes which in somecases equals NULL With the added fix it will ensure it is a valid Countable, it will return an empty array if the value is NULL

My error: ErrorException: count(): Parameter must be an array or an object that implements Countable in ~\vendor\phenx\php-svg-lib\src\Svg\Document.php:259

miguelgf commented 6 years ago

This should be fixed with https://github.com/PhenX/php-svg-lib/pull/27