×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

PHP 5.3 Released

timothy posted more than 4 years ago | from the phffp-phffp-phffp dept.

PHP 120

Sudheer writes "The PHP development team is proud to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes. Some of the key new features include: namespaces, late static binding, closures, optional garbage collection for cyclic references, new extensions (like ext/phar, ext/intl and ext/fileinfo), over 140 bug fixes and much more."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

120 comments

Hooray fileinfo is standard! (1, Flamebait)

Majik Sheff (930627) | more than 4 years ago | (#28528427)

Now I don't have to do a song and dance of ugly hacks to get what I need from a file on systems without the extention.

Oh wait, almost any PHP project eventually gets reduced to a song and dance of ugly hacks.

Re:Hooray fileinfo is standard! (2, Funny)

Anonymous Coward | more than 4 years ago | (#28528759)

Oh wait, almost any PHP project eventually gets reduced to a song and dance of ugly hacks.

*sigh* Yes, yes, we know, and Python or insert-your-pet-language-here is a gloriously clean and not-at-all counterintuitive* wonderland of fantasy and enchantment where fairies and elves smile upon you and give you their blessings and unicorns piss rainbows and shit candy.

At least until the next hip, trendy language comes out. How's your Ruby on Rails coding coming along?

*: Obviously, because if anyone finds it counterintuitive and an ugly hack, they are wrong and ugly and stupid and smell funny so there.

Re:Hooray fileinfo is standard! (1, Troll)

thetoadwarrior (1268702) | more than 4 years ago | (#28529439)

I use php and do enjoy it but it is ugly. There is no consistency within the function naming, using -> over . Or any other single symbol is dumb and __construct() but why two underscores? It's unnessary.

Re:Hooray fileinfo is standard! (3, Insightful)

i_ate_god (899684) | more than 4 years ago | (#28530231)

__construct() is a magic method, just like __get(), __set(), __destruct(), __isset(), __toString(), so on and so forth. Magic methods are called without the programmer having to call them, under specific circumstances. In the case of __construct(), it's called when an object is instantiated. '__' defines a magic method and was chosen back in the day because PHP didn't have protected/private members and so the common practice was to prefix private/protected members with one underscore.

PHP was a solution to Perl, so -> is what Perl uses so that's what PHP uses.

The function naming is not so much an issue either. But what is frustrating is argument order. That's something that really needs to be revamped, backwards compatibility be damned.

Re:Hooray fileinfo is standard! (2, Insightful)

not already in use (972294) | more than 4 years ago | (#28530479)

It's funny how people cling to languages for arbitrary and sometimes downright illogical reasons. It's like each language is cool or acceptable in various online social circles. In fact, they can be broken down into their equivalent high school archetype:
  • PHP - The Slackers
  • .NET - The Jocks
  • C - The Goths/Hardcore
  • Ruby - The Hipsters
  • Haskell - The Nerds
  • Java - The drifters

In seriousness, I'm with the OP. I wish the ridiculous language evangelism would stop. In the end, people are just being short sighted and limiting the tools at their disposal.

Re:Hooray fileinfo is standard! (2, Interesting)

K. S. Kyosuke (729550) | more than 4 years ago | (#28531975)

What am I, as a Schemer? A minimalist? A chess player [mit.edu] ? But seriously, I always saw PHP as one of the prime examples of cargo cult language design. "Perl has strings in front of variables, let's copy them, gods will be pleased." Obviously no one cared that in Perl, the sigil has some actual meaning, like in shell, unlike in PHP, where the single type of variables could be handled the same way it is handled in Python, Ruby, stc. And then the adoption of that strange Java-like OOP system, quite weird for a dynamically typed language. Another cargo cult [wikipedia.org] thinking? "Let's make a cargo plane out of wood and straw [flickr.com] , soon the big birds will drop us more crates."

Re:Hooray fileinfo is standard! (1)

jbezorg (1263978) | more than 4 years ago | (#28535061)

Version 1 & 2 of PHP was a Perl library and was originally named "Personal Home Page Form Processor". That's the original source of the sigil in front of the vars ( and the name "PHP" and a lot of other holdovers ). Version 3 was converted to C.

Re:Hooray fileinfo is standard! (0)

Anonymous Coward | more than 4 years ago | (#28535797)

...someone just learned a new word.

Re:Hooray fileinfo is standard! (3, Interesting)

Majik Sheff (930627) | more than 4 years ago | (#28532069)

Thank you, you got the gist of my post.

Every language has its strengths, weaknesses, glaringly awful bits, shiningly wonderful bits, and all of the subculture that go with those things. No language is perfect or even acceptable for every job.

PHP is an extremely organic language. It is the result of hundreds of developers' efforts and the inclusion of many modules that were once addons.

I've been using it since very early version 3.0, so I know why things are named the way they are. That doesn't make them any more consistent and it certainly doesn't make old code that grew up with the language any less correspondingly organic (read ugly and hackish).

Also, you forgot:

C++ - The emo kids
C# - The wannabes
BASIC - Special Education
Brainfuck - The kid who bit someone in third grade and now eats at his own table because he growls slightly too often

etc etc.

I'm hoping I can get a few more Underrated mods, I'd LOVE to have my first +5 Flamebait.

Re:Hooray fileinfo is standard! (0)

Anonymous Coward | more than 4 years ago | (#28532659)

Yes, yes, every X has its strengths and weaknesses. Please don't pretend that means every X is equivalently valuable, useful, or whatever other definition of "good".

PHP's only advantage is its ubiquity, which has nothing to do with the language itself and which is generally irrelevant for anyone doing more than throwing up My Free PHP Bulletin Board on Dreamhost. The language itself irredeemably sucks.

Re:Hooray fileinfo is standard! (1)

ari_j (90255) | more than 4 years ago | (#28533547)

It's sad that Slashdot doesn't have an "accomplishment" for the +5 Flamebait. Everyone should strive for one. Oh, and you should get bonus points if it is not a politics or religion article.

Re:Hooray fileinfo is standard! (1)

dkleinsc (563838) | more than 4 years ago | (#28533059)

Having used PHP along with a whole slew of other languages, what I've generally found is that like most other languages PHP is a bit of a slave to its own history.

For PHP, its origins in dynamic web pages lead it towards results which are quick and often convenient for web designers who are great at making sites pretty, but lacking in design consistency and rigor. Some effects of this are APIs with inconsistent naming and structure compared to other languages, and the prevalence of bad code practices among PHP programmers.

For Java, the academic background surrounding OOP and design patterns means that it tends to over-engineer for things that are theoretically better but in practice are a big pain. Try juggling dates and you'll see immediately what I mean.

For Perl, its roots in sed and awk mean that some of the more incomprehensible syntax (designed to make programs fast to type on a PDP-11) is here to stay.

For Python, it's emphasis on simple syntax means that it's very hard to determine the capabilities of an object just by looking at the code that uses it. Choose bad variable names and you'll be in real trouble.

And so on. In short, all languages suck, but suck in different ways.

Re:Hooray fileinfo is standard! (0, Flamebait)

plague3106 (71849) | more than 4 years ago | (#28528987)

Heh... is it still just inline scripting, or did they come up with embedable contorls, like Asp.net or the java equivolent?

Re:Hooray fileinfo is standard! (1, Offtopic)

nedwidek (98930) | more than 4 years ago | (#28529137)

PHP as I told a manager is useful because it is ubiquitous, not because it is perfect or even particularly good. At the time I worked on a derivative of GForge, which is a definite example of the horrors that can come from PHP projects.

This is also an original quote by me: "The beauty of PHP is that it is so simple even an idiot can program with it. The problem with PHP is that so many idiots do choose to program in it."

In my own hosting, I have the choice of using RoR, but the app must be manually redeployed if the server is restarted. So I use CakePHP instead because PHP will be instantly available. :P

5.3 should be cool, now I just need to start pestering my hosting providers about upgrading.

Re:Hooray fileinfo is standard! (1)

sopssa (1498795) | more than 4 years ago | (#28529607)

5.3 should be cool, now I just need to start pestering my hosting providers about upgrading.

Dude, dedicated server!

I also always pick PHP because its so nice to code with it and because of the box it provides so many different functions from many areas. It saves you lots of time and work if you dont need to always write your own functions for everything or google for a library. This is also why I prefer Delphi over C++.

Re:Hooray fileinfo is standard! (0)

Anonymous Coward | more than 4 years ago | (#28529821)

Oh wait, almost any PHP project eventually gets reduced to a song and dance of ugly hacks.

I thought that was for every scripting language out there.

Now I don't have to do a song and dance of ugly hacks to get what I need from a file on systems without the extention.

Yay, we now have closures and gotos and whatnot to do even more ugly hacking!

Re:Hooray fileinfo is standard! (1)

-noefordeg- (697342) | more than 4 years ago | (#28531747)

Pfffft!

Everything changed with the release of Drupal (written in PHP).
We are creating several large projects each year based on Drupal/PHP and our solutions easily bests any proprietary solutions I've encountered so far.

Re:Hooray fileinfo is standard! (0)

Anonymous Coward | more than 4 years ago | (#28533597)

Apparently you haven't encountered any decent "proprietary solutions" because the code in Drupal is garbage. (Like most open source PHP projects, really.)

PHP - more like PFfffHP (-1, Flamebait)

Anonymous Coward | more than 4 years ago | (#28528467)

Just kidding. I know nothing about your programming language.

All I know is that if you own a Mac you are either gay or bisexual.

Missing Feature. (1)

Zarjazz (36278) | more than 4 years ago | (#28528471)

You forgot the most important change of all.

They added support for "goto".

Re:Missing Feature. (1)

bertoelcon (1557907) | more than 4 years ago | (#28532935)

Yes, adding goto in a language automatically adds multiple levels of awesome.

It doesn't make the code less debug-able at all.

features! (2, Informative)

Lord Ender (156273) | more than 4 years ago | (#28528473)

PHP now comes with more GOTO!

Re:features! (4, Funny)

ScytheBlade1 (772156) | more than 4 years ago | (#28528603)

Pffft. If you're going to say that, you had better include the link to the documentation: http://us.php.net/goto [php.net]

... scroll down.......

Re:features! (1)

tibman (623933) | more than 4 years ago | (#28529655)

hahaha, thanks for that! I can't believe they put that in the official manual. Too awesome

Re:features! (0)

Anonymous Coward | more than 4 years ago | (#28528673)

i think it is great! it signifies that PHP is now the "goto" language for web development. like how some people have a "goto" shirt for a pub night.

now excuse me while i throw up.

 

Re:features! (2, Insightful)

vivaoporto (1064484) | more than 4 years ago | (#28528751)

GOTO has its uses. I never used it (as I prefer a more structured way to code), but critical mission error handling may take advantage of a more direct way to "jump". Anyway, one excepcional addition to the language is closures [php.net] . Real anonymous functions were missing for a long time on the language, and it is great to have it now. Now it is only a matter of our customers' hosting providers to update their versions of PHP. Oh, well, considering most just migrated from PHP 4 to 5 (thanks to the EOL last year), it may take some time.

Re:features! (1)

morgan_greywolf (835522) | more than 4 years ago | (#28529185)

Agreed on the GOTO, but as you say, "critical mission error handling may take advantage of a more direct way to 'jump'". Yet, what is 'structured exception handling' like

try:
        do this
        and that
except:
        do the other thing
finally:
        this

but a syntactic sugar for an "ON ERROR GOTO" like in BASIC?

Re:features! (3, Insightful)

vivaoporto (1064484) | more than 4 years ago | (#28529333)

I didn't said "exception handling", but "error handling", like linux kernel developers [kerneltrap.org] use.

Anyway, exceptions in languages like Java which enforces its treatment in compile time are more than just a "goto error handling". It all depends on the language you are using.

Re:features! (1)

K. S. Kyosuke (729550) | more than 4 years ago | (#28532059)

GOTO has its uses. I never used it (as I prefer a more structured way to code), but critical mission error handling may take advantage of a more direct way to "jump".

Like tail calls instead of gotos? ;-)

Re:features! (3, Funny)

Seth Kriticos (1227934) | more than 4 years ago | (#28528837)

Guess the only thing missing now is COMEFROM?

Re:features! (-1, Offtopic)

Anonymous Coward | more than 4 years ago | (#28529453)

Perverted Homosexual Penetration

That's what PHP stands for.

Professional web developers use genuine Microsoft technologies such as ASP.NET.

Re:features! (0)

Anonymous Coward | more than 4 years ago | (#28533035)

You really want some of that ASS.NET don't you.

Would you let it die already? (0, Troll)

Anonymous Coward | more than 4 years ago | (#28528555)

It's high time we forget about PHP and all it's bain-damaged design

Re:Would you let it die already? (2, Insightful)

MightyMartian (840721) | more than 4 years ago | (#28528723)

I don't think that's quite fair. I think if the functions, calling conventions and naming were regularized, it would be a reasonably decent scripting language. But it's because it suffers multiple personality disorder that it's a horrendous pain.

Re:Would you let it die already? (-1, Troll)

Anonymous Coward | more than 4 years ago | (#28528909)

There is a version of pphp with the functions, calling conventions, and naming regularized. It's called javascript. Or perl. Or 20 other scripting languages that don't look like a second year CS project gone wrong.

Re:Would you let it die already? (4, Insightful)

iluvcapra (782887) | more than 4 years ago | (#28530193)

I think if the functions, calling conventions and naming were regularized

...and they removed the sigils, and removed the silent type coercion, and eliminated the "@" function prefix, and removed the "global" keyword, and removed the weird "list" lvalue function that looks-like-functional-pattern-matching-but-really-just-cosmetically, and fixed the pass-by-reference semantic...

But if you did all of these things, it really wouldn't be PHP anymore.

Re:Would you let it die already? (1)

zuperduperman (1206922) | more than 4 years ago | (#28536367)

You forgot ... create a "terminator" to send back in time and eliminate the millions of moronic PHP hackers who have already created a legacy of horrendous PHP code that the world is now stuck with like radioactive waste from a dirty nuclear bomb.

Honestly, modern PHP used in a correct manner is tolerable ... but the legacy will never go away and nor will the millions of infected PHP coders who will continue to perpetrate the sins of that legacy into the future. Keeping those people out is actually the number one reason I steer clear of PHP whenever possible these days.

Looking Forward To It (4, Insightful)

TheNinjaroach (878876) | more than 4 years ago | (#28528597)

Say what you will about PHP, but it puts food on my table and a good roof over my head. I have been clamoring for the new features in PHP 5.3.0 (closures, namespaces, they finally killed register_globals) and can't wait for the improvements coming in 6.

I truly appreciate the hard work of the PHP development team and the free language they have given us, congratulations on the new release.

Re:Looking Forward To It (0)

Anonymous Coward | more than 4 years ago | (#28528955)

Ruby already has all this and Ruby's syntax doesn't look like Perl, C and Java got together and circle-jerked all over my computer screen...

Re:Looking Forward To It (0, Troll)

FishWithAHammer (957772) | more than 4 years ago | (#28529575)

It's also slow as shit, has bad/no real professional support, and looks even worse than PHP.

Ruby tards are even worse than Python tards.

Re:Looking Forward To It (1)

K. S. Kyosuke (729550) | more than 4 years ago | (#28532559)

1) *Every* language has its tards, 2) Ruby is on par with PHP speed-wise, 3) Ruby does have certain strange features, like name resolution order (never wrapped my brain around that), but that hardly affects how a language *looks* like. 'Nuff said.

Re:Looking Forward To It (1)

nedwidek (98930) | more than 4 years ago | (#28529215)

Hallelujah on the register_globals. At least magic quotes are now deprecated. Here's looking forward to 6.0 when they are finally removed!! (I've talked to way too many devs who think they are adequate protection against SQL injections)

Re:Looking Forward To It (0, Flamebait)

TheRealMindChild (743925) | more than 4 years ago | (#28529235)

PHP is the "new VB". Visual Basic had the stigma that anyone who touched it was a retard and anything produced by it would be retarded. But just like PHP, it was because people with no coding background started with it. It does a whole lot of complicated things for you AND you can still find ways to shoot yourself and coworkers in the face. Ultimately though, if you truly were competent, you could produce some solid work. It's like racism, only toward developers of language X.

Re:Looking Forward To It (1)

Late Adopter (1492849) | more than 4 years ago | (#28529987)

I don't know VB that well, but PHP has plenty of genuine headaches within it: http://www.tnx.nl/php.html [www.tnx.nl]

So yes, while you can write decent programs in PHP, most good programmers (i.e. the ones who understand the problems) don't want to. Even accounting for good programmers who don't have a choice, you end up with a disproportionate amount of the underskilled in the remainder.

Re:Looking Forward To It (2, Insightful)

Ant P. (974313) | more than 4 years ago | (#28531961)

No, no no. PHP is the "new COBOL". It's a horrible language, but it's built up too much inertia to get rid of it or most of its backward-compatibility disasters.

If you want the new VB take a look at Ruby - a language that lets you bring any webserver to its knees in only 5 minutes and 10* lines of code, no experience required.

*plus 800000 lines of framework

Re:Looking Forward To It (1)

TheRealMindChild (743925) | more than 4 years ago | (#28534425)

How many quick, one-off apps were EVER made in COBOL? And your description is also what you could say about C++, Object Pascal, *BASIC, Java, .NET Anything...

Also, VB WAS slow... to the already mentioned "retards". Most of the "slowness" came from constant string concatenation, using implicit type conversions, bad coding practices when instantiating forms with massive ActiveX baggage, Late Binding, COM/Marshaling Transparency, and about 100000 other things that all are avoided by competent people. Visual Basic made it VERY easy to run into these pitfalls and be completely unaware as to why. Blame the developer, however. Not the language.

Re:Looking Forward To It (0)

Anonymous Coward | more than 4 years ago | (#28530257)

It might put a roof over your head and food on the table, but lets face it, as a PHP dev you probably earn peanuts, and both the roof and food are of a shitty quality.

Myself, I use both Microsoft's MVC framework and Ruby on Rails, and earn so much money I don't know what to do with it all. I suggest you ditch PHP and learn something else.

Horray (5, Funny)

neoform (551705) | more than 4 years ago | (#28528643)

So does this mean I should upgrade from PHP 3.2? Are there any incompatibilities with my existing code?

Maybe someone can look over my login script and tell me if this will work in PHP5?

$query_login="select * FROM user";
$result_login = mysql_query($query_login) or die("Your passwrod is might be bad I think");
//$login_check = mysql_num_rows($result_login);
while($row=mysql_fetch_array($result_login))
{
$username=$row["username"];
if ($username==$username1)
{
echo "";
echo "window.location.href='login_error.php?rec=qq';";
echo "";
exit;
}
}

Re:Horray (1, Insightful)

Anonymous Coward | more than 4 years ago | (#28528829)

That's the shittiest login code I've ever seen, and friend, that's saying something.

Re:Horray (0, Redundant)

Ash-Fox (726320) | more than 4 years ago | (#28529135)

So does this mean I should upgrade from PHP 3.2? Are there any incompatibilities with my existing code?

Maybe someone can look over my login script and tell me if this will work in PHP5?

$query_login="select * FROM user";
$result_login = mysql_query($query_login) or die("Your passwrod is might be bad I think");
//$login_check = mysql_num_rows($result_login);
while($row=mysql_fetch_array($result_login))
{
$username=$row["username"];
if ($username==$username1)
{
echo "";
echo "window.location.href='login_error.php?rec=qq';";
echo "";
exit;
}
}

I hope that code is a joke...

Re:Horray (-1, Redundant)

Canazza (1428553) | more than 4 years ago | (#28529229)

damnit i hope so, that's some scary shit right there...

the SQL query is too scary for words, you should be able to check the login details with a single SQL Query and no looping involved...
and if you insist on changing the page location after execution what's wrong with header("Location:login_error.php?rec=qq");?

*shudder*

Re:Horray (0)

Anonymous Coward | more than 4 years ago | (#28530119)

You can hope all you want, but that's better than a lot of legacy PHP code I've seen. Did you know that, for PHP programmers, base64 is a password encryption method?

Re:Horray (1)

neoform (551705) | more than 4 years ago | (#28533191)

They just haven't been introduced to htmlspecialchars() yet. Best damn encryption I've ever seen, and the cool part is you can read some of the encrypted data, that way you can better organize it without having to decrypt it.

Re:Horray (0)

Anonymous Coward | more than 4 years ago | (#28529241)

Some kind of "daily WTF" troll, it seems.

OTOH, I can't imagine PHP article used for anything apart from trolling (like the Perl articles a while back, and Ruby articles one year from now).

Re:Horray (1)

chord.wav (599850) | more than 4 years ago | (#28529901)

STAY AWAY FROM THE KEYBOARD RIGHT NOW!! That's it, easy, let go... That's all gonna be alright... (Pst! Somebody call 911..)

Re:Horray (5, Funny)

Anonymous Coward | more than 4 years ago | (#28530859)

If you can't tell that the parent post is a joke you're probably a PHP programmer.

Re:Horray (1)

jbezorg (1263978) | more than 4 years ago | (#28534995)

LOL... I'm a PHP programmer.

*sigh* Someone a few posts up basically said this: "A language so simple an idiot can us it... so a lot of idiots do.". Sadly, I have to agree. A majority don't know what SQL injection or HTTP Response Splitting is.

My best feature... (2, Funny)

bogaboga (793279) | more than 4 years ago | (#28528701)

...is the ability to employ goto, though it is not allowed to jump into a loop or switch statement. A fatal error is issued in such cases.

Namespaces...about time! (1)

javacowboy (222023) | more than 4 years ago | (#28528705)

The lack of namespaces in any programming language is a massive car wreck just waiting to happen. I once spent a few days trying to resolve an issue with a web portal application with different components brought together where the issue was caused entirely by a function name collision.

Re:Namespaces...about time! (1)

SOOPRcow (1279010) | more than 4 years ago | (#28528743)

Don't get me wrong, I love that they've added namespaces but I hate how they've implemented it with the backslashes.

new features in php 5.3 (2, Informative)

whoisthis (1532893) | more than 4 years ago | (#28529171)

see whats new in PHP 5.3 [webdigi.co.uk] . Namespaces, phar, Closures & Lambdas, Functors, Traits,Magic functions. See link above for examples.

Re:new features in php 5.3 (1)

caseih (160668) | more than 4 years ago | (#28530051)

The backslash name separator looks awful to me, although I've always found PHP code kind of garish with all the dollar signs and curly braces. Although it's at least readable compared to some perl I've seen!

Looking at the "what's new" list I see the cool new feature of php archives. .phar files are zips or tarballs that can be included all at once in your program. Seeing that brings up something I've always struggled with in PHP. When should one use "include," "include_once," "require," or "require_once?" Seems like include normally just inserts the included file into the current source code as if it was there to begin with, no? I guess in the past without namespaces that's probably what most people needed most of the time. And after converting my development wholesale to python with it's inherent namespaces (which are really just singleton objects bound to a local name), it seems like PHP's system is a bit convoluted.

Re:new features in php 5.3 (1)

i_ate_god (899684) | more than 4 years ago | (#28531543)

The backslash name separator looks awful to me, although I've always found PHP code kind of garish with all the dollar signs and curly braces. Although it's at least readable compared to some perl I've seen!

Looking at the "what's new" list I see the cool new feature of php archives. .phar files are zips or tarballs that can be included all at once in your program. Seeing that brings up something I've always struggled with in PHP. When should one use "include," "include_once," "require," or "require_once?" Seems like include normally just inserts the included file into the current source code as if it was there to begin with, no? I guess in the past without namespaces that's probably what most people needed most of the time. And after converting my development wholesale to python with it's inherent namespaces (which are really just singleton objects bound to a local name), it seems like PHP's system is a bit convoluted.

In a nicely made OOP application, you should never have to explicitly use require/include and instead use a class autoloader.

Nuisances (1)

wytcld (179112) | more than 4 years ago | (#28529203)

Let's say you've been using PHP since about a month after Rasmus released it 15 years back, so you've got a whole lot of code that uses the ereg family of regex functions. So they've depricated them, and plan to yank them from PHP 6. Why? Is the overhead so terrible? Or do they really think that it will improve our lives if we have to go back through everything and translate eregs to pregs?

Then there's the change in MySQL password formats. Sure, if they include the latest MySQL libraries they have a different encryption level. But if PHP is smart enough to warn you about that when your MySQL install is still using the older passwords, then PHP should be smart enough to include both libraries and use whichever one is appropriate to the passwords encountered.

There's a huge codebase out there that's using PHP against MySQL, and using PHP's original ereg regex syntax instead of the Perl-wannabe stuff. What are they thinking, when they set out to break this? When 5.3 rolls out through the distros a whole lot of MySQL backends will fail on the password thing. And when 6.0 rolls out millions of regexs will suddenly be failing. Needlessly.

Re:Nuisances (1)

KiltedKnight (171132) | more than 4 years ago | (#28529391)

There's a huge codebase out there that's using PHP against MySQL, and using PHP's original ereg regex syntax instead of the Perl-wannabe stuff. What are they thinking, when they set out to break this? When 5.3 rolls out through the distros a whole lot of MySQL backends will fail on the password thing. And when 6.0 rolls out millions of regexs will suddenly be failing. Needlessly.

Given the current state of the economy, this is how you can help keep PHP programmers employed... and why you have a test environment where you install new stuff like this before deploying it across your platforms... so you can find all of the pitfalls, traps, changes, etc, without causing your site to fall down and go boom.

Re:Nuisances (1)

amicusNYCL (1538833) | more than 4 years ago | (#28529529)

They've been talking about these changes for a long, long time. If you're still using ereg, or register globals, or magic quotes, or whatever else you want to complain about them changing, then that's your problem. If you have important code laying around that you haven't looked through yet, you might want to pencil that in. There's no reason to have PHP4-only code sitting around these days.

Re:Nuisances (1)

tibman (623933) | more than 4 years ago | (#28529845)

Change is almost always painful and scary but you'll be happy for it in the end. Update the code and be glad they don't stay backwards compatable to every iteration of the language.

It's better to clean up and remove the old stuff and continue improving the language. They don't have enough resources to bugfix and improve such a lengthy/aging codebase.

Re:Nuisances (0)

Anonymous Coward | more than 4 years ago | (#28532471)

No, we're supposed to have the resources to do it for every php page on the planet. It sucks. This is why I can't stand PHP.

It's fine if they do this on major releases. 4, 5, 6... but not on point releases. You have to use them for security. It's not cool.

Re:Nuisances (2, Insightful)

DragonWriter (970822) | more than 4 years ago | (#28530055)

There's a huge codebase out there that's using PHP against MySQL, and using PHP's original ereg regex syntax instead of the Perl-wannabe stuff. What are they thinking, when they set out to break this? When 5.3 rolls out through the distros a whole lot of MySQL backends will fail on the password thing. And when 6.0 rolls out millions of regexs will suddenly be failing.

Uh, no.

Assuming that people running and maintaining the code are paying any attention, when 6.0 rolls out, those installations that have working code relying on features long-announced for deprecation that are removed in 6.0 will not upgrade to 6.0.

Major new interpreter versions enable new projects, and old projects can be migrated to them if there is a reason. But they aren't intended to be minor, backward compatible, performance improvement and bug fix releases -- that's why they are called major versions.

Re:Nuisances (3, Informative)

Stan Vassilev (939229) | more than 4 years ago | (#28530483)

There's a huge codebase out there that's using PHP against MySQL, and using PHP's original ereg regex syntax instead of the Perl-wannabe stuff. What are they thinking, when they set out to break this?

Nothing is broken. Ereg is moved to the 'official' extension pack called PECL, which you can use for full backwards compatibility. At the same time the community has been warning not to use the ereg functions for the past at least 3-4 years, if not more, citing worse performance, worse featureset, and the possibility of PCRE replacing it at some point in the future.

Re:Nuisances (1)

atamido (1020905) | more than 4 years ago | (#28533025)

Is there somewhere that lists all of the functions that are about to be deprecated? I've used ereg several times in the past few months and am going to have to go and replace those now. It would be nice to avoid the extra work in the future.

Re:Nuisances (1)

profplump (309017) | more than 4 years ago | (#28531365)

They really think having regex functions that aren't binary safe is a bad idea -- besides the obviously disastrous results when used for input validation it also means that ereg cannot support unicode. Plus it's just extra code that there's little reason to continue patching and porting a decade after it has been superseded by faster, safer functions.

Building object-oriented modular PHP applications (0)

Anonymous Coward | more than 4 years ago | (#28531343)

Separation of concerns is a concept in object-oriented (OO) software design that allows you to build more-modular applications. Modular applications are easier to maintain and add new features to. PHP's OO language features [ibm.com] allow you to apply design concepts to build more robust, maintainable applications.

Re:Building object-oriented modular PHP applicatio (1)

K. S. Kyosuke (729550) | more than 4 years ago | (#28532779)

Separation of concerns is a concept in *all* schools of software design. Only retards think that it was OOP that brought us namespaces, modularity, exceptions, polymorphism and things like that.

The main issue with PHP is highlighted here. (1)

a_karbon_devel_005 (733886) | more than 4 years ago | (#28533769)

The PHP development team has no vision, and they haven't ever had one. It's a hodgepodge that started out to be a "web perl" way back in the day, but then Java developers started using it and so 5 looked more and more Java-esque, but obviously being Java isn't their vision either. Take the namespacing in this release. They are using the BACKSPACE as the namespace separator. It's f'ing awful and inconsistent, but they wanted to jam it into 5.3 ... even though Dimitri had a patch that would have used "::" for the separator, the PHP devs didn't want to use it because it would have to go in PHP 6. That's because, just like the inconsistent library arguments, the PHP developer community, like it's user base, is "practical" .. they will sacrifice correctness for easiness. It's the same reason there's no way to flip a php.ini directive and have annoying warnings/errors turned into exceptions instead... "It's hard (because our codebase is shitty.)" PHP sucks, but it doesn't matter to most. It's too popular. But it does suck because there's no consistent vision for it.

A serious question (1)

lawpoop (604919) | more than 4 years ago | (#28537193)

Can anyone give an example of a good use of lambdas in php? I'd appreciate both 1. A situation where you would *have* to use it ( or the way to do it without lambdas is such an ugly, counter-intuitive hack that no one would do it ), and 2. an example of where you might use lambdas naturally.

I've been trying to figure them out since they were announced for 5.3. I think I understand them, but I don't know whey or where you would want to use them.

Re:A serious question (1, Informative)

Anonymous Coward | more than 4 years ago | (#28537925)

It might be easier to think about them as anonymous functions than as lambdas / closures, though they're both.

They can fit anywhere that used to take a callback. For example, array_walk() and array_map() can be written in a much more sane way, without having to create an external function and refer to it by name.

But PHP is shit! (1)

UK Boz (755972) | more than 4 years ago | (#28538611)

Blah de blah PHP is shit because [insert random piece of php code that a programmer could use if they were a complete fuckwit] Everyone should use [insert my favorite scripting language] because [insert totally irrelevant feature nobody give a fuck about]
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...