News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
feed this:

PHPMaster.com:
Using Traits in PHP 5.4
February 09, 2012 @ 08:40:50

On PHPMaster.com today there's a new tutorial about using a feature in the upcoming PHP release (5.4) to make it easier to work with more modular code - using traits.

In this article I will discuss traits, a new feature introduced in PHP 5.4 to overcome [issues where multiple inheritance is needed]. The concept of traits itself is nothing new to programming and is used in other languages like Scala and Perl. They allows us to horizontally reuse code across independent classes in different class hierarchies.

Included in the post is example code showing what the use of a trait looks like and a method for creating a Singleton that can spawn instances of two classes. Also included are examples of:

  • using multiple traits at once,
  • traits made up of traits,
  • the importance of order,
  • aliasing to avoid conflicts,
  • reflection
  • and a few other features that come along with their use.
0 comments voice your opinion now!
traits tutorial introduction feature multiple inheritance



PHPClasses.org:
PHP 5.4 Features Shall you Upgrade to the newer PHP Version?
January 31, 2012 @ 10:05:03

Over on the PHPClasses.org blog today there's a new post looking at the next major upcoming PHP version (5.4), what it comes with and why you might want to make the upgrade.

PHP 5.4.0 is planned to be released on February, 2 2012. By the time you are reading this, it may already been out. It is a result of many months of development. Many features were proposed for this release. Some made into this version, others did not make it at least for now. So, now you may be wondering which interesting features really made it. Let me tell you more about some of the more interesting features present in this release.

The article mentions some of the usual major features that can be found in just about every "in PHP 5.4" list - traits, the built-in web server, binary notation for integers - but it also includes some of the features that didn't make the cut this time (like annotations and the inclusion of the APC caching extension). Also included are questions to ask to see if the upgrade is for you like:

  • Do you need the new features?
  • Do you need the updates now?
  • Try it and test it in dev first - does it meet your needs or cause other bugs?

The planned release for PHP 5.4 is during the first week of February (2012). Additionally, if you'd like to give the PHP development group some help testing out the latest Release Candidate, you can find instructions here.

0 comments voice your opinion now!
release feature upcoming guide opinion testing


Hasin Hayder's Blog:
Getting comfy with PhpStorm - one of the best IDEs so far!
January 02, 2012 @ 15:07:03

Hasin Haydertalks about "getting comfy with PHPStorm" a relatively recent addition to the IDE ranks for PHP.

I am a big time fan of Netbeans and I left it a few days after it's release of 6.7. It was so good, heavenly, yummy but I had to leave this old pal because of it's extreme hunger to the available resources. [...] I left Netbeans and started using PhpStorm. I have a company license and I am glad that I made this move. I am not going to preach PhpStorm in rest of this article, but what I will do is sharing my experience with PhpStorm.

He goes through a list of his favorite things about the IDE - its speed it operates at overall, great Javascript/HTML intellisense, version control integration, less resource intensive and that it costs less overall (and comes from a "developer friendly" company).

If you're interested in trying out PHPStorm for yourself, you can find a demo at http://www.jetbrains.com/phpstorm.

0 comments voice your opinion now!
phpstorm ide opinion feature company developer


Joshua Thijssen's Blog:
php 5.4 + htrouter Your personal Apache 2.2 compatible server
December 23, 2011 @ 08:27:10

Joshua Thijssen has a new post to his blog today about a feature of the upcoming PHP 5.4 release, the built-in web server, and a handy way to reproduce .htaccess functionality with the help of a simple PHP script - htrouter.

The problem with the new PHP 5.4 internal web-server is that it isn't Apache. Thus it does not know anything about .htaccess. Even when you have defined your .htaccess to do authentication, the internal PHP web-server will ignore it, while in production, the authentication will be needed (if you will be running Apache, of course). Also, you need to reroute everything manually through your app_dev.php, so your URL's don't really match the way they will be on your production.

He introduces the PHP web server quickly, just showing a sample command line call to start it up and to point it at a certain PHP file as a "boostrap". With the help of his htrouter script, though, you can use "modules" similar to those in Apache. He already has the HTTP auth stuff working and more is to come.

0 comments voice your opinion now!
htrouter apache tool webserver feature


Watts Martin's Blog:
PHP is not an acceptable COBOL
December 12, 2011 @ 11:06:52

In this new post from Watts Martin he suggests that "PHP is not an acceptable COBOL" - the language, while popular and useful now, may not age as well in the future (say 10 or 15 years).

PHP is to the web what Visual Basic is to Windows, but even more so: a powerful enough language to do nearly anything you want, ubiquitous, easy to get up and running (on many web hosts it's pre-installed), and forgiving of shitty code. [...] While I'm happy to see PHP start getting "modern" language bits (you Lisp hackers, stop snickering), the more I'm exposed to modern PHP in practice the more I think it's doomed. [...] A friend compared PHP to the COBOL of the web, and indeed, that seems to be COBOL's philosophy, too.

He also mentions some of the things available for PHP - frameworks, dependency management, PEAR, PECL - and some of his struggles with each. There's plenty of feedback on the post with some good interaction back from the post's author.

0 comments voice your opinion now!
cobol opinion future language feature


Gonzalo Ayuso's Blog:
Playing with the new PHP5.4 features
November 28, 2011 @ 08:10:51

Gonzalo Ayuso has a new post to his blog today showing some of the experimentation he's done with PHP 5.4 features like the short array syntax, calling methods through arrays and traits.

PHP5.4 it's close and it's time to start playing with the new cool features. I've created a new Virtual Machine to play with the new features available within PHP5.4. I wrote a post with the most exciting features (at least for me) when I saw the feature list in the alpha version. Now the Release Candidate is with us, so it's the time of start playing with them. I also discover really cool features that I pass over in my first review.

Code snippets are included for each example for:

  • Class member access on instantiation
  • Short array syntax
  • Support for Class::{expr}() syntax
  • Indirect method call through array
  • Callable typehint
  • Traits
  • Array dereferencing support

He points to this other post for a complete list of what's been added in 5.4.

0 comments voice your opinion now!
feature releasecandidate traits example tutorial


Volker Dusch's Blog:
Textual code coverage information for PHPUnit
November 25, 2011 @ 16:11:41

In a new post to his blog Volker Dusch points out a new feature in a recent release of PHPUnit, the popular unit testing framework for PHP - textual code coverage details.

Three weeks ago PHPUnit 3.6 was released and it has a little new feature you might have missed until now. PHPUnit can now show you code coverage information on the command line.

Options for the report output include: colorizing, writing the output to a file, including a project summary, namespace separation and package (using the @package phpdoc tag) information. He includes a use case he's found for it - small projects where you can cover the whole codebase quickly (with a "watch" command example filtering based on a certain class).

0 comments voice your opinion now!
textual code coverage report phpunit tutorial feature summary


php|architect:
Why Software Fails
October 10, 2011 @ 10:48:10

On the php|architect site today there's an opinion piece from Marco Tabini with his thoughts on why software fails - not why the project itself fails, but why the software fails to be useful.

This is a much more common problem than engineers and architects are willing to admit. Far too often I see someone in charge of writing a piece software worry about how a product works without paying so much as a passing thought to whether it actually works the way people expect it to. The truth is that we are, by and large, stuck in a reality where software somehow equates with automation.

He goes on to talk about how easy it is for us, as developers, to forge head with features and software that may not be useful to the masses. We worry more about solving a problem that may or may not actually be there. He illustrates with the example of a to-do list, providing the automation to make list tracking easier, but no guidance of how the user can make use of it effectively.

0 comments voice your opinion now!
opinion software failure feature usefulness


Wojciech Sznapka's Blog:
Symfony2 stable is available, what's the big deal?
August 08, 2011 @ 08:51:28

For those not familiar with the Symfony PHP framework, all of the hype surrounding its version 2 release might seem a little too much. Wojciech Sznapka has a new post that tells you why it's such a "big deal" and what you could expect from it.

On July 28th Symfony2 was finally released, with launch parties all over the world. Developers are excited, managers are excited and whole ecosystem is happy. They're right, there are plenty of reasons to be optimistic. symfony 1.x is a great framework, I made many projects with it, nevertheless Symfony2 is a new way of doing things in PHP. I observe, that applications made with symfony 1 tends to be messy with raising number of functionalities. There too many magic tricks, which you can use, which are hard to manage in big, multi-team projects. Symfony2 does it smarter.

He lists a few things that are larger changes in Symfony2 including a cleaner templating system for views (Twig), a focus on reusability, the bundling of Doctrine2 for ORM/database support and other updates like namespace support, PHPUnit compatibility and code generators.

You can find out more about the project (and how you can contribute) on the framework's website.

0 comments voice your opinion now!
symfony2 opinion framework feature


Mayflower Blog:
Traits in PHP 5.4
August 05, 2011 @ 11:07:08

On the Mayflower blog there's a new post looking at the upcoming traits support PHP 5.4 will have to offer. (Note: original post in German)

PHP 5 was a big step in the right direction and today resembles the object-orientation of Java very much. At the end of June 2011 one more step was made, not based on Java, but from another popular language - Scala. The new language feature called Traits allow class and cross-code reuse with no vertical transmission. It is basically a relatively simple mechanism, which is explained below using a simple example.

Their examples are a "before" and "after" of the same functionality - creating a controller that can respond with a JSON message. The first example shows a simple controller that can respond in JSON, a JSON class that can work with HTTP and a User class that implements the Serializable interface on the JSON namespace. The second example redefines the Serializable interface as a trait that can be used inside the User class rather than inherited by it.

There's also a brief look at using multiple traits in one class and what to do about naming conflicts that might pop up and the prioritization method that's been put in place to help.

0 comments voice your opinion now!
traits feature upcoming example tutorial



Community Events





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


framework custom release introduction conference development test language symfony2 interview manifesto unittest api series phpunit application security podcast opinion community

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