PHP5PHP 5.3 and typesafe enumerationsat 2008-08-12 in PHP5 by friebeWithin RFC #0132, typesafe enumerations were added to the XP framework. Because PHP does not support them language-wise, we need a bit of workaround syntax to make them work. With PHP 5.3 and its so-called "late static binding features", enum declarations can now be written much more compact for the simplest use-case. Example: <?php (more) PHP 5.3at 2008-08-08 in PHP5 by friebeI've started playing around with the first alpha release of PHP 5.3 (should be released around September or October this year), see also the PHP 5.3 alpha1 announcement from August 1st. Some first observations: (more) RFC #0092: Switching from PHP4 to PHP5at 2006-12-18 in PHP5 by kieselTomorrow, RFC #0092 will be set to status implemented. With its implementation, the XP framework's newest version will work with PHP5 only. If you are running XP and have an application that you don't want to change and just leave it as is - here's how to achieve that: (more) Running PHP4 and PHP5 at the same timeat 2006-12-10 in PHP5 by kieselRFC #0092 is about the strategy that the XP framework will follow when doing it's step to PHP5 - from the strategic point of view. It's quite obvious that 3rd party applications cannot be run under a 5.xx version of XP from one day to the other (well, actually it could, but the problem here is that quite a number of applications exist and you cannot take care for them all at a single moment), so systems need to provide a backwards compatible way of doing this step. What that means is: we need to be able to run PHP4 and PHP5 on the same host, as CLI and in a web environment. The setup, this article is going to feature is having PHP4 as a Apache module and PHP5 as CGI. (more) Why we should migrate to PHP5at 2005-02-06 in PHP5 by friebeMigrating to PHP5 (plain, as released by the PHP team) is currently not possible:
Of course, by using our patch, we can get around the first two of these issues (at least, at its current state). An addition to the patch could also fix up the third. But let's also have a look at the other side, why it would make sense to upgrade: (more) The patch showcase: selfat 2005-01-09 in PHP5 by friebeThe keyword self can be used like $this for static classes - the problem with the current implementation is that it does not respect the "runtime class" (don't know how to describe this any better...). See also this discussion on the PHP developer's mailinglist. As of today the patch fixes this. The following now works as one would intuitively expect: <?php This outputs "B" - credits go to Alex The patch: BC problem fixedat 2005-01-09 in PHP5 by friebeThe commit message of the patch's revision 1.25 read:
Reasoning behind this was that I couldn't figure out how to solve a shift/reduce conflict in the grammar - I finally had an idea on how to get around it yesterday and fixed it today. The patch is now BC-break free JDK 1.5at 2004-12-02 in PHP5, Further reading by friebeWhat do you like best about JDK 1.5? This is what I asked a colleague of mine at work today after she told me she was already using it. Well:
(more) The patch: PHP5 packages (a.k.a. "namespaces") - basicsat 2004-12-02 in PHP5 by friebeWhen asked in a reader's poll in George Schlossnagle's blog what people thought PHP5 was missing, request #1 was namespaces (or packages), or short: A way to avoid name clashes between classes. With SPL and the new dom extension, the number of builtin classes has risen enormously (4.3.8: 21, 5.0.0: 55, 5.1.0-dev: 63), with a lot of good names taken, Iterator, Exception, Reflection and Traversable, to name only the most eminent. Any person having a halfway decent object-oriented framework will maybe have used these names already, asking him- or herself: When will it stop? Which class name will pollute the global namespace (the only in current PHP5 releases) next? How many more classes will I have to rename (and introduce API breaks with it)? This is exactly the case with the XP framework. As you know, we have had Exception and Iterator for a long long time. Both of these are defined as built-in classes as of the first release of PHP5. (more) The patch feature showcase: Operator overloadingat 2004-12-02 in PHP5 by friebe"The patch" (still doesn't have a name yet) implements operator overloading in PHP5. Not all operators can be overloaded, however. Operators Overloadability ------------------- ---------------------------------------------------- ++, --, ! These unary operators can be overloaded. +, -, \*, /, % These binary operators can be overloaded. +=, -=, \*=, /=, %= Assignment operators cannot be overloaded, but +=, for example, is evaluated using +, which can be overloaded. == != < > <= >= Comparison operators can be overloaded, but only all of them at once, using the compare operator (see below). The key to operator overloading is the new keyword "operator". Apart from that, the syntax is equal to that of a normal method declaration: Abbreviated example: <?php (more) |
|