Modern PHP

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Modern PHP

Post by kaisellgren »

I am wondering if and when PHP might become more "modern". For example, right now all we do is call some global functions that are named with no clear rules. What would you think if PHP 6/7 implements classes for everything we have used previously, like:

Code: Select all

$string = new String;
$test = 'Devnetwork is my home';
$string->explode(' ',$test);
Typing becomes slower, but other than that, I like this kind of approach. Actually, we could achieve this already by the use of our own scripted classes. One could create a string -class, which calls the global functions and implement a lot more new string methods, too.

And what about Exceptions? Many functions return false upon failure and pushes one more entry in the error messages stack. Instead we could have something like:

Code: Select all

try
{
 fopen(...);
}
catch (Exception $e)
{
 // Damn, do something
}
These kind of changes would quite radically affect our code. Anyway, have there been any sort of discussion of any of this?

Right now PHP seems huge mess to me with all its global functions...
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Modern PHP

Post by Benjamin »

Insanity 8O

The naming conventions for the existing functions and argument orders are not standardized. I'll be damned if all the method calls would be. I'd probably quit programming all-together.
Post Reply