phayes / geoPHP

Advanced geometry operations in PHP
https://geophp.net
Other
861 stars 262 forks source link

Fix PHP 8.1 compatibility #190

Open chfoidl opened 2 years ago

chfoidl commented 2 years ago

When using this library with PHP 8.1, a deprecation warning is triggered: fwrite(): Passing null to parameter #2 ($data) of type string is deprecated

This can easily be fixed by type casting the $input variable to string.

See this PR #191

itamair commented 2 years ago

FYI ... as this Github repo looks abandoned, and this issue would also be blocking Drupal Geofield module with PHP 8.1 (https://www.drupal.org/project/geofield/issues/3294152) I solved this (applying the corresponding PR#191) in this new fork: https://github.com/itamair/geoPHP (Packagist: https://packagist.org/packages/itamair/geophp)

BathoryPeter commented 2 years ago

Or take a look at my fork: https://github.com/funiq/geoPHP