Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
PHP Programming

PHP 4.3.0 Released 243

aftk2 writes "PHP.Net has just reported the release of PHP 4.3.0. The update sports a unified method of handling files and sockets, a bundled GD library (for working with images), and finalizes PHP's command line interface. For other information, check out the ChangeLog."
This discussion has been archived. No new comments can be posted.

PHP 4.3.0 Released

Comments Filter:
  • by DragonMagic ( 170846 ) on Friday December 27, 2002 @04:13PM (#4968403) Homepage
    I'll have to recheck this later, but I installed PHP 4.3.0 on a Cobalt RaQ3 over a PHP 4.2.3 install using the same configuration line, simply adding the GD install flags. The PostgreSQL make errored out on the install, when it was compiled in 4.2.3 without a problem. Took it out of the configure line, and it installed fine.

    I really do enjoy having Postgre and MySQL support on the same machine, but for now I guess I'll have to stick with MySQL until I figure this one out.

    But above all, CONGRATS on the changes, PHP team, and please keep up with the good work! It's a great software and a great asset to server administrators, programmers and scripters around.
  • by SweetAndSourJesus ( 555410 ) <JesusAndTheRobot ... .com minus berry> on Friday December 27, 2002 @04:15PM (#4968409)
    Haven't I heard this somewhere [google.com] before?
  • by Davorama ( 11731 ) on Friday December 27, 2002 @04:22PM (#4968473) Journal
    ...this just came in to my inbox. PEAR at version 1.0. Good job folks!
    The new PEAR package PEAR-1.0 (stable) has been released at http://pear.php.net/.

    Release notes
    * set default cache_ttl to 1 hour
    * added "clear-cache" command

    Package Info
    The PEAR package contains:
    * the PEAR base class
    * the PEAR_Error error handling mechanism
    * the PEAR installer, for creating, distributing
    and installing packages

    Related Links
    Package home: http://pear.php.net/package-info.php?package=PEAR
    Changelog: http://pear.php.net/package-changelog.php?package= PEAR
    Download: http://pear.php.net/get/PEAR-1.0.tgz

    - ------------
    Stig Bakken <ssb@fast.no> (lead)
    Thomas V.V.Cox <cox@idecnet.com> (developer)
    Martin Jansen <mj@php.net> (helper)
  • by jmertic ( 544942 ) on Friday December 27, 2002 @04:27PM (#4968509) Homepage Journal
    * The OO of PHP is excellent. In my experience, it rivals Smalltalk. We all know that Perl's OO still needs work (whether or not OO is all that great is another discussion.) Hopefully Perl will be patched up so it supports such must-have OO features like introspection, reflection, self-replication and ontological data-points.

    How is this? PHP's OO is weak and kludged together ( but will be much better come Zend 2/ PHP 5 ).

    I'm not sure if either (a) Smalltalk is horrible ( which from my understanding isn't ) or (b) the parent should be modded +1 Funny. Seriously, putting PHP in the same OO ranks as Smalltalk is like putting a Ford Escort in the same offroad handling ranks as a F-150 truck.

    On a side note, is it just me or is /. really slow right now?

  • Re:That's great (Score:1, Informative)

    by Anonymous Coward on Friday December 27, 2002 @04:28PM (#4968511)
    The reason for this is that many of the PHP extensions are not thread-safe, and could have unexpected behavior when running under Apache 2's multi-threaded model. If you're on UNIX and you wanna use Apache 2 & PHP, use the Worker model. It's the traditional multi-process model.
  • Re:That's great (Score:2, Informative)

    by MmmmAqua ( 613624 ) on Friday December 27, 2002 @04:39PM (#4968564)
    Actually, the prefork MPM module is the old 1.3-style model. Worker is a well-known threading model wherein a "boss" thread delegates work to a pool of "workers" and queues work requests when all workers are busy. Of course, it's more involved than that, and there are several sub-models of the Boss/Worker model, but you get the point.
  • by Kunta Kinte ( 323399 ) on Friday December 27, 2002 @04:42PM (#4968581) Journal
    Most server side scripting engines nowadays employ opcode caching. Code is compiled the first time executed, but run from memory the rest of the time.

    This is different from HTML output caching.

    Opcode caching is said to increase performance by 30-200% depending on the cache code you use and your app.

    With about 30% of apache installs running PHP, and with more than 50% of the web running apache, I'm surprise the PHP does not include an opcode cache with the install.

    That's a lot of wasted cpu cycles :) Just compiling PHP scripts on every page hit.

    There are open source caches out there, see the link in my sig.

  • by soundofthemoon ( 623369 ) on Friday December 27, 2002 @04:44PM (#4968587)

    While MS continues to innovate visual solutions to problems, the open-source community keeps returning to outdated ways of doing things... The idea that you should have to learn the command line interface to a language will end up coming back to bite PHP it the ass.

    Not sure if this is a troll or just a misfire. The optional CLI is an addition to PHP, not something that changes how you use it from web pages. The CLI is a valuable feature. It lets you use PHP as a shell scripting language, rather than being restricted to CGI processing.

    Using the CLI, you can write a wrapper that dumps a PHP-created web page to a static HTML file. Now you can use PHP as an authoring tool for statically served web pages. Nifty!

  • Re:XML? (Score:3, Informative)

    by DragonMagic ( 170846 ) on Friday December 27, 2002 @04:46PM (#4968605) Homepage
    PHP can be configured for XML support, but I've seen PHP move from HTML to XHTML support instead. One thing I'd love to see is a way for an install-level configuration for using XHTML or XML on PHP output. Also, yes, the striptags and htmlentities and such will barf on XML codings, and there should be better support for this, hopefully in 4.4.0
  • by bdesham ( 533897 ) <bdesham@[ ]il.com ['gma' in gap]> on Friday December 27, 2002 @04:53PM (#4968638) Journal
    Why is it that the echo command requires one to escape quotes if PHP is "built for the web?" That has always intrigued me as a fundamental usability flaw.
    The echo command only requires users to escape double quotes when they are placed inside double-quoted-strings:

    echo "PHP is \"built for the web\".";
    echo 'PHP is "built for the web".';

    do the same thing, although the second form is preferred by most because it uses less overhead.
  • Re:XML? (Score:2, Informative)

    by HarrisonFisk ( 624200 ) on Friday December 27, 2002 @05:21PM (#4968813)
    PHP has built in support for expat XML parser [php.net] The parser has come with PHP since PHP 4.0 Beta 4.

    There also is a nice wrapper called XML_parser [php.net] in PEAR. That package is installed by default in PHP 4 I believe.

    If you are going to deal with RSS and RDF stuff, then I definately recommend you check out the PEAR XML_RSS package [php.net]

    I see nothing lacking with PHPs XML support.
  • I can't believe you're saying this.
    The PHP docs are brilliant.
    You just type in the function name, and there are enough examples to get you running until you actually start understanding the language.

    I learnt PHP purely from www.uk.php.net, and I have always found the Java and Perl docs to have too much stuff in them.

    The PHP docs are like this:
    mysql_connect ([hostname],[username],[password]) Returns true if successful.
    What more do you need to know? What goes into a function, what comes out.

    I'm genuinely not trolling here, I'm just surprised that anyone could moan about the PHP docs.
  • by Malcontent ( 40834 ) on Friday December 27, 2002 @08:28PM (#4969928)
    "Ok, lets see, in the same thread there is a post about PHP not having an XML parser of any kind (the author mentions having to use regexp, insane as that sounds), I am assuming that means there is no HTML parser (or an equivalent of HTML::TreeBuilder at that) either.'

    PHP has both SAX and DOM based XML parsers. It also has an xmltree function to instantly build you an object hierarchy from an XML document. There is also the most excellent phpxpath object available here [sourceforge.net]

    "What does PHP use in terms of a browser agent (a la LWP)?"

    It supports fetching from URLs the same way as opening and fetching from files. The new version also has streams. Also it has hooks into CURL for more sophisticated stuff. There is also the excellent snoopy [sourceforge.net] object.

    "Is there really no support simple filebased db persistence? (by which I mean something along the lines of tieing a hash to BerkleyDB)"

    There are hooks into berkley db if you want to sink to that level. If you want to sink even lower then any php variable, array or object can be turned into a string and saved to files or sent to other URLs or what have you.

    "How well does it hook into the other stages of the Apache request handling pipeline?"

    You don't have that much control over the pipeline but you can hook into auth and such. I never needed anything it did not provide.

    "Oh and something I'm curious about (too lazy to look it up, I guess) what sort of exception handling does PHP have (ie it's equivalent of 'try {} catch {} finally {}')?"

    PEAR has a pretty good error handling library. Otherwise you basically just test for errors manually. You call a function with @function which surpresses error messages but sets global error indicators which you can test for. Not great but gets the job done. Version five will have try catch. All in all error handling in php is better then perl and worse then java.

    "What sort of logging modules are available? (log4PHP?)"

    PEAR has a logging class. I know that there are others out there as well. PHP also hooks into syslog if you want that.

    " I'd also be curious to know about how PHP's templating systems measure up, from someone who's had experience with this sort of thing..."

    smarty [php.net] is an outstanding templating engine with caching. I don't see how you could possibly do better. There are numerous others.

    I hope this prevents you from further trolling. Now that you are armed with actual knowledge (which you could have gotten by simple searching) you no longer need to troll here.

  • by aint ( 183045 ) on Friday December 27, 2002 @09:07PM (#4970098)
    This is on the TODO but all the information is included on every man page currently. New parameters and changes to parameters are in the form of notes on each given doc page. So all the information you ask for is already available, just not in a consistant form. Yet. This is a big job, would you like to help? :)

You know, Callahan's is a peaceable bar, but if you ask that dog what his favorite formatter is, and he says "roff! roff!", well, I'll just have to...