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

Sammy Kaye Powers:
Writing tests for PHP source (Series)
Jul 21, 2017 @ 11:21:48

Sammy Kaye Powers has a series of posts over on his site introducing you to testing the PHP language with .phpt tests. So far he's introduced the topic, shown how to run the tests and debugging failing tests.

If you've ever wanted to get involved with PHP internals, writing tests is a great way to get your foot into the door. The tests are written in PHP so you don't even need to know C to get started.

Each of the posts also comes with a screencast, narrated by Sammy, showing the information presented in the tutorial:

There's more to come in the series as he still plans to teach about how to fix current tests and how to eventually create your own. Stay tuned to his site for more tutorials in the series.

tagged: test unittest phpt language source series part1 part2 part3 part4

Link: https://www.sammyk.me/compiling-php-from-source-writing-tests-for-php-source

PHP.net:
PHP 7.2.0 Beta 1 Released
Jul 20, 2017 @ 12:49:13

In an announcement on the main PHP.net site, the PHP development team as officially announced the release of the first beta for PHP 7.2.0 - beta 1.

The PHP development team announces the immediate availability of PHP 7.2.0 Beta 1. This release is the first beta for 7.2.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

[...] PHP 7.2.0 Beta 1 builds on previous releases with: the much anticipated Sodium extension, Opcache improvements, Countable support for DOMNodeList and DOMNamedNodeMap improved handling for invalid UTF8 in json_decode() and many bugfixes...

You can find the complete list of updates in the NEWS entry for this beta and, as always, you can download this preview release from the QA downloads page or from windows.php.net/qa for the Windows binaries.

tagged: language beta release php72beta1

Link: http://php.net/index.php#id2017-07-20-1

Ben Ramsey:
Announcing Testfest 2017
Jul 17, 2017 @ 11:14:53

In a new post to his site long time PHP community member Ben Ramsey has officially announced PHP Testfest 2017, an event that gathers developers to write tests for the PHP language itself to help improve its quality and show them how to contribute back to the project.

For those who’ve been around the PHP community for a while, you’ll recall the successful PHP TestFest events that began after a discussion at PHP Quebec in 2008. Many user groups and mentors signed on to host and help with events, and a lot of folks became first-time contributors to the PHP project, helping improve our code coverage. It ran strong in a global sense from 2008 to 2010. After that, various groups (particularly the Brazilian groups) have continued the tradition.

A few months ago, at php[tek] in Atlanta, I mentioned to Michelangelo that I’d love to bring back PHP TestFest. Sammy had given an excellent talk on writing PHPT tests, and <a href="https://twitter.com/ellotheth/status/868583446498734084>Gemma tweeted a link to the old PHP TestFest wiki page. From there, things snowballed.

Ben the provides the details of the planned Testfest that will run for four months and can be worked on from anywhere, not just one single event. The plan is to have it run from September through December of 2017 and there's plenty of support to help out. Organizers can email for more help getting started. There's also a website, Google Group and IRC channel as well as tools and resources to help bring you up to speed on testing the PHP language with phpt tests.

tagged: testfest17 testing language phpt event quality testfest community

Link: https://benramsey.com/blog/2017/07/phptestfest/

PHP.net:
PHP 7.1.7 Released
Jul 07, 2017 @ 12:04:24

The PHP.net site posted the announcement about the release of the latest version in the PHP 7.1.x series: PHP 7.1.7:

The PHP development team announces the immediate availability of PHP 7.1.7. This is a security release with several bug fixes included. All PHP 7.1 users are encouraged to upgrade to this version.

Bugs fixed in this version include issues in the language core, Date handling, image functionality (GD) and opcache handling. You can view the full changelist here and grab the latest downloads either from the main downloads page (source) or from windows.php.net (binaries).

tagged: language

Link: http://php.net/index.php#id2017-07-06-3

PHP.net:
PHP 7.2.0 Alpha 3 Released
Jul 06, 2017 @ 11:35:50

On the PHP.net site they've posted the announcement about the release of the latest alpha in the PHP 7.2.0 series: PHP 7.2.0 Alpha 3

The PHP development team announces the immediate availability of PHP 7.2.0 Alpha 3. This release contains fixes and improvements relative to Alpha 2. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

This release is intended for development only and is not to be used in production. The NEWS section for this release contains updates that are new to this alpha, mostly around bugfixes (but some new features are slowly working in for the final 7.2.0 release). As always you can download the source packages from the QA downloads page or grab the Windows packages for this alpha from the Windows QA site.

tagged: language release php72 alpha3

Link: http://php.net/index.php#id2017-07-06-2

Zend Developer Zone:
Deprecations in PHP 7.2
Jun 28, 2017 @ 11:20:50

On the Zend Developer Zone there's a new post sharing some of the deprecations coming with PHP 7.2, the next release in the 7.x series (planned release sometime later this year).

PHP is a living language and as such, as some things are added, others are removed. Since PHP adheres to the best practice of Semantic Versioning, nothing will be going away in PHP 7.2, but some things will be marked as “Deprecated” so that developers can start removing them from their code and finding better ways to get the job done.

PHP 7.2 brings us a new list of things that will be eventually going away. The complete list, as well as explinations and voting can be found at “PHP RFC: Deprecations for PHP 7.2

They include a "hit list" of the functionality that will be affected including the removal of support for __autoload, the create_function function, removal of assert and the (unset) cast. The RFC has been moved to the "Accepted" state so now work will be done to make these and other deprecations happen in this next great release.

tagged: language deprecation php72 list rfc

Link: https://devzone.zend.com/7628/deprecations-php-7-2/

SitePoint PHP Blog:
There’s a Gender Extension for PHP
Jun 26, 2017 @ 13:58:25

On the SitePoint PHP blog there's a new post from editor Bruno Skvorc sharing information about a "gender" extension for PHP that tries to guess the gender of a first name.

Recently, I ventured into a section of the PHP manual which lists extensions that are used to help with Human Language and Character Encoding. I had never looked at them as a whole – while dealing with gettext, for example, I always kind of landed directly on it and ignored the rest. Well, of those others, there’s one that caught my eye – especially in this day and age given the various controversies – the Gender extension.

This extension, in short, tries to guess the gender of first names. As its introduction says: "Gender PHP extension is a port of the gender.c program originally written by Joerg Michael. The main purpose is to find out the gender of firstnames. The current database contains >40000 firstnames from 54 countries."

This is interesting beyond the fact that the author is kinda called George Michael. In fact, there are many aspects of this extension that are quite baffling.

He then walks through some examples of putting the extension to use, evaluating various names in different languages and gauging the results. The extension allows for definite answers (is male/female), relative results, unisex, a "couple" or, when all else fails, erroring or giving a "not found" result. It also can check for "nicknames" for common names. He walks you through getting it installed and shows other functionality for getting similar names and checking for nicknames, showing code examples and the resulting output.

tagged: gender extension language tutorial introduction install example

Link: https://www.sitepoint.com/theres-a-gender-extension-for-php/

Marco Perone:
Maybe in PHP
Jun 22, 2017 @ 10:35:16

In a recent post to his site Marco Perone looks at the idea of "maybe" in PHP, having functionality that acts a default value if no value is present. This idea is implemented in other languages like Haskell and Elm.

Doing functional programming in a language as PHP, which is almost completely used as an imperative or object oriented way, is not always easy. Good progresses have been made thanks to the introduction of callable type hints in PHP 5.4 and the diffusion of functional interfaces like the ones present in PSR-7.

Still, all “good” PHP code is still written using objects and classes and the object oriented perspective on the world strongly influences even the most functional oriented libraries.

In this post I would like to propose as an example how we could implement the Maybe type in PHP. We will see how some open source libraries do this, we will see an alternative solution and we will raise concerns about some modelling issues.

He starts off by describing what the "maybe" functionality is and gives some examples of it in use in other languages. He points out that while there's several PHP libraries that implement this kind of default handling, it's not in the PHP core language. He works through some of these libraries and shows them in use: monad-php, Phunkie, php-maybe-monad and php-fp-maybe. He wraps up the post showing his own suggested implementation and how it could help resolve some of the issues he found with the other libraries as he worked through them.

tagged: maybe language default variable functional tutorial library

Link: http://marcosh.github.io/post/2017/06/16/maybe-in-php.html

PHP.net:
PHP 7.2.0 Alpha 2 Released
Jun 22, 2017 @ 09:12:12

The PHP.net site has announce the latest alpha release for the upcoming PHP 7.2.0 release: PHP 7.2.0 Alpha 2:

The PHP development team announces the immediate availability of PHP 7.2.0 Alpha 2. This release contains fixes and improvements relative to Alpha 1. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

[...] For information on new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive.

As these are just development releases, the downloads for them are on the QA sites: source packages and Windows binaries. The final alpha for PHP 7.2.0 (third) will be published July 6th. Next comes the beta stage then Release Candidates. You can see the full release schedule plan here.

tagged: language alpha release php72 download

Link: http://php.net/index.php#id2017-06-22-1

SitePoint PHP Blog:
How to Set up an Online Multi-Language Magazine with Sulu
Jun 12, 2017 @ 12:17:01

The SitePoint PHP blog has a new tutorial posted by editor Bruno Skvorc showing you how to set up an online multi-language magazine with the help of the Sulu CMS. This article is a follow up to their previous "Getting Started" tutorial helping you get Sulu up and running.

We previously demonstrated the proper way to get started with Sulu CMS by setting up a Hello World installation on a Vagrant machine. Simple stuff, but can be tricky.

[...] This time we’ll look into basic Sulu terminology, explain how content is formed, created, stored, and cached, and look into building a simple online magazine with different locales (languages).

The tutorial then covers pages and page templates including what the Twig markup looks like, how to work with them in the UI and the end result of their sample "Hello world" page. There's a brief section about caching before he moves into the main part of the tutorial: the creation of the magazine. He covers the use of Jackalope, ElasticSearch and the ArticleBundle and how to get them up, running and playing nicely together. The article wraps up with a look at locales and how they work in the Sulu setup.

tagged: tutorial online multilanguage locale language magazine sulu cms

Link: https://www.sitepoint.com/set-online-multi-language-magazine-sulu/