Pádraic BradyWrox Press Respond to "The Art Of Deception Or Publishing PHP6 Books" (25.6.2009, 19:32 UTC)
I am such a torment. Cancelled negotiations with a publisher over disagreements on a book format? Check. Said no to taking down a free book startup and enter a publishing contract? Check. Lambasted multiple publishers for releasing PHP 6 books which do not teach anything PHP 6 specific? Check. Next month I expose which publishing companies are secretly building weapons of mass destruction in their basements. Reverse that, I can't afford a libel suit...

In "The Art Of Deception Or Publishing PHP6 Books" I aired my unflattering opinions about publishers who have been selling "PHP 6" books. PHP 6, last I checked, was a bit like Leprechauns (Hey, I'm Irish! The use is legal!). You love them, you have lots of ideas about what to expect from them - but has anyone every really seen one (other than my great uncle)? PHP 6 exists in CVS - it's never had a release other than the usual CVS snapshots. It's certainly not complete and stable, and its future feature list remains a bit flexible. You could see PHP 5.4 in 2011 before PHP 6 is finished...guessing here. As its developers would say - it'll be ready when it's ready. One day. Maybe.

In response to the blog post, Wrox Press picked up on the problem on Twitter via Davey Shafik (@dshafik). Everyone knows Davey. If you don't, you must have been living under a rock, or a ruby, for a really long time. I have to say, Wrox responded in a wholly unpredicted way I have to admire. It's not everyday you find yourself hiding in a cave in Antrim (it's nice...a little damp though) after seeing something you wrote persuade a publisher to pull back a book destined for the printers, and work on fixing it so it deserves its title.

Here's the full text of the comment posted to "The Art Of Deception..." earlier today by Jim Minatel (Associate Publisher - Wrox). Jim is mostly the person sitting behind @wrox over on Twitter where he's been quite proactive in getting to the bottom of my PHP 6 Book complaints.

Pádraic:

Thanks for taking the time to discuss this with me on Twitter last night. I’m the Associate Publisher for Wrox, I’m the person usually behind @wrox on twitter.

After meeting with the editor who ran the PHP list for us, you’re right. The titles of these PHP6 books, some of the references to PHP6 in the books, what isn’t covered in the books, all prove we made a mistake, something went wrong. But how, why?

Elizabeth (and thanks for her measured response) is correct in part of her assessment that books take a long time to write and publish. I’m sure that when the editor and authors started these books in Spring 2008, they’re thinking was that 6.0 would indeed be a stable release by early 2009 (if not sooner) and they were aiming for that. But clearly along the way we dropped the ball on checking references to things like the non-existent “6.0.0 stable.”

In the Beginning PHP6, MySQL, Apache book, I can actually understand the rationale not to cover Unicode there. Given that Unicode is primarily valuable to someone internationalizing a site or localizing it for multiple languages – topics that I wouldn’t consider “Beginning” level – I can see why it wasn’t covered. (Before becoming associate publisher, I was actually our ASP.NET editor for most of the last 5 years and we don’t for example cover internationalization/localization in our Beginning ASP.NET 3.5.) So we want to have a book that Beginning level customers understand will work with PHP6 if that’s the version they’re using, but we didn’t communicate right what that meant in this context where there weren’t major new v6 features at the level we thought a beginner would need.

The professional book stumps me more. It’s hard for me to understand how that book doesn’t have a chapter on Unicode. It looks like an oversight by everyone involved in the book.

So where do we go from here and get better than this to eventually prove we’re worthy of better than when @bicatu says “That reminds me why I've never bought a Wrox book?”

First, I’ve asked the team involved with Beginning PHP6 scheduled to ship to the printer this week to pull that book back, to read your post and the subsequent twitter discussion and to make sure we aren’t making the same mistake a third time. I want the author and editors to provide a level of confidence that the PHP6 features that should be covered are, that the discussion of the current state of PHP6 is accurate, and the that the title, subtitle, and marketing copy on the book and online accurately reflects what is and isn’t covered.

Second, publishing the ri

Truncated by Planet PHP, read more at the original (another 1839 bytes)

Link
Pádraic BradyThe Art Of Deception Or Publishing PHP6 Books (24.6.2009, 18:04 UTC)
I was strolling around a bookstore today, Easons on O'Connell Street here in Dublin, when I found myself staring at a bookshelf in near shock. Kid, I thought, you've been out of the loop for only two months and somehow those crazy people have managed to release PHP 6 right under your nose! I took several deep breaths not quite sure how to react. I moved closer and pulled out the shiny red book published by Wrox titled "Professional PHP 6" and prepared to kick myself silly for the next week learning PHP6 (not from the book, which while shiny is of little use to someone using PHP so often it's hardwired into your brain).

The more I stared at the three youthful faces grinning at me from the cover, the more I convinced myself this was a publishing error. No way was PHP6 going to be released without me noticing. Google Reader would have been on fire with that news. So what the hell was I looking at?

I was apparently looking at a big fat lie.

PHP6 has been the long standing grail for PHP developers who whisper in corners about its major feature: Unicode! Unicode makes the planet revolve, well its literary parts anyhow... Out on the edges were numerous other features, but most of those have been rolled into PHP 5.3 - which should be released next Tuesday. PHP 5.3...next Tuesday. And here we have books titled PHP6...what a joke. PHP6 won't see so much as an alpha release for months...could even be years for all I know. It will be ready when it's ready.

My biggest question of course was how can publishers escape punishment for such obvious silliness? Maybe someone can explain it in the comments because I'm at a loss. I figured there was some justification in that PHP6 would undoubtedly support some backwards compatibility with PHP 5, and therefore you could learn a great deal of PHP 6, simply by learning PHP 5. After all, both are PHP. Or perhaps it's all the disclaimers technical books can include to escape responsibility if the information in the book is wrong. This might be sufficient to get around the laws of any number of countries, like Ireland, but I don't consider it honesty. In my opinion it's blatantly obvious that the PHP6 references used in book titles are little more than an attempt to differentiate these books from their competitors and earlier editions. Enough to fool a lot of consumers that buying the PHP6 book must be better than buying the perfectly up to date PHP5 book sitting in the bargain bin or available secondhand from Amazon. We are in a recession afterall and who banked on PHP 5.3 dropping a bombshell on plans for PHP6 books to spark a buying spree from developers?

Now, even I admit my outrage can be exaggerated. So I did go and pick up a few sample books using PHP6 in their title out of curiousity. Flicking through the pages I quickly noted how many of them avoided the PHP6 topic like the plague by omitting obvious things you'd expect to see. Unfortunately I also found a few notable slips which had me in stitches. Installation instructions and version listings are the most telling

The Wrox Programmer To Programmer series includes the far fetched title "Beginning PHP6, Apache, MySQL Web Development" (Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass). The installation instructions for Linux state:

6. Extract the tarball, and change to the directory it creates:
tar -vxzf php-6.0.0.tar.gz
cd php-6.0.0


Number 3 earlier on the same list states:

3. Scroll down to the Complete Source Code section, and click on the appropriate link to download
the latest tar.gz package.


Perhaps someone didn't notice that the download here (as of today) according to php.net is PHP 5.2.10? Not PHP 6.0.0.

Earlier the same book states:

The most recent stable versions that were in effect at the time of this book's writing were:

PHP: Version 6.0.0
Apache: Version 2.2.9
MySQL: Version 5.0.67

Future editions of this book will address changes and improvements in these programs as they become
available.


Again, the non-existent PHP 6.0.0 makes an appearance clearly noted as being a "stable version". Of course, this is complete bollocks. The rest of the book seems pretty clearcut. It doesn't mention PHP 6 anywhere else except in two Chapter titles according to its index. PHP 5.3 is mentioned once in a brief description of namespaces. Everything else is PHP...drumroll...5. This book teaches you PHP5 and only PHP5. Look on the bright side - the Wrox website and Amazon page suggests the title should have included MySQL 6... All they needed was the equally mystical appearance of Apache 6 to get the conspiracy theorists worked up into a fever pouring through the Book Of Rev

Truncated by Planet PHP, read more at the original (another 1324 bytes)

Link
Fabien PotencierWhat for PHP6? (7.6.2009, 19:10 UTC)

PHP 5.3 is just around the corner with a lot of great new features. However, even if I'm really excited about this new release, I won't make yet another PHP 5.3 feature list; I will rather look at the future of PHP. PHP core developers met at php|tek and discussed the future of PHP. And it is really great to see that they plan lots of wonderful features; let's set aside the Unicode stuff.

They published some notes from the meeting, and here is my personal list for things I find really interesting:

  • Add __cast() magic method that will be called for all casts. If the __toString() method is there it will get used for string types first.

  • Consider making a "callable" type.

  • Make ArrayObject and ArrayAccess accepted everywhere regular arrays are.

  • Add traits support.

  • Add type hinted return values, scalar type hints.

  • Make function call chaining possible (f()() if f() returns a function), and array dereferencing (f()[0]).

  • C#-style properties with getters/setters:

    class Foo
    {
       public $bar
           getter { return $this->bar; }
           setter { $this->bar = strtolower($value); }
       ;
    }
     
    
Link
Michael MacleanWhat I've been up to (15.5.2009, 20:55 UTC)

I finally decided to get around to doing something about my site, so I've made a front page for it which is better than a straight redirect onto the blog. Hopefully it's reasonable.

I've been learning a bit more recently about the internals of PHP, and how to write extensions for it. I've been practicing by doing a bit of work on a Cairo wrapper that was started in the Google Summer of Code last year and until now has been mainly looked after by Elizabeth Marie Smith. She's put up with many, many newbie questions from me and so I've learned a lot while doing it. It's now at the stage where it'll run the eZ Components Graph component without too much complaining. It has a dual procedural and object-oriented API, so it should manage to run most things that use the existing cairo_wrapper extension. Thanks to all the regulars on #php.pecl and #php.doc on EFNet, and #php-gtk on Freenode for putting up with me while doing this. I've also written a quick wrapper for Tokyo Cabinet for the DBA extension in PHP which with a bit of luck will get committed to PHP6 some time soon.

In other news, I've been occasionally helping in the maintenance of Jubilee and An Sulaire, the two Sgoth Niseach boats I go sailing on occasionally. Hopefully they'll be going back in the water soon and we can get some sailing done. I'm looking forward to it.

Link
Brian MoonIs there a program for finding uses of register_globals? (15.5.2009, 17:38 UTC)
register_globals is going way in PHP6.  That is fine with me.  Super globals are cool and I have taken to using filter_input_array these days anyhow.  However, our code base is now 10+ years old at dealnews.  Most of the forward facing code was completely rewritten in the last couple of years due to architecture changes.  Many new projects had register_globals turned off via php_admin_flag in Apache.  So, that area is not that big of a problem.  However, our internal admin areas have not all be rewritten because, well frankly, they still work.  Yeah, stuff written for PHP4 in 2000 is still working.  KISS helps a lot with that.  But, this code, somewhere in there, may still be relying on register_globals.  Now, we could go line by line and try and fix it.  But, it seems like a program could be written to do this job.  I mean, I use jEdit and it can highlight unset vars using the PHPParserPlugin just fine.  I bet Zend IDE can do the same.  Has anyone written such a tool for the command line?  There will be false positives I know.  Things like passing a variable by reference to a function would look like a use before set.  But, I can deal with those if I don't have to go line by line through tons of old code.  What would the rules look like for such an animal?  This would be a great project to get off the ground before PHP6 hits.  Ideally you could provide a list of variables for it to ignore.  We have some globals we set up in prepends and includes.
Link
Bertrand MansionOMG PHP53! (6.5.2009, 11:07 UTC)
Damn, I didn't really have the time to look at this version yet, but reading now the new features list, it looks like the most interesting PHP version ever.

I mean closures and lambda functions in PHP, I have been waiting for this for too long. Fileinfo, a very useful extension that I always had to compile is now bundled. Changes to the ternary operator ?:, hehe. A new MySQL driver which should eat less RAM ! ext/intl looks amazing too.

Well, this looks really great, I still have to test this (especially the anonymous functions) and see if it is as cool as it sounds.
Namespaces look weird with their antislash syntax tho... :/

Update : actually, given the long new features list, I start to wonder why they didn't call this version PHP6 ?
Link
PHP-GTK CommunityArticles on other sites (25.4.2009, 19:59 UTC)

Here is a list of various articles about PHP-GTK2, recently updated:

read more

Link
Michael KimsalMe griping about PHP :) (closures this time) (22.12.2008, 01:34 UTC)

Yeah, that’s about all this post will be. I read an article from IBM developerworks on the upcoming 5.3 features, and something got my dander up: closures.

I first got acquainted with closures in Groovy last year, and love them. They make sense. The syntax is pretty easy, and feels natural in the language. Not so in PHP. Once again, inconsistencies are not just legacy issues in PHP - they are created anew for us to deal with for years to come.

Look at the example here:

class Dog
{
 private $_name;
 protected $_color;

 public function __construct($name, $color)
 {
  $this->_name = $name;
  $this->_color = $color;
 }

 public function greet($greeting)
 {
  return function() use ($greeting) {
   echo "$greeting, I am a {$this->_color} dog named
   {$this->_name}.";
  };
 }
}

Given that ‘anonymous function’ inside the greet() method is a closure, WHY NOT NAME IT THAT? The PHP Reflection API was updated to include a “getClosures()” method, but what would you get? They keyword “closure” doesn’t exist, but could have. Instead we now have the keyword “function” looking like two different entities - it looks like a function call when used with the () directly after it, and also has its traditional function fname() syntax still available.

I have to teach this stuff, and being explicit with a closure keyword would have saved a lot of headaches to come in explaining this stuff to people. Additionally, it would have been less to type.

Compare

return function() use ($greeting) {
 echo "$greeting, I am a {$this->_color} dog named {$this->_name}.";
};

with

return closure($greeting) {
 echo "$greeting, I am a {$this->_color} dog named {$this->_name}.";
};

What’s more explicit, easier to understand, and fewer characters to type? Given the recent namespace separator debacle (using \ as a namespace separator, and justifying it because it’s “fewer characters to type”), I can’t really understand the rationale behind the closure syntax.

To be fair, the closure syntax RFC was up at http://wiki.php.net/rfc/closures and I didn’t comment in time. So, I guess it’s all my fault. :( Beauty and elegance have never been PHP’s strong suit, but it seems people went out of their way to make this unintuitive and bulkier than it needed to be. :/

On a more broad note, I really think the bulk of these changes (closures, namespaces, etc.) should have been put in php6 only, not in the 5.3 series.  I understand the need for testing and such, but we’re implementing new functionality and defining how it is expected to work based on the current PHP5 Zend Engine.  Whatever useful changes that might make a PHP6 faster/better/whatever can’t easily be implemented because the ‘new’ features are all dependent on a core engine that’s already 5 years old, which it itself was built with an eye towards backwards compatibility to PHP3.  Strategically, it just feels like the wrong move.  But hey, what do I know, right?  I can’t write C code patches, so my views don’t really have much weight, do they?

Link
Rafael DohmsThe road to PHP 5.3: Namespaces (12.8.2008, 17:34 UTC)

We have all been looking forward to PHP6 and the big changes that were proposed for it, but along the way the PHP Core dudes made a great decision and split the PHP6 release in two. Most of the new features expected for PHP6 will be implemented in a 5.3 release, leaving unicode for the PHP6 release. So let’s take a quick look at what’s coming along in PHP 5.3.

Roadmap

On the last few weeks great steps have been taken, and a cool timeline is now up. The release went into feature freeze on the 24th of july, and into alpha1 last week. After that the next 2-3 weeks will see loads of beta and RC releases and finally from mid September to October we will have the final stable release \o/

Features

On this post I’ll talk about Namespaces, and cover other features in future posts.

namespaces

This is by far one of the most expected features that will be included in this release. Like Java or other languages, this will allow developers to group classes and other stuff in namespaces, like below:

PHP:
  1. <?php
  2. /** classes/my/foo/MyClass.php */
  3.  
  4. namespace my::foo;
  5.  
  6. class MyClass {}
  7.  
  8. // You can define functions and constants in the namespace too.
  9. function myFunc() { }
  10. const MY_CONST = ‘foo’;
  11.  
  12. ?>

So that way you can use this in many forms, like:

PHP:

Truncated by Planet PHP, read more at the original (another 12269 bytes)

Link
Rafael DohmsThe road to PHP 5.3: Namespaces (12.8.2008, 17:34 UTC)

We have all been looking forward to PHP6 and the big changes that were proposed for it, but along the way the PHP Core dudes made a great decision and split the PHP6 release in two. Most of the new features expected for PHP6 will be implemented in a 5.3 release, leaving unicode for the PHP6 release. So let’s take a quick look at what’s coming along in PHP 5.3.

Roadmap

On the last few weeks great steps have been taken, and a cool timeline is now up. The release went into feature freeze on the 24th of july, and into alpha1 last week. After that the next 2-3 weeks will see loads of beta and RC releases and finally from mid September to October we will have the final stable release \o/

Features

On this post I’ll talk about Namespaces, and cover other features in future posts.

namespaces

This is by far one of the most expected features that will be included in this release. Like Java or other languages, this will allow developers to group classes and other stuff in namespaces, like below:

PHP:
  1. <?php
  2. /** classes/my/foo/MyClass.php */
  3.  
  4. namespace my::foo;
  5.  
  6. class MyClass {}
  7.  
  8. // You can define functions and constants in the namespace too.
  9. function myFunc() { }
  10. const MY_CONST = ‘foo’;
  11.  
  12. ?>

So that way you can use this in many forms, like:

PHP:

Truncated by Planet PHP, read more at the original (another 12269 bytes)

Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP