Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
PHP Programming

PHP5 Just Around the Corner 85

HitByASquirrel writes "Just doing the rounds and I found that Zend has released PHP 5.0 Beta 4: 'This fourth beta of PHP 5 is also scheduled to be the last one (barring unexpected surprises, that did occur with beta 3). This beta incorporates dozens of bug fixes since Beta 3, rewritten exceptions support, improved interfaces support, new experimental SOAP support, as well as lots of other improvements, some of which are documented in the ChangeLog.' Hopefully they won't have any 'unexpected surprises' and we'll see this before summer!"
This discussion has been archived. No new comments can be posted.

PHP5 Just Around the Corner

Comments Filter:
  • by Anonymous Coward
    forgive the ingnorance guvnah, but what were the unexpected surprises from Beta 3?
    • his fourth beta of PHP 5 is also scheduled to be the last one (barring unexpected surprises, that did occur with beta 3).

      this release is supposed to be the last beta for 5.0, and the next release should be a production one, the surprise isn't in the beta itself, the author wants the production release to be next, and not another beta.

  • by dostick ( 69711 ) on Monday February 16, 2004 @09:26AM (#8293002) Homepage Journal
    The much-requested feature of Upload progress did not make in PHP5.0
    Too bad. Now we need to wait until PHP5.1 or something.
    And meanwhile stick with PHP sourcecode patch or perl method which is nightmare.
    • by Anonymous Coward
      It tells you something that PHP coders are crying for upload progress bar, while environment lacks basic appserver features like connection pooling.
  • by ajagci ( 737734 ) on Monday February 16, 2004 @09:30AM (#8293022)
    Does every little scripting language have to repeat the same mistakes? Lisp 1.5 thought it could get by without. Perl did. Python did. Lua did. In the end, they all added them.

    Come on, guys, learn something from history, avoid making the same mistakes over and over again, and add lexical closures to PHP.
    • Please elaborate on this concept.
      • Please elaborate on this concept.

        Closure (programming) [wikipedia.org]

      • by FrangoAssado ( 561740 ) on Monday February 16, 2004 @11:49AM (#8294132)
        Well, for a quick and simple example, instead of writing

        function f($a, $b) { return strcmp($b, $a); }

        usort($array, 'f');

        you could just write something like

        usort($array, function ($a, $b) { return strcmp($b, $a); });

        With this, functions would be first-class objects, which probably complicates the internals of the language, but it could be added when the reestructuring for improved OOP was done.
        • by gid ( 5195 ) on Monday February 16, 2004 @12:25PM (#8294524) Homepage
          So what's the matter with doing it the old way?

          Maybe I'm missing something, but it seems defining the function inline makes the code less readable, and more cluttered. PHP isn't really about being able to mimick the perl one line "goodness". Written properly, php code is very readable and easily maintainable. If feel that's one of the major reasons for it's popularity.

          That and the low learning curve and excellent online docs. I have a one stop shop for php documentation. I rarely need any other docs besides php.net/searchstring
          • by ajagci ( 737734 ) on Monday February 16, 2004 @06:15PM (#8298394)
            So what's the matter with doing it the old way?

            The matter is that (1) you are referring to functions by their name, not as an object, and (2) that you can only write functions that refer to global variables.

            Maybe I'm missing something, but it seems defining the function inline makes the code less readable,

            Lexical closures have nothing to do with whether the function is written in-line or not. It has to do with functions being data objects rather than strings, and it has to do with variables being resolved correctly.

            Just think about this snippet for a moment:
            function mysort($array,$direction) {
            $compare = function($a,$b) {
            return $direction * strcmp($a,$b);
            }
            return usort($array,$compare);
            }
            That's how things should work.
        • usort($array, function ($a, $b) { return strcmp($b, $a); });
          Well, you can already do:

          usort($array, create_function('$a,$b', 'return strcmp($b, $a);');

          Which is relatively close.
          • Let's say I write:
            usort($array, create_function('$a,$b', 'return $direction*strcmp($b, $a);');
            Which variable does $direction refer to?

            Doing function pointers right isn't hard and the current design only has disadvantages. Why is this still not fixed in the fifth major version of PHP?
      • by scrytch ( 9198 ) <chuck@myrealbox.com> on Monday February 16, 2004 @12:05PM (#8294293)
        <? function a() { echo 'all work and no play makes jack a dull boy '; a(); } ?>


        The question is, does PHP have tailcall elimination, or does jack blow the stack?
    • by Tablizer ( 95088 ) on Monday February 16, 2004 @01:24PM (#8295162) Journal
      The vast majority of things that closures would be used for can be done with "eval()" and "execute()" like functions that evaluate in context. Although they may not be as "clean" as pure closures, eval and execute are conceptually simple and will do the job for the occassional times dynamic execution is needed. Closures just tend to frighten away people from a language. Closures == "those damned math nerds got their fingers into it" :-)
      • The vast majority of things that closures would be used for can be done with "eval()" and "execute()" like functions that evaluate in context.

        Closures aren't "used for anything", they just give the language straightforward and sensible semantics, as opposed to the mess that results when you name functions by strings, like PHP does.

        Although they may not be as "clean" as pure closures, eval and execute are conceptually simple and will do the job for the occassional times dynamic execution is needed.

        What
        • Closures aren't "used for anything", they just give the language straightforward and sensible semantics, as opposed to the mess that results when you name functions by strings, like PHP does.

          In other words, you don't like the syntactic sugar. PHP has the mechanism, you just don't like it's looks. And you're surprised that this isn't a hot issue in the development of the language?

    • Come on, guys, learn something from history, avoid making the same mistakes over and over again, and add lexical closures to PHP.

      PHP has create_function() [php.net].

    • I hate it when I think I'm smart and then somone starts talking about lexical closures and I have _NO_ idea what he is talking about... I'm not a CS major though.
  • PHP5 References (Score:5, Informative)

    by djace ( 641019 ) on Monday February 16, 2004 @10:04AM (#8293222) Homepage
    Yeah, sure, "just around the corner". That's what they said a year ago :P

    Some interesting slashdot PHP5 references:
    "PHP5 is well under development and a beta is expected out by March 2003 and released summer 2003" [slashdot.org]
    Introduction to PHP5 [slashdot.org]

    General PHP5 References:
    Changes in PHP 5/Zend Engine 2.0 [php.net]
    Pidget: The PHP Widget Library [pidget.org]
  • PHB (Score:3, Funny)

    by bayankaran ( 446245 ) on Monday February 16, 2004 @12:04PM (#8294286)
    Is it only me...I read 'PHB just around the corner'.
  • How much will it cost for the add-ons necessary to run PHP on a high traffic server? You know, the cache that should be included in the base product but isn't because it would hurt Zends market.
    • Re:How Much? (Score:4, Interesting)

      by Angst Badger ( 8636 ) on Monday February 16, 2004 @12:55PM (#8294842)
      How much will it cost for the add-ons necessary to run PHP on a high traffic server? You know, the cache that should be included in the base product but isn't because it would hurt Zends market.

      There are several free third-party caches that work just fine. The PHP folks even provide links to them.

      That being said, I work for a company that has a high-traffic site -- about 3 million page-views per day, and we run it without a cache. It takes eight load-balanced web servers to do this, and the main bottleneck is response time from the MySQL server. (This is not a slam against MySQL -- it's chugging along at about 10,000 queries per second.) We could get by with less hardware if more non-sensitive data was shoved into cookies instead of the database and more trivial UI stuff was migrated to client-side Javascript.

      PHP's main problem, in terms of implementation, is that it's a bit of a memory hog. There's a huge amount of metadata that goes along with PHP variables, and a PHP array of n elements consumes several times as much memory as the equivalent Perl array. If this has been addressed in PHP 5.0, it will be a big damn deal.
  • by axxackall ( 579006 ) on Monday February 16, 2004 @12:38PM (#8294663) Homepage Journal
    Just for a case if there are people here who don't know about Zope but who are tired from primitivenesses of PHP and who would be interesting in migrating to Zope from PHP:

    There is much better alternative to PHP. It's called Zope [zope.org]. In fact, Zope has two similar (but very superior) markup languages: DTML and ZPT, both using Python for underlying scripting.

    Just go to the site and check brief functional description - you will be surprise how far their technology has been developed for the last year.

    Personally, I was developing on PHP before (like SquirelWebMail plugins, database applications), but I don't see any reason to write PHP anymore. All my current and upcoming web-projects are only Zope-based.

    • by Anonymous Coward
      Just for a case if there are people here who don't know about Zope but who are tired from primitivenesses of PHP and who would be interesting in migrating to Zope from PHP:

      That is comparing apples to oranges. Zope is a web publishing framework, not a programming language. There are publishing frameworks for PHP also. Zope leaves a bad taste in some people's mouths, as if it is an attempt to be an OO paradise tickling your OO glands rather than being practical. Some also say it is not relational-friendly
    • by Anonymous Coward
      The difference between mediocre languages like PHP and mediocre languages like Python is that the PHP folks have no delusions that their language is anything more than a quick hack to get your work done.

      Zope is a stunning example of over-engineered mediocrity.
      • that their [PHP] language is anything more than a quick hack to get your work done.

        That reminds me Perl: you can cook a quick hack very quickly, but no chances you can read it after few weeks. In other words: your job can be done with PHP quickly, but it cannot be maintained after that.

    • You know a markup language (DTML) is horrible when the people writing the documentation repeatedly tell you not to use it right there in the middle of the documentation, but to write Python scripts instead.
      • Explain yourself, and better with examples, please. Or admit that you've just done some trolling.

        DTML documentation never said to write Python scripts instead, as DTML is a markup based on Python. On this esense, DTML is no different than PHP, just using Python (very common language even outside DTML!) as underlying scripting instead of something that you never find outside PHP.

        The only advise to use something instead of DTML is to use ZPT, which is namespace-aware naturally-further generation of DTML

  • Just wondering if PHP has come out of the 80s yet.

The rule on staying alive as a program manager is to give 'em a number or give 'em a date, but never give 'em both at once.

Working...