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

PHP Roundtable:
035: Immutable PHP
Nov 25, 2015 @ 09:53:44

The PHP Roundtable podcast has posted their latest episode, recorded live with host Sammy Kaye Powers and guests Larry Garfield, Matthew Weier O'Phinney and Glen Hickle talking about immutability in PHP.

Immutability plays a huge role in functional programming and many languages support immutability directly; like the readonly keyword in C#. It is possible to create immutable objects in PHP, but the language lacks inherent immutable features for scalar variables and class properties. We discuss how to bring functional programming concepts to PHP and brainstorm some features that could possibly be added to future versions of PHP to offer better immutability support.

You can watch the live recording of this latest episode either through the in-page video player or directly over on YouTube. If you enjoy the show, be sure to also subscribe to their feed and follow them on Twitter for information on the latest episodes (and when future live recordings are happening).

tagged: phproundtable ep32 immutability programming feature functional support

Link: https://www.phproundtable.com/episode/immutability-and-functional-concepts-in-php

JetBrains Blog:
Docker Support in PhpStorm
Nov 03, 2015 @ 10:08:35

In this recent post to the JetBrains blog they show how to set up and configure the Docker support the latest version includes built in to the IDE.

Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications.

With the new Docker integration plugin for PhpStorm, you can add Docker support to existing projects, view logs, manage Docker containers, and debug PHP web applications from right inside PhpStorm.

They help you get the integration plugin installed and show you where the machine should be located and how to set it up under PHPStorm's deployment options. Next up they include the steps for getting the Docker machine up and running (again, inside the IDE) and managing the containers related to the machine.

tagged: docker support phpstorm ide jetbrains container machine

Link: http://blog.jetbrains.com/phpstorm/2015/10/docker-support-in-phpstorm/

HHVM Blog:
LLVM Code Generation in HHVM
Oct 29, 2015 @ 12:08:22

In this post to the HHVM blog they answer a common question they get from the development community: why don't they use LLVM for code generation when compiling down the PHP.

The primary reason has always been that while LLVM is great at optimizing C, C++, Objective-C, and other similar statically-typed languages, PHP is dynamically typed. The kinds of optimizations that provide huge performance benefits for static languages tend to be less useful in dynamic languages, or at least overshadowed by all the dynamic dispatching that’s done based on runtime types. We knew that there was probably something to be gained from using LLVM as a backend, but there were many larger opportunities go after first.

They talk about the compilation pipeline HHVM uses and shows the difference between how it works versus how LLVM would integrate into the final steps. They also talk about the work put in to explore the use of LLVM IR and what kind of changes they had to make to support it. This includes updates to PHP function call handling, generalizing vasm and updates to the LLVM tool itself (with changes to location records, smashable calls and performance tweaks among others).

tagged: hhvm llvm code generation compilation changes updates support

Link: http://hhvm.com/blog/10205/llvm-code-generation-in-hhvm

PEAR Blog:
PEAR 1.10.0 with PHP7 support is out
Oct 07, 2015 @ 12:55:22

In a quick post on the PEAR blog there's an announcement about the release of a version of the tool with full PHP 7 support, version 1.10.0.

After a year of development, PEAR [version 1.10.0](http://pear.php.net/package/PEAR/download/1.10.0) has been released. It works on PHP7 and is [E_DEPRECATED](http://php.net/manual/en/errorfunc.constants.php#errorfunc.constants.errorlevels.e-deprecated-error) and [E_STRICT](http://php.net/manual/en/errorfunc.constants.php#errorfunc.constants.errorlevels.e-strict) compatible.

Apart from those big changes, a number of annoying bugs have been fixed and some features implemented – have a look at the release notes and the roadmap. Thanks to Ferenc Kovacs, Hannes Magnusson, Remi Collet and Ken Guest for their patches.

The post includes the commands you'll need to do to upgrade to this latest version, a simple two-step process of clearing the current cache and performing the upgrade. If you're installing PEAR for the first time, you can follow along with the documentation to get up and running quickly.

tagged: pear php7 support release announcement

Link: http://blog.pear.php.net/2015/10/07/pear-1-10-0/

Laravel News:
Homestead now with PHP 7 support
Oct 02, 2015 @ 10:52:41

In a quick post on the Laravel News site they point out that the Laravel Homestead virtual machine now has support for PHP 7:

Laravel Homestead just received a new update with support for PHP 7 which is due out this month.

If you are already using the PHP 5.x Homestead box, you can upgrade your installation to PHP 7.0 by cloning the php-7 branch of the laravel/homestead repository into a new folder.

With two other simple steps you can quickly upgrade your box to be running PHP 7 - updating the Homestead.yml configuration and running a vagrant up. You can find out more information about this update in the official documentation.

tagged: laravel homestead php7 support upgrade configuration vagrant

Link: https://laravel-news.com/2015/10/homestead-now-with-php-7-support/

Laravel News:
How To Add Multilingual Support to Eloquent
Sep 09, 2015 @ 09:36:52

The Laravel News site has a tutorial they've posted showing you how to help internationalize your application by adding multilingual support to Eloquent in your database schemas.

Did you know that several countries throughout the world have more than one official language? For example, my home country Belgium has three; French, Dutch, and German. Most Belgians also speak English. Laravel’s Eloquent ORM is a very powerful part of Laravel. Unfortunately, it doesn’t provide support for multilingual models out of the box. Adding that functionality yourself isn’t that difficult.

They start with a basic migration with no multilingual support included, a simple "articles" table. They show how support could be included by adding columns for languages but suggests that using a "translated" table for the other versions is a better option. With this schema in place, they then show how to use the laravel-translatable package and Translatable trait to handle the pull and push of the translated data from the database automatically. It can even be set up to pull which version it should display directly from the application's locale setting.

tagged: multilingual support eloquent translatable package locale tutorial

Link: https://laravel-news.com/2015/09/how-to-add-multilingual-support-to-eloquent/

PHPUnit 4.8: Code Coverage Support
Aug 10, 2015 @ 08:48:52

Sebastian Bergmann has posted about some updates in the latest version of the PHPUnit PHP unit testing tool (v4.8) and changes in code coverage handling.

PHPUnit 4.8 introduces a couple of small improvements. For instance, the @testWith annotation was added as "syntactic sugar" for defining data providers and the --no-coverage commandline option was added for ignoring any code coverage configuration from the configuration file.

PHP_CodeCoverage, the library used by PHPUnit to collect, process, and report code coverage information, has been updated for PHPUnit 4.8. It can now collect code coverage information on PHP 7 without the need for a third-party extension such as Xdebug. And PHP_CodeCoverage's HHVM driver has been updated to reflect changes to how HHVM provides code coverage information.

He gets into a bit more detail about the updates to both the PHP 7 handling and changes for HHVM, including how to call it for PHP 7 (phpdbg vs just the normal CLI) and how HHVM no exposes its coverage information publicly. This makes it simpler for PHPUnit to grab the data without special handling code. He also looks ahead to PHPUnit 5, scheduled for release in October 2015, and that some functionality will be deprecated when the version is changed.

tagged: phpunit codecoverage support php7 hhvm changes phpdbg public

Link: https://thephp.cc/news/2015/08/phpunit-4-8-code-coverage-support

Symfony Blog:
PSR-7 Support in Symfony is Here
Jun 01, 2015 @ 12:19:15

The Symfony project has officially announced PSR-7 support in the latest version of the framework. PSR-7 is a recently approved standard by the PHP-FIG to make a more structured HTTP request and response structure (to aid in interoperability).

Less than 2 weeks ago, the PHP community roundly accepted PSR-7, giving PHP a common set of HTTP Message Interfaces. This has huge potential for interoperability and standardization across all of PHP. This is especially true for middleware: functions that hook into the request-response process. In the future, a middleware written around these new interfaces could be used in any framework. [...] Today, a huge number of projects use Symfony's Request and Response classes (via the HttpFoundation component), including Laravel, Drupal 8 and StackPHP.

[...] For that reason, we're thrilled to announce the 0.1 release of the PSR HTTP Message Bridge: a library that can convert Symfony Request and Response objects to PSR-7 compatible objects and back. This means that once there are middleware written for PSR-7, applications using HttpFoundation will be compatible.

The bridge makes it simpler to swap out the HTTP layer by converting the HTTP objects into something other frameworks can use (or so others can be used by Symfony). They provide some examples of how to put it to use, converting objects both to and from the standard Symfony HttpFoundation versions. There's also a quick note about the RequestInterface and ResponseInterface structure that allows you to bridge your own gaps between the PSR-7 friendly components and Symfony.

tagged: psr7 support httpfoundation request response http bridge phpfig

Link: http://symfony.com/blog/psr-7-support-in-symfony-is-here

PHP Roundtable:
015: SemVer, Licensing & OS Support Expectations
Mar 20, 2015 @ 12:56:03

The PHP Roundtable podcast has posted their latest episode, part two in a series looking at semantic versioning, open source support expectations and licensing. This new episode features guests Colin O'Dell and Chris Tankersly.

Part 2 of an on-going series on open source. We discuss a number of open source topics including what the expectations are for support of an open source project. We also discuss how to use SemVer to successfully maintain an open source package and what we can do when SemVer is not an option. And finally we take a look at licensing and discuss why we need to be concerned with it.

You can listen to this latest episode by checking out the video of the live recording, coming in at about 1 hour. If you enjoy the show, be sure to subscribe to their feed to get the latest updates on when new episodes are available.

tagged: phproundtable podcast video semver licensing opensource support expectation

Link: https://www.phproundtable.com/episode/semver-licensing-os-support-expectations-open-source-series-part-2

Rafael Dohms:
Why I support “The League”
Mar 11, 2015 @ 12:47:27

Rafael Dohms has posted some if his own thoughts to his site about The League of Extraordinary Packages and why he supports their efforts to bring a good solid base of curated packages to the PHP ecosystem.

“The League of Extraordinary Packages” is what I have dubbed a collective of composer packages. Its essentially a group of developers who have gathered under a single flag (or in this case a vendor name) and set standards for the packages that live there.

Why does this even matter? Well for one Packagist is an open repository, this means that it is wide open for anyone to join, from the best packages to the most ridiculous ones. Quality control is not one of its roles and quality checking is on average 2-3 clicks per package away.

He talks about the quality control measures The League has in place to only contain good, well-tested and solid PHP packages. He also lists a few of his main reasons for supporting the effort including the fact that it reduces author fragility and provides an extended reach for those packages to reach a wider audience.

I really enjoy the work being done by The League, or The PHPLeague, or Pleague as I prefer to call it. I think it has provided us with some very good packages and given us all something to strive for. Maybe more collectives is what we need.
tagged: thephpleague support packages extraordinary packagist curated

Link: http://blog.doh.ms/2015/03/10/why-i-support-the-league/