PHP 5.3 Released
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."
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.
I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
Pffft. If you're going to say that, you had better include the link to the documentation: http://us.php.net/goto
... scroll down.......
So does this mean I should upgrade from PHP 3.2? Are there any incompatibilities with my existing code?
//$login_check = mysql_num_rows($result_login);
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");
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;
}
}
MABASPLOOM!
Guess the only thing missing now is COMEFROM?
I didn't said "exception handling", but "error handling", like linux kernel developers 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.
You can also read the official release announcement instead of some random guy's blog.
http://php.net/releases/5_3_0.php
"Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
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.
Don't blame me, I voted for Baltar.
__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.
I'm god, but it's a bit of a drag really...
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.
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.
Women are like electronics: you don't know how damaged they are until you try to turn them on.