Forum Moderators: coopster

Message Too Old, No Replies

why isn't php5 widely offered on shared hosting?

         

dhardisty

1:07 pm on Aug 7, 2005 (gmt 0)

10+ Year Member



Hi php masters,

I love php/mysql, and I'm excited to learn about php5 and especially it's object oriented features.

However, 90% of my work is in a shared hosting environment, where I don't have the luxery of installing php5. My question is, why isn't it implemented more widely? I know upgrading is a pain, but php5 has been around for a while now.

Watching php development, I see that php4 and php5 are being developed side by side. Seems a bit odd. Any thoughts on when, if ever, php5 will become the standard?

thanks,
Dave

ergophobe

2:19 pm on Aug 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is a bit frustrating. I think a huge block is poor integration with CPanel, which so many shared hosts use, and perhaps with other control panel systems.

Also, it's harder to get PHP5 and PHP4 to run next to each other nicely and offer both like most hosts did during the PHP3/PHP4 transition period.

Also, I think it's like the browser upgrade thing. The upgrade from Mosaic to Netscape to Netscape 2 was super fast, slowing by Netscape 3, crawling by Netscape 4 which took forever to get to a level where most people could ignore it. IE5 still does what most people want so most users only upgrade browsers when they buy new computers.

I think PHP is getting like that. Many folks who really care about the OO features in PHP5 are the sort who've switched to Ruby (I keep swearing my next project will be in Ruby...) or something like that, and PHP4 has most features that most users want, not like upgrading from PHP3 to PHP4.

madmac

6:42 pm on Aug 7, 2005 (gmt 0)

10+ Year Member



PHP 5 is still considered by many to be too early in development for production use. 5.1 is still in beta, and 5.0.4 was only released in March.

At this point in time, 4.3 is a better option for production use (even if it doesn't have the OO features).

BTW, you can program in OO in PHP 4. It may be easier to do procedural style in PHP 4, but OO is certainly not impossible or hard to do.

ergophobe

7:05 pm on Aug 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




but OO is certainly not impossible or hard to do.

It depends on what you mean. Since you can't declare properties and methods as private, classes in PHP are essentially function libraries with some built-in data.

It's useful, yes, but there's nothing to stop someone from getting and setting class variables from outside the class, which is much of the point of OO programming - the object should be a black box with a public interface that can be carefully controlled by the class designer. Lose that and you've lost much of the point.

madmac

8:18 pm on Aug 7, 2005 (gmt 0)

10+ Year Member



While it may be true that classes are entirely public in PHP 4, there is nothing to stop you from still design and implementing your classes to have different levels of "visibility", if only by concept. The only *real* difference is that if you do call a "protected" property, you don't get a fatal error.

Also, since PHP scripts are rarely distributed in a compiled state, even with PHP 5's literal visibility OO features, there is nothing to stop someone from changing your code to unprotect the "protected" properties and methods, if you are worried about protecting them for distribution.

Not knocking PHP 5 BTW, as its improvements are a nice step forward; however, if you've been designing and implementing your own classes to be better OO by concept, some of the enhancements are really a moot point.

JamShady

10:27 pm on Aug 7, 2005 (gmt 0)

10+ Year Member



I'm with a host that have no problem running the latest versions of PHP 4 and 5 together (I have PHP 5 set to .php, and 4 set to .php4 on my particular setup, they can customise your own).

I'm not sure if I'm allowed to mention the hosts though, so if someone could clarify, I'll gladly let you know.

[edited by: jatar_k at 11:03 pm (utc) on Aug. 7, 2005]

ergophobe

10:40 pm on Aug 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No hosting recommendations please. We want to keep this forum commercial free and we just don't have a way of separating out the genuine recommendations from the self-promotion.