News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mathias Verraes:
Resolving Feature Envy in the Domain
August 12, 2014 @ 11:55:24

Mathias Verraes has a new post today about something he calls "feature envy" in the domain, related to this code smell (based on a definition from Martin Fowler).

Benjamin Eberlei did a really nice job of explaining refactoring the Feature Envy code smell on his blog. I wrote a comment because I felt the example could be taken one step further. You should read the original post. Below are Benjamin's code examples (for reference), followed by a repost of my comment.

The "smell" is defined as "a method that seems more interested in a class other than the one it's in". Mathias includes the code examples from the other post showing a datetime calculation and how it could be abstracted out to another class and method. He talks about the migration and how it relates to the "Whole Value" pattern and integrating some of the logic into a factory, generating a "reporting period" instance. He finishes the post with a brief look at an application of domain-driven design concepts to the problem, suggesting that the reporting be even more abstracted from the datetime data and using the "reporting period" object instead.

0 comments voice your opinion now!
feature envy whole value designpattern class object abstraction domaindriven

Link: http://verraes.net/2014/08/resolving-feature-envy-in-the-domain/

SitePoint PHP Blog:
New Features in PHP 5.6
January 14, 2014 @ 12:56:39

On the SitePoint PHP blog Bruno Skvorc has posted a guide to what's new in PHP 5.6, the upcoming release of the language.

It's been a while since the release of PHP 5.4, and new versions have been coming out faster and faster ever since. When 5.5 hit and introduced some unexpectedly great features, the PHP community breathed a sigh of relief and regained hope of a more dedicated, structured and smart core development. Whether or not we'll actually get this remains to be seen, but the future does indeed look promising, especially if one looks at the PHP 5.6 changes made so far.

He goes through the list of things (so far) that will be in the upcoming release:

  • MIME types in the CLI web server
  • Internal Operator Overloading
  • Uploads of over 2GB are now accepted
  • POST data memory usage decreased
  • Improved syntax for variadic functions
  • Constant Scalar Expressions
  • PHPDBG bundled by default
  • Zip improved
  • Importing namespaced functions

Each item on the list comes with either some sample code to show its use or a brief explanation of the features it adds or updates.

0 comments voice your opinion now!
new feature upcoming language release php56

Link: http://www.sitepoint.com/new-features-php-5-6

PHPClasses.org:
Lately in PHP podcast episode 42 - New PHP 5.6 Developments
December 17, 2013 @ 12:02:40

The PHPClasses.org site has released the latest episode of their "Lately in PHP" podcast series with episode #42, "New PHP 5.6 Developments".

s the release of PHP 5.6 gets closer to happen in first semester of 2014, more new features are already being implemented including a new PHP debugger. The latest PHP 5.6 developments is one of the main topics discussed by Manuel Lemos and César Rodas in the episode 42 of the Lately in PHP podcast.

They go through some of the things that have been discussed to be included in PHP 5.6 including

  • the Expectations proposal
  • ** as Power Operator
  • Assigning Variables Automatically in the Class Constructor
  • PHPDbg, a New PHP Debugger

You can listen to this latest episode a few different ways - either through the in-page player, by grabbing the mp3 or you can watch the video of the live recording.

0 comments voice your opinion now!
latelyinphp podcast series php56 upcoming feature

Link: http://www.phpclasses.org/blog/post/222-New-PHP-56-Developments--Lately-in-PHP-podcast-episode-42.html

Benjamin Eberlei:
Feature Flags and Doctrine Entities
December 06, 2013 @ 09:40:00

In a new post to his site Benjamin Eberlei takes a look at the idea of "feature flags" (settings to turn on and off major features) and how they can be used with Doctrine entities to handle sync issues between new properties and the database schema.

The problem of feature flags with Doctrine is easily explained: If you add properties for a new feature that is disabled in the Doctrine metadata, then you need to upgrade the database before deployment, even when the feature is not being rolled out for some days/weeks. Doctrine requires the database to look exactly like the metadata specifies it.

His solution was to use the "loadClassMetadata" event in the entity to dynamically append these new properties based on simple "if" checks of feature flags in the configuration object. Obviously using this is a bit of a hack until the new properties are in place, but once they are then the only change is removing this code.

0 comments voice your opinion now!
feature flag doctrine entities class metadata if check

Link: http://www.whitewashing.de/2013/12/05/feature_flags_and_doctrine_entities.html

PHPClasses.org:
Lately in PHP podcast episode 40 - More New Features for PHP 5.6
October 15, 2013 @ 09:28:20

On PHPClasses.org today they've posted the latest episode of their podcast, "Lately in PHP", episode #40 - "More New Features for PHP 5.6".

The proposals of new features for PHP 5.6 continues to come. Several new interesting features are being discussed like named parameters, anonymous classes, nested classes, among other proposals. This was the main topic discussed by Manuel Lemos and Ernani Joppert in episode 40 of the Lately in PHP podcast.

You can listen to this latest episode in a few different ways - either by using the in-page player, by downloading the mp3 or by watching the video of the recorded Google Hangout.

0 comments voice your opinion now!
latelyinphp podcast phpclasses feature upcoming language

Link: http://www.phpclasses.org/blog/post/218-More-New-Features-for-PHP-56--Lately-in-PHP-podcast-episode-40.html

HHVM.com:
Wow HHVM is fast...too bad it doesn't run my code
September 16, 2013 @ 10:54:01

On the HHVM.com blog, there's a post talking about the speed of the HipHop VM (from Facebook) but how it still doesn't support everything built into PHP (and the work being done to bring it up to parity).

HHVM is a highly performant PHP runtime. In fact, it is nearly 40% faster than HPHPc, and only getting faster. [...] Performance is critical, but it isn't everything. In order to gain broader adoption for HHVM, being able to run popular frameworks is a must; in other words, we can have the highest performing PHP runtime, but if doesn't run real-world code without a lot of pain, then it won't be used widely. Understanding this, we are putting serious resources around parity with the PHP runtime.

The post includes a table of features that have been ported and ones currently in the works, based on unit test coverage. They've based it on various well known PHP projects including PHPUnit, Symfony, Laravel, the Facebook SDK and many others. Their initial goal is to allow these frameworks to work 100% of the time inside the HHVM, but to continue the work from there, implementing other PHP features. If you'd like to help out with the process, they also welcome contributions.

0 comments voice your opinion now!
hhvm hiphip virtualmachine speed feature parity framework unittest

Link: http://www.hhvm.com/blog/?p=875

Reddit.com:
What single feature do you want to see added to PHP?
September 06, 2013 @ 10:33:10

On Reddit.com today chadicus has asked the question that seems to make the rounds every so often in the community - what feature would you like added to the PHP language itself (not a class or a library). There's a wide range of responses (including his own for extension classes) like:

  • Native internationalization (I18N) support.
  • Function overloading
  • Native JSON construction/manipulation
  • Consistent naming of the built-in functions (i.e., strpos(), str_rot13()).
  • Variadic function definitions
  • Property Get/Set syntax

Have a feature you'd like to see? Share it!

0 comments voice your opinion now!
language feature want added opinion

Link: http://www.reddit.com/r/PHP/comments/1ltulg/what_single_feature_do_you_want_to_see_added_to/

Phil Sturgeon:
Named Parameters in PHP
September 02, 2013 @ 10:52:40

in a new post to his site Phil Sturgeon talks about a new (old?) proposal to introduce named parameters into PHP.

Named Parameters for PHP is not a new conversation. It's reared its head several times - so much so that the named parameters RFC says: "Since the topic continually gets re-raised, and now PHP has an RFC process, the discussion should be recorded in an RFC (Note this is yet to be done) so the same arguments don't have to be revisited."

He notes the negative attitude that seems to currently be shown in the RFC and has made the offer to rewrite it to be more impartial to the subject at hand. In the comments of the post there's also some feedback about the different syntaxes and varying levels of support for the proposal.

0 comments voice your opinion now!
named parameter language feature rfc rewrite

Link: http://philsturgeon.co.uk/blog/2013/09/named-parameters-in-php

Igor Wiedler:
Evolving syntax
July 31, 2013 @ 11:44:07

In a new post to his site Igor Wiedler looks forward and suggests some alternate syntax for PHP based around the idea of macros from Lisp. These macros would be parsed at runtime and handled directly as code, compiled down from their custom format.

A very common problem that many software projects have is lack of adoption of new versions. Browsers are an excellent example of this, But it exists on the server as well. [...] This leads to this recursive problem of hosting companies not upgrading because they don't have to, and software not requiring newer versions of their programming language, because they don't want to lose their users. The longer your dependency chain is, the more you suffer from this.

He points out that the easier it is to update these lower level pieces, the simpler it is to introduce new things into your system. He suggest that macro-like functionality for PHP could aid in this goal. He talks some about backporting features and how these marcos could make it easier to upgrade just the things we wanted (or all of them) without having to upgrade PHP itself. He even went so far as to create a tool (galapagos) that does this kind of parsing. His examples implement the 5.4 features of short arrays, $this in closures, function array dereferencing and callable typehinting.

Being able to invent your own syntax is very useful, which instantly becomes apparent when you look at the past. Features get added to languages all the time. What if you could do that easily, within minutes instead of months?
0 comments voice your opinion now!
evolve syntax lisp macro feature galapagos parse ast language

Link: https://igor.io/2013/07/26/evolving-syntax.html

The PHP.cc:
PHP 5.5 New CLASS Constant
June 26, 2013 @ 09:02:08

The PHP.cc have posted another article in their series looking at the new features that come with the latest release of PHP (5.5). In this new post they cover the "CLASS" constant.

Last week, the first stable version of PHP 5.5 was released. It introduced a class-level constant, aptly named CLASS, that is automatically available on all classes and holds the fully-qualified name of that class. [...] So why would you need such a constant? [...] When you need the fully qualified name of a namespaced class that is referenced by a namespace alias ... then it gets interesting.

He illustrates with an example of a unit test using stubs and mocks. The normal method requires the definition of the class namespace in the "getMock" call. With the CLASS constant, PHP can extract that information from the namespace referenced in the "use" and drop it in as a replacement.

0 comments voice your opinion now!
class constant php55 new feature namespace unittest

Link: http://thephp.cc/viewpoints/blog/2013/06/php-5-5-new-class-constant


Community Events





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


list install language api unittest configure symfony interview developer podcast series code introduction community framework release wordpress threedevsandamaybe library application

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