News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
feed this:

Jani Hartikainen's Blog:
PHP typehinting gotcha in exceptions/methods
July 14, 2011 @ 10:41:55

Jani Hartikainen has a new post with a gotcha he came across when using typehinting in exceptions and methods.

A small gotcha I recently ran into: If you use typehinting, PHP never checks that the class your typehint specifies actually exists!

He includes simple examples that define the class type hint as some random string and PHP never throws an error for it. He also notes that it's even worse when dealing with namespaces - how it handles exceptions locally unless you specify otherwise. Of course, these "features" can be put to good use in the right situations, but they can be confusing for a developer without a keen eye.

0 comments voice your opinion now!
typehinting exception method error class missing



Squirrel Hacker Blog:
PHP DateTime is missing methods in 5.2
April 05, 2010 @ 13:58:26

As SeanJA points out in a new post to his blog, there's two functions that were included in the PHP 5.3 version of the DateTime object in PHp that weren't in the PHP 5.2 version - specifically the get/setTimestamp ones.

These are some strange methods to be missing as a lot of people in the PHP world seem to work on Timestamps using these concepts, so you would have thought that php would have included these methods initially. Unfortunately they did not, so here is a fix for that.

He provides two pieces of code, one to replace the setTimestamp function and the other for the getTimestamp to add in this handy functionality as you might need it.

0 comments voice your opinion now!
datetime method missing settimestamp gettimestamp


Michael Kimsal's Blog:
Magento book review found
June 11, 2008 @ 14:36:44

In response to another blogger's review of the php|architect "Guide to Programming with Magento", Michael Kimsal has posted some clarifications.

Starting off with "However, I'm not really the type of person to give accolades unless something is absolutely stellar. As such, this post will primarily be about the shortcomings of the book" I wasn't particularly surprised that there was more of a focus on negatives rather than positives.

Michael mentions three topics - the "first to market" point the reviewer makes about different versions of Magento between the book being authored and the release, some of the missing information the reviewer would've liked to see and the complexity of the example module that the reviewer complains is too hard to follow.

1 comment voice your opinion now!
magento book review respond firstomarket complexity missing information


Jonathan Snook's Blog:
Easier Static Pages for CakePHP 1.2
February 05, 2008 @ 08:44:00

Jonathan Snook has posted about a method he's using to make the creation/use of static pages in a CakePHP application (or website) simpler.

Traditionally in a CakePHP application, to do static pages you have two options: use the built-in Pages controller or set up an empty action in a controller.

Feeling that neither of these two options met how he wanted things to work, Jonathan (and Nate Abele) developed a class that extends the error handler in the CakePHP framework to handle "missing" actions and controllers. This means that, if an unknown controller/action combo is called, this script will check in its correct location (in the structure of the site) and try to find it to render it.

0 comments voice your opinion now!
cakephp framework static page error handle missing controller action


Padraic Brady's Blog:
Ruby Testing Tools Missing From PHP
November 28, 2007 @ 08:48:00

In this post from Padraic Brady, he compares some of the tools that are available to Ruby developers to some of their counterparts (if they exist) in PHP.

Anyways, here's the pitch. I've been using Ruby for a year now and my pet peeves with PHP started getting a bit too much to comfortably endure. [...] I don't like developing web applications with Ruby, or that thing Rails. Whatever it is. It's a framework, right? So I'm on a splurge of writing PHP tools for the same things in cahoots with folk like Travis Swicegood.

Tools he mentions include Autotest, Mutation testing, Mocha, Rspec, Heckle and some of their PHP counterparts like parts in PHPUnit and the DomDocument functionality.

0 comments voice your opinion now!
ruby testing missing functionality phpunit ruby testing missing functionality phpunit


Mike Lively's Blog:
Late static binding....sorta /
September 27, 2007 @ 12:58:00

Mike Lively is happy about one thing - that late static binding (definition) has been committed and will be included with PHP 5.3. Unfortunately, he has a downside too:

The good news is late static binding has been introduced into head and looks like it will be merged into 5.3 before it is released. The horrible news is I really don't think the patch went as far as it needs to.

He talks about the original intention of the functionality (flexible inheritance for static methods/properties/constants) and how it was implemented, but with one small issue - that "static will ALWAYS return the 'resolved' name of the class used to call the current function". He illustrates with a code example showing an extended class returning a static property.

He also mentions two suggestions to help fix this issue:

  • setting the behavior of parent:: such that it forwards the calling class through the next function call.
  • introducing another scope [...] using a new keyword so parent:: could remain the same
1 comment voice your opinion now!
late static binding patch missing functionality parent inheritance late static binding patch missing functionality parent inheritance


Gregory Szorc's Blog:
So Many Untapped PHP Features
May 01, 2007 @ 13:26:00

Gregory Szorc has posted his look at the "many untapped features" that PHP has to offer that the masses can tend to overlook when developing applications, specifically when dealing with object versus procedural programming.

The more interesting topic is why these applications have not made the jump to utilize PHP 5's features. Others have speculated, and I tend to agree, that application developers are worried that PHP 5 adoption is too low and requiring its use will turn away users. Now, considering the improvements of the PHP 5 engine, both from a performance and security standpoint, there is no reason in my mind why a sane system administrator wouldn't be running PHP 5.2.1 (most recent at the time of this entry).

He looks at applications like WordPress, Drupal and Gallery and note how they haven't made the move to true PHP5-style code. Adoption has a lot to do with this, but he brings up the point of the article - that developers are "ignorant" to what they're missing.

1 comment voice your opinion now!
php4 php5 object feature missing adoption php4 php5 object feature missing adoption


Mike Potter's Blog:
Updated (unofficial) Adobe PHP SDK
August 18, 2006 @ 06:55:09

Mike Potter has posted an update to his blog about the unofficial Adobe PHP SDK he mentioned earlier with details about new information and corrections that have been added to the guide.

I've updated the (unofficial) Adobe PHP SDK to fix some problems after the initial release. Turns out a few files were missing from the .zip file, and some files were misnamed. I've fixed these problems and also added in a new, more simple sample to show how Flex can retrieve XML data from a PHP backend, without requiring the use of a MySQL database. Finally, I've also removed the .svn files from the .zip file, reducing its size to only 1.5 MB.

You can download this latest version of the guide directly from his blog as well as get involved via the Google Group or requesting access to the SVN repository on Google as well.

0 comments voice your opinion now!
adobe sdk update problems missing files sample guide svn adobe sdk update problems missing files sample guide svn


Alex Young's Blog:
The Future of PHP is More Depressing than Ever
March 03, 2006 @ 07:03:29

From Alex Young's blog there comes this post stating some of his opinions about the future of PHP and how it "is more depressing than ever".

Rasmus Lerdorf wrote quite a nice article called The no-framework PHP MVC framework. In it, he demonstrates how to create a simple application by using the model view controller design pattern. Using this design pattern, he creates a basic framework to save some effort with common tasks.

Put your hands up if you were a PHP programmer who was writing python or ruby on the side due to the incomprehensibly naive design of PHP… Now put your hands up if you understand and have worked extensively with object oriented programming, functional programming and perhaps agile programming. You're the guys I'm talking to.

He continues, alluding to the lack of sophistication amung PHP developers (procedural over OOP?) and some comments about what he thinks PHP is really missing. He does, however, encourage those out there just getting into design patterns with PHP to check out the article if for nothing more than a good intro to MVC.

0 comments voice your opinion now!
future enhancement rasmus mvc no-framework what\'s missing future enhancement rasmus mvc no-framework what\'s missing



Community Events





Don't see your event here?
Let us know!


framework zendframework2 podcast database api interview introduction release voicesoftheelephpant conference testing zendframework language application unittest phpunit symfony2 community injection opinion

All content copyright, 2012 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework