LookAhead: PHP5 Feature Set

Where we keep all the boring tidbits about the PHPDN site, the news, and what not.

Moderator: General Moderators

Your Favorite PHP5 feature?

__construct(), __descruct(), __clone()
31
20%
Object now passed by reference
22
14%
Abstract classes
7
4%
Interface classes
3
2%
Exceptions, Try/Catch
29
18%
Private, Protected, Public methods and variables
47
30%
instanceof
1
1%
__call()
2
1%
Type checking for Objects
4
3%
__autoload()'ing classes!
11
7%
 
Total votes: 157

jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

LookAhead: PHP5 Feature Set

Post by jason »

Just wanted to get your opinion on the upcoming features for PHP5, and to see which ones you like the best. Vote away, and feel free to discuss.

To get the details on each feature, you can read it here: http://www.phpvolcano.com/articles/php5/index.php

Note: Namespaces are NOT being implemented in PHP5 as of right now.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

I chose Public/Protected/etc, but Interface Classes and the __construct stuff are also highly anticipated.
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Well, yes, everything is highly anticipated on my list as well. However, objects being passed by reference is by far the top of my list. Everything else I can do without. However, being able to pass by reference will make my life so much easier.
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

I love __descruct()...

I needed it lots of times... Changing whole programs, to let it work without it.

But thats history soon....
Cruzado_Mainfrm
Forum Contributor
Posts: 346
Joined: Sun Jun 15, 2003 11:22 pm
Location: Miami, FL

Post by Cruzado_Mainfrm »

ok jason, here is my opinion of how the try/catch should be:

try {
//anything can result false or true
}
except {
//if an error in the try above happened, then this happens too
}
finally {
//i take the name from Delphi(object pascal), and this
//will only happen if there were no errors in try or warnings etc etc
}

hopes the best :D
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

I'm with []InTeR[] on this poll. Having destructors will be nice.
private/protected/public stuff is going to suck, i just don't go along with that idea of hiding things all the time.
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

Hmm.. not sure if I am old fashion or just think different, but I just happen to like the private/public stuff... all these things, OO-related, is a good step towards PHP being capable of running daemons or even desktop applications.. The kind of stuff OO is the most useful for..
User avatar
trollll
Forum Contributor
Posts: 181
Joined: Tue Jun 10, 2003 11:56 pm
Location: Round Rock, TX
Contact:

Post by trollll »

I don't know, for me private/public and everything just seem like part of the picture as far as OO usefulness goes. Definitely a welcome aspect, but I really hope that PHP starts going in the direction of interpreted java. Let it work well from installation to installation and let it f**king work as an OOP language... I could use some good implementations of "try { } catch { }" as well as interfaces. One day we'll get to multiple inheritance, we just need to give them time to sort it out. And if you can't give them time, code it yourself and stop complaining.
vrana
Forum Newbie
Posts: 1
Joined: Thu Jul 03, 2003 3:00 am

PHP 5 by default now without MySQL?

Post by vrana »

:? Does someone know something more about this topic? Or is this ment just for the beta cycle?
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

multiple inheritance is not always a good thing, and in fact, is usally bad. However, for those few times it can be good, thats usually when an Interface is what you really need.
User avatar
BigE
Site Admin
Posts: 139
Joined: Fri Apr 19, 2002 9:49 am
Location: Missouri, USA
Contact:

Post by BigE »

Mmm... I just like PHP5 in general. I hope they take thier time on this release and get everything working great before releasing it... this beta almost seems a little soon in my opinion, but it is very welcome. :) The fact that they are advancing the OOP interface so much is just awesome. I think it's deffinately a step in the right direction.

One thing that's been bugging me tho is all the people that think PHP should look like Java... I disagree with this because PHP needs to become PHP, not a Java look alike. Yes, it could use better OOP still and other things... but it needs to do it's own thing and go it's own direction. Not to start another holy war or anything, but these are just my thoughts. :)
electronerd
Forum Newbie
Posts: 1
Joined: Sun Jul 06, 2003 10:01 pm

Post by electronerd »

There is a problem here. Automatic pass-by-reference is a BAD THING(tm) for old scripts that rely on the old system. Not to mention that this is the exact opposite behavior I have seen in every other language I have seen. I don't see the problem with having to specify pass-by-reference. n00bs should just have to learn to deal with it. Not to mention, what do you do if you want to pass by value?
wolfie2x
Forum Newbie
Posts: 10
Joined: Sun Jul 06, 2003 11:04 pm

Post by wolfie2x »

All the new OOP features are truely great. It's important that all programming languages including PHP, have a common OOP Look&Feel in the future. It might look as if PHP5 is copying Java, but there's nothing wrong in learning from a solid OOP language.
* passing by Reference (by default) is great!
* Exception handling is a must!
* multiple inheritance might cause more bad than good..(interfaces will solve the problem)
btw there aren't any articles/tutorials on using DOM/XML & SQLite with PHP5.. at least a simple intro would greatly help.

* I'm actually in the process of developing a rapid web development framework for PHP5 (like enhydra for Java) and could realy use some help with the DOM/XML changes in PHP5.
thx. :roll:
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

electronerd wrote:There is a problem here. Automatic pass-by-reference is a BAD THING(tm) for old scripts that rely on the old system. Not to mention that this is the exact opposite behavior I have seen in every other language I have seen. I don't see the problem with having to specify pass-by-reference. n00bs should just have to learn to deal with it. Not to mention, what do you do if you want to pass by value?
1. I don't think there are many old scripts that rely on the old system. Anyone that was aware of the old system wouldn't have used it. Generally, BC is being kept.
2. You must not have worked with many other languages if you think PHP is the first to treat objects differently then a normal variable.
3. There ARE problems with having to specify pbf in PHP. The current implementation prevents you from coding certain basic OO functionality. This is not acceptable. Simply put, the current implementation is done poorly (as has been admitted by those who implemented it).
4. n00bs aren't the one's that have the problem. It's the people who are more experienced who are hitting brick walls in PHP.
5. __clone() exists for that very reason.

You may feel your reasons are justified, however, not doing something because of 0.0001% of the users out there need to use functionality that is broken isn't a good reason to not change it. If you really need to pbv as the default mechanism, don't upgrade.
blom
Forum Newbie
Posts: 1
Joined: Tue Jul 29, 2003 3:34 pm
Location: Bergen, Norway

Post by blom »

It'll be nice to have private/protected modifiers for variables and functions.

When reading this forum and other forums I see a lot of people being concerned about PHP evolving into a Java look alike. I don't see the problem. Java is a great language for OO programming. I like the way Java handles things. If PHP can adopt the OO of Java, the speed(and textformatting) of Perl, and still keep its simple syntax, I almost wouldn't consider using Java(JSP) on my projects. (And I love programming Java).

PHP has a great future as an object oriented language.
Post Reply