split deprecated, WHAT THE H...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

split deprecated, WHAT THE H...

Post by yacahuma »

I cant believe they are deprecating split(). I used it ALLL the time. if they are suggesting using preg_split, why not call that function internally and leave the functionality alive??? I smell php creators want to change my php into a complex java like language(where everything simple is removed for something more complex)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: split deprecated, WHAT THE H...

Post by superdezign »

There's a split()? Who knew.
I prefer explode() anyway.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: split deprecated, WHAT THE H...

Post by alex.barylski »

+1 for explode -- unless you need the regex in which case preg_XXX are better solutions.

PHP is moving in the direction that a majority of it's users want it to, a simplified (less convoluted) interface and better consistency, etc.

I strongly suggest you begin porting your code over now and implement a internal split() function which you can mark deprecated and eventually remove from the code completely.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: split deprecated, WHAT THE H...

Post by yacahuma »

in a similar subject preg_split, split and explode, all have a little problem. They all return 1 on an empty string. I never understood why. Easy to make mistakes.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: split deprecated, WHAT THE H...

Post by pickle »

It sounds like they're removing the regular expression engine that powers ereg*, and only using the engine that powers preg*. I'd guess split() uses the former.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: split deprecated, WHAT THE H...

Post by josh »

yacahuma wrote:I cant believe they are deprecating split(). I used it ALLL the time. if they are suggesting using preg_split, why not call that function internally and leave the functionality alive??? I smell php creators want to change my php into a complex java like language(where everything simple is removed for something more complex)
Let's see, would you rather you code started behaving erratically, or you got a PHP error message, when you upgrade
Post Reply