Closed (fixed)
Project:
GeoNames
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jan 2012 at 17:36 UTC
Updated:
1 Aug 2012 at 23:51 UTC
Hi
Thank you very much for a useful module
I am running the site on PHP 5.3.6 and it gives me bunch of the following warnings:
---------
Deprecated function: Function split() is deprecated in geonames_metadata_update() (line 67 of [error]
/var/www/mysite/sites/all/modules/contrib/geonames/geonames.module).
--------
Would you consider to change split() call for preg_split()?
For example:
Current code: $object = array_combine($field_names, split("\t", $line));
Code without warnings: $object = array_combine($field_names, preg_split('/\t/', $line));
What do you think?
Thank you
Comments
Comment #1
mgiffordAgreed.. This is definitely worth doing.
EDIT: Actually, it looks like it's already gone from the git repository.
Comment #2
mossy2100You don't need to replace split() with preg_split() in this instance, as these are not regular expressions. explode() is faster as it doesn't incur the overhead of the regular expression engine.
Comment #3
lyricnz commentedThat function has been explode() since May 10th 2011, just after the last official release. I'll make a new release today, once I look through the issue queue a bit more.