Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Is anyone using PHP 5.3.0 ? Do you suggest I upgrade ?

1. ## Is anyone using PHP 5.3.0 ? Do you suggest I upgrade ?

Hi,

I am running PHP Version 5.2.9

I just noticed that there is a useful addition to the
the rtrim function that I want to use in 5.3.0.

Should I upgrade the PHP version on my server to %.3 ?

Is it fully stable ?

To go from .2 to .3 I guess there are some majors
improvements ? Maybe more ihe OOP side ?

Anyone using 5.3 ?

• I use it on my dev box at home.
It seems stable. I haven't noticed any issues with it. (other than the escape character being the namespace delimiter) I do like some of the OOP improvements but haven't had much time to play with it yet since I do PHP at work all day and don't want to work when I get home.

• Namespaces rock. Chained with the spl_autoload method, you can then import with a simple:
PHP Code:
 use \Path\To\My\Package AS Package  
Aside from that, I've noticed no instability issues. I've also not noticed any substantial upgrades in the OO environment, though one bug I've seen in an is_interface reporting has been corrected in PHP5.3.0.

What I have noticed is that reflection is more of a pain now. ReflectionClass expects a fully qualified name, so with namespaces you need to know what the namespace is in order to import it o.O. That I do not like, since it will not take out of current scope context - so if you have: use \Path\to\Package AS Package;, you cannot just do \ReflectionClass::export('Package');.

For you're dev box, definitely PHP5.3.0. If you do not have a supporting server, avoid the namespacing.

I won't upgrade yet as it is not for my dev server
and there is not an easy distro for it yet.

The reason it caught my eye was that I saw an upgrade to
rtrim() that I wanted to use (in the Manual).

What I have is a string like this:
"some-category => some-sub-cat"

The only static part of the string is the ' => '
and I want to split out the two parts so that I get,
"some-category" and "some-sub-cat".

What is the most efficient way to do this ?

.

• rtrim hasn't changed since 4.1.
The easiest way to split a string is to use the explode function.
PHP Code:
 $parts = explode(' => ',$strin);// or split them and separate in one step:list($cat,$subcat) = explode(' => ', \$strin);  

•

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•