remy/jsbin — Issue #101: PHP 5.3 deprecation warning: Function split() is deprecated
Author: bauhouse
Created: 2011-11-20 18:48:17+00:00
State: open

I prefer using the default Apache web server that ships with Mac OS X to installing MAMP. When installing JSBin in localhost on Mac OS X Lion, PHP 5.3 displays deprecation warnings.

Deprecated: Function split() is deprecated in /Users/username/Sites/apps/jsbin/app.php on line 17

As a workaround, I am suppressing the deprecation warnings in the .htaccess file:

php_flag display_errors off

As the use of the [split function is highly discouraged](http://www.php.net/manual/en/function.split.php), the solution is to use the `preg_split` function and replace line 17 with the following:

$request = preg_split('/\//', preg_replace('/^\//', '', preg_replace('/\/$/', '', preg_replace('/\?.*$/', '', $request_uri ))));