How to fix “The function split() is deprecated in PHP 5.3” on FreeBSD

Saturday, 28th May 2011

If you’re installing some PHP based CMS/blog like (Joomla or WordPress) or some kind of template and suddenly you stumble on a error:

Deprecated: Function split() is deprecated in /usr/local/www/websitedomain/templates/youbizz/html/modules.php on line 78

In order to fix that the file which spits the error message, in my case modules.php needs to be modified and the split php function has to be substituted with explode on every occuring place.

I experienced this error on FreeBSD 7_2 with php version 5.3.5 installed from ports.
This simple fix works fine.

Share this on:

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , ,

4 Responses to “How to fix “The function split() is deprecated in PHP 5.3” on FreeBSD”

  1. Tim Smith says:
    Chromium 12.0.742.112 Chromium 12.0.742.112 Ubuntu 11.04 Ubuntu 11.04
    Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Ubuntu/11.04 Chromium/12.0.742.112 Chrome/12.0.742.112 Safari/534.30

    Just to let everyone know, there are a few functions that were deprecated in 5.3.0 moving from POSIX regexp to PCRE. You can find some details at http://www.php.net/manual/en/reference.pcre.pattern.posix.php.

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      thx for the info Tim

      best!
      Georgi

      View CommentView Comment
  2. Dave McD says:
    Firefox 3.6.7 Firefox 3.6.7 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7 GTB7.1

    I think you just saved me a lot of time fixing a lot of deprecated warnings on a tool I wrote and use about 30 times a day. Scrolling past 100 warnign to get my "news" was frustrating and I wasn't looking forward to hacking on some PHP code… but your fix worked with the edit of 1 file:
    1,$s/split/explode/g
    in vi.

    Thanks for sharing this insight.

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      glad it helped thx for feedback 🙂

      View CommentView Comment

Leave a Reply

CommentLuv badge