Page 1 of 1
split deprecated, WHAT THE H...
Posted: Mon Nov 09, 2009 9:58 pm
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)
Re: split deprecated, WHAT THE H...
Posted: Mon Nov 09, 2009 10:09 pm
by superdezign
There's a
split()? Who knew.
I prefer
explode() anyway.
Re: split deprecated, WHAT THE H...
Posted: Mon Nov 09, 2009 10:21 pm
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.
Re: split deprecated, WHAT THE H...
Posted: Tue Nov 10, 2009 4:38 am
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.
Re: split deprecated, WHAT THE H...
Posted: Tue Nov 10, 2009 11:02 am
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.
Re: split deprecated, WHAT THE H...
Posted: Wed Nov 11, 2009 1:22 am
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