split deprecated, WHAT THE H...
Moderator: General Moderators
split deprecated, WHAT THE H...
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)
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: split deprecated, WHAT THE H...
+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.
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...
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...
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.
Re: split deprecated, WHAT THE H...
Let's see, would you rather you code started behaving erratically, or you got a PHP error message, when you upgradeyacahuma 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)