Forum Moderators: coopster
I pretty much stay away from them until they are released. If I can't use it on a server then it is of no interest yet.
Some of the more major changes include:PHP 5 features the Zend Engine 2. XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library SQLite has been bundled with PHP. A new SimpleXML extension for easily accessing and manipulating XML as PHP objects. It can also interface with the DOM extension and vice-versa. Streams have been greatly improved, including the ability to access low-level socket operations on streams.
some interesting changes
What somewhat concerns me more is this blurb I read recently [us2.php.net]:
PHP 5 no longer bundles MySQL client libraries, what does this mean to me? Can I still use MySQL with PHP? I try to use MySQL and get "function undefined" errors, what gives?Yes. There will always be MySQL support in PHP of one kind or another. The only change in PHP 5 is that we are no longer bundling the client library itself. Some reasons in no particular order:
- Most systems these days already have the client library installed.
- Given the above, having multiple versions of the library can get messy. For example, if you link mod_auth_mysql against one version and PHP against another, and then enable both in Apache, you get a nice fat crash. Also, the bundled library didn't always play well with the installed server version. The most obvious symptom of this being disagreement over where to find the mysql.socket unix domain socket file.
- Maintenance was somewhat lax and it was falling further and further behind the released version.
- Future versions of the library are under the GPL and thus we don't have an upgrade path since we cannot bundle a GPL'ed library in a BSD/Apache-style licensed project. A clean break in PHP 5 seemed like the best option.
This won't actually affect that many people. UNIX users, at least the ones who know what they are doing, tend to always build PHP against their system's libmyqlclient library simply by doing --with-mysql=/usr when building PHP. Windows users may enable the extension php_mysql.dll inside php.ini. Also, copy libmySQL.dll into the appropriate %SYSTEMROOT% directory, just like you do with every other bundled DLL from the dll directory.
Things like this always leave me wondering where this might end up...? And I really hate to hear that maintenance was somewhat lax and falling behind. That's always a confidence booster.
I do look forward to playing with the XML library but I too am nervous about what is meant by dropping the MySQL libraries. Does this mean we won't be using functions like mysql_fetch_array and such?
There will always be MySQL support in PHP of one kind or another.
I agree it should be off by default but disagree that code which relies on it is automatically sloppy or insecure.
I've often thought I should be placing my 'mysql_xxx' functions in a separate config file
For quite a while I have used functions like "db_fetch_array" which in its default form, just calls mysql_fetch_array.
I've been telling myself for a while that I should quit doing this since
- it's a slight performance hit
- I have to remember my custom function's name
- "I'll never switch from mysql really anyway"
Now I'm thinking I'll just stick with the old inefficient way... I guess if anything I do ever starts getting serious traffic, I'll have to rethink that, but for now maintainability rules over speed for me.
Tom