Project

General

Profile

Actions

Bug #19891

closed

split() is deprecated in PHP 5.3

Added by Karsten Dambekalns over 15 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-01-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

split() is depreceted and should be replaced by preg_split()

(issue imported from #M10231)


Files

10231.patch (546 Bytes) 10231.patch Administrator Admin, 2009-01-22 18:08
10231v2.patch (14.6 KB) 10231v2.patch Administrator Admin, 2009-01-22 19:05
Actions #1

Updated by Steffen Kamper over 15 years ago

Hi Karsten,

i think str_split is the better way for replace as it's much faster than preg_split.

btw - i found 77 places, but some of them are JS expressions in php-file.

Is there a list of deprecated functions for 5.3 anywhere?

Actions #2

Updated by Karsten Dambekalns over 15 years ago

There are more split() uses than I found in my first round, yes.

As to the proper replacement - it depends on the use. Could be preg_split() or explode() depending on the split-"pattern". str_split() is probably only in rare cases correct.

I'll prepare another patch.

Actions #3

Updated by Steffen Kamper over 15 years ago

You're right - looking to str_split again it's different as it uses defined length for splitting.

Actions #4

Updated by Michael Stucki over 15 years ago

Fixed in Trunk.

Actions

Also available in: Atom PDF