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

Jordi Boggiano:
Common files in PHP packages
Apr 21, 2016 @ 09:29:15

Jordi Boggiano has a new post to his site today sharing some interesting PHP package statistics he gathered as a part of the metadata in the Composer/Packagist ecosystem.

This one started in a peculiar way. Paul M. Jones announced a new version of his Producer tool, I had a look at it and saw that it recommended having a changelog called CHANGES.md by default. [...] My first thought was to report an issue asking to change the default, but then I thought it's Paul, he will not just take my word for it, he will want hard facts. So here I am two days later. I queried GitHub's API for the file listing (only the root directory) of all PHP packages listed on packagist.org. What this let me do is look at what files are commonly present (and not), which is quite interesting to get a picture of the whole ecosystem.

He queried about 79,000 packages and found some interesting patterns in the results. These included findings like:

  • 8% have a DependencyInjection/ directory, which I believe indicates Symfony bundles
  • 3.6% have a examples/ and 3.5% a docs/ directory
  • 49% have some file or directory indicating the presence of tests (phpunit.xml & co)
  • 14% have committed their composer.lock
  • 8% show a presence of some code quality/style CI (scrutinizer, codeclimate, styleci)

There's some other interesting statistics in the post around license files, changelogs and CLI binaries too. He's also posted the full data set for anyone interested in running some of their own statistics on the results.

tagged: package statistics packagist composer data results summary

Link: https://seld.be/notes/common-files-in-php-packages

Taha Shashtari:
A Gentle Introduction to Testing in PHP
Feb 02, 2016 @ 10:11:20

If you're not already doing testing (like unit testing) in your PHP-based applications but want to start, this new post on Taha Shashtari's site might just be for you. It provides a "gentle introduction" to unit testing, what it is and some of the tools you can use to get started.

Learning testing can be very overwhelming especially if you're just starting out. [...] You might have read a bunch of PHPUnit tutorials and maybe you tried to apply some of what you've learned in your projects, but it doesn't always feel right. And sometimes you get into situations where you have no clue how to test some feature in your application.

If anything of this happened to you, don't feel bad, we all have had this experience. And it's almost because of the way we learn it.

He starts by talking about some of the main goals of testing in your application and the difference between manual and automatic testing. He then gets into each of the three main testing types and follows it with links (and summaries) to tools you can use to get started testing. He ends the post with a brief look at test-driven development and, setting the stage for the next tutorial in the series, looks at the path ahead.

tagged: tdd definition basic introduction gentle testing unittest phpunit tools summary

Link: http://taha-sh.com/blog/a-gentle-introduction-to-testing-in-php

SitePoint PHP Blog:
Sourcehunt PHP: Contribute to Crypto, Validation, Payments…
Nov 19, 2015 @ 11:17:54

The SitePoint PHP blog has published the first edition of their "Sourcehunt" effort, sharing several PHP libraries to promote them and give them wider exposure to the community at large. In this post they talk about tools covering a wide range of functionality including cryptography, validation, user agent parsing and "humanizing" strings.

Last month, we introduced a new effort called Sourcehunt – a category of post intended to direct attention to less popular open source projects that show promise and need exposure. We’ve called for new submissions and accumulated an impressive list.

Included in their list for this edition are tools like:

...and many more. A summary of the features, code and output examples are provided for most of the tools mentioned and the number of GitHub stars at the time of the posting is listed next to each library name.

tagged: sourcehunt sitepoint library tool spotlight example summary

Link: http://www.sitepoint.com/sourcehunt-php-contribute-to-crypto-validation-payments/

JetBrains Blog:
PHP Annotated Monthly – September 2015
Sep 11, 2015 @ 11:19:16

On the JetBrains blog Gary Hockin has just posted the latest "PHP Annotated Monthly" edition for September 2015. These posts cover recent happenings in the PHP community, linking to more information and the people involved.

As the autumn conference season begins to ramp up, it’s time for the September edition of PHP Annotated Monthly – bringing you all the news, tips, tricks and tutorials from the PHP community.

He touches on three main topics - the PHP language itself, news about various frameworks and tools talked about over the month and happenings in the community itself. Some of the topics mentioned include:

...and lots more. Check out the full post for more topics and links to plenty of others. You can also check out some of the back issues on the Annotated Monthly archive page.

tagged: jetbrains phpannotated monthly sept2015 newsletter summary language community framework articles

Link: http://blog.jetbrains.com/phpstorm/2015/09/php-annotated-monthly-september-2015/

JetBrains Blog:
PHP Annotated Monthly – July 2015
Jul 16, 2015 @ 08:40:29

The JetBrains blog has just posted their latest edition of the "PHP Annotated Monthly" series with their review for July 2015.

Our July issue of PHP Annotated Monthly is here, bringing you updates on PHP, frameworks, tools, tips for coding, community, and more. Read this month’s digest curated by Mikhail Vink, PhpStorm Product Marketing Manager.

In this month's article there's mentions of things like:

  • New PHP versions released
  • Work on PHP7
  • Updates to various frameworks and tools
  • Being able to order an elePHPant on demand (and the funding of the woolly mammoth
  • PHP cheatsheets
  • Information about contributing back to PHP

Check out the full post for even more topics and links to other great resources.

tagged: jetbrains phpannotated monthly july2015 newsletter summary language community framework articles

Link: http://blog.jetbrains.com/phpstorm/2015/07/php-annotated-monthly-july-2015/

SitePoint PHP Blog:
PHP7 Resource Recap
Apr 30, 2015 @ 09:46:10

With all the talk about PHP7 and the features that are coming with it, it's easy to get lost in the mound of information. Thankfully, the SitePoint PHP blog is here to help. They've posted a roundup of several PHP7-related resources you can use to sort things out (or start learning about) what's to come.

PHP 7 is well on its way. RFCs are being implemented and polished, projects are being tested, libraries upgraded. Extensions are being modified, and the word is spreading. All that remains is getting the shared hosts on the upgrade bandwagon – the arguably most difficult part of improving the global state of PHP. In this article, we’ll take a look at some of the most important PHP 7 related resources and tips you should go through in preparation for the new version.

Mentions in their list include both tutorials and tools including the PHP7 Vagrant box provided by Rasmus Lerdorf and the Go PHP7 Extensions effort to update extensions to be PHP7 ready. Following this there's serveral links to other important reading about what to expect and results of testing done with this upcoming version.

tagged: php7 resource recap summary tool article tutorial

Link: http://www.sitepoint.com/php7-resource-recap/

Pascal Martin:
In favor of RFC "Scalar Type Hints"
Feb 09, 2015 @ 09:40:18

Pascal Martin has a new post today sharing some of his thoughts around one of the currently proposed PHP RFCs for < href="http://blog.pascal-martin.fr/post/in-favor-of-rfc-scalar-type-hints.html">scalar type hinting. PHP has had type hints for custom objects and some things like arrays but this proposal would add in additional ones for things like "string", "int" and "float".

The Scalar Type Hints RFC for PHP 7 has first been initialized in December 2014. It went on with version 0.2 at the middle of January 2015, after changing several major ideas, and is now in version 0.3, integrating return types, as RFC Return Type Declarations has been accepted a few days ago. [...] I’ve been following this RFC (and the previous ones) with some interest, and, as I’ve taken some time to play with it a bit last week, building PHP from the sources of the corresponding Git branch, I’ll try summarizing here why I think it is interesting. Please note this is my personal opinion.

He starts with a look at what the proposal entails around these new scalar type hints and why he thinks they're a good idea. He looks at some of the things that PHP's current weak typing allows and how it has made the language very flexible as a result. He also shows how the proposal suggests the use of the "declare" function to define a strict typing constant to essentially turn on the checking only where needed. He provides a few code snippet example including object/method handling, setting a custom error handler and which of the calls work in which typing method. He finishes the post looking at the "per-file" idea of enabling the strict typing checks and some of his confusion around the point. He also talks about return types, the directives that are proposed to enable the feature and the current status of the RFC.

tagged: scalar type hint rfc summary proposal php7 opinion overview

Link: http://blog.pascal-martin.fr/post/in-favor-of-rfc-scalar-type-hints.html

Matthew Weier O'Phinney:
PSR-7 By Example
Jan 29, 2015 @ 09:13:20

As a part of his involvement in the PHP-FIG standards group, Matthew Weier O'Phinney has been contributing to the PSR-7 proposal. This proposal defines a standardized structure for HTTP message handling. In his latest post he gets into a bit more detail on what this means for the PHP developer and how it might be implemented.

PSR-7 is shaping up nicely. I pushed some updates earlier this week, and we tagged 0.6.0 of the http-message package last week for implementors and potential users to start coding against. I'm still hearing some grumbles both of "simplify!" and "not far enough!" so I'm writing this posts to demonstrate usage of the currently published interfaces, and to illustrate both the ease of use and the completeness and robustness they offer.

He starts with a base definition of what the proposal, well, proposes around HTTP messaging, both the incoming and outgoing. He describes the basic structure of an HTTP message and what each part represents. He talks about message headers, bodies and how the current library could return that content. He then looks at requests vs responses, server-side requests and some various uses cases and more practical examples:

  • HTTP Clients
  • Middleware
  • Frameworks

With the PSR-7 standard in place, all of these different tools could have interchangeable interfaces for HTTP request/responses, easily swappable with any other implementation.

tagged: psr7 http message request response summary tool framework middleware client

Link: https://mwop.net/blog/2015-01-26-psr-7-by-example.html

Pascal Martin:
October 2014 on internals@php
Dec 01, 2014 @ 11:03:32

Pascal Martin has posted his latest summary of the discussions happening on the php.internals mailing list for the month of October 2014.

809 messages have been exchanged in October 2014 on PHP’s internals@ mailing-list — a bit more than in September. [...] First of all, PHP 5.6 has entered its normal cycle of releases, with a first maintenance version at the beginning of the month.

He includes a graph of the (monthly) number of emails over the last year and how October fits in. Topics mentioned include:

If you'd like to follow along with the discussions or are interested in getting an "inside look" at what's going on with the language, you can use either the web-based reader or subscribe to the mailing list.

tagged: phpinternals mailinglist summary oct2014 rfc discussion

Link: http://blog.pascal-martin.fr/post/php-mailing-list-internals-october-2014-en

Pascal Martin:
September 2014 on internals@php
Oct 07, 2014 @ 09:35:15

Pascal Martin has posted his latest edition of the happenings on the PHP internals mailing list for the month of September. In this latest edition he covers some of the major topics discussed this past month including:

  • the "Implicit isset() in Shorthand Ternary Operator" RFC (or, as it came to be known, the "Null Coalesce Operator" RFC)
  • An RFC for a "loop + or control structure"
  • an opinion to make PHP 7 transtyping operations more strict
  • the RFC to "Remove alternative PHP tags"
  • another RFC proposed to "Fix list() behavior inconsistency"

There's links to lots of other topics and various messages on the list including lots of other RFCs and plenty of discussion around them. Check out the full post for more great information and links around last month's php.internals happenings.

tagged: internals september mailinglist sept2014 summary rfc discussion

Link: http://blog.pascal-martin.fr/post/php-mailing-list-internals-september-2014-en