PHP Coalface

Here's the main RSS feed from
Sound of Symfony Podcast: Episode 18 - Event sourcing on 25 July 2017

The Sound of Symfony podcast, with hosts Magnus Nordlander and Tobias Nyholm, recently posted their latest episode - Episode #18: .

In this episode we talk a little bit about Webpack Encore, and a lot about Event Sourcing, with our guest, Beau Simensen.

Other topics mentioned in include:

  • Beau's Domain-driven design book
  • Event sourcing libraries like EventCentric, Broadway and Prooph
  • Conferences like SymfonyLive and SymfonyCon Romania

You can listen to this latest episode either using the or by . If you enjoy the show you can and to get updates when new shows are released. Don't call instance methods statically on 25 July 2017

In they talk about calling instance methods statically, more specifically that it should be avoided.

There are quite a few things in PHP 4 that were a bit strange. One example is that PHP 4 allowed static calling of instance methods. [...] To keep backwards compatibility with PHP 4, this code works up to PHP 5, even though [the method in the example[ is not declared static.

[...] Now things will get really weird. When calling an instance method of another class statically, the $this context would carry over from the caller to the called class. In other words, $this suddenly refers to another object instance. While in PHP 5, this used to be an E_STRICT error, PHP 7 will emit an E_DEPRECATED error.

They point out that, while this is definitely odd behavior that shouldn't exist, it hasn't been removed because of PHP's backwards compatibility principles and only removing functionality like this in major versions. So, instead, they recommend calling all non-static methods using an instance of the class injected rather than directly calling them.

Alejandro Celaya: Reusing factories in Zend ServiceManager on 25 July 2017

Alejandro Celaya has a new post to his site showing the Zend Framework users out there how you can . Factories are heavily utilized by the component to create the objects the service returns. Factories tend to be single-use, however, but Alejandro has shown a way around that.

I like zend-servicemanager because it is explicit, and you are always in control of what's done, without loosing flexibility in the process. Since this container expects you to define factories for every service, you usually end up writing, testing and maintaining a lot of factories that doesn't add value to the application.

That's why it is so important to properly reuse factories when possible, not only because you will have to maintain less classes, but because the ServiceManager will instantiate less objects at runtime when it can reuse a factory.

He then talks about ways you can set up shared factories in your application including the use of an abstract factory class or a concrete factory to return other dependencies required. He also shows how to use the ConfigAbstractFactory that allows for the injection of dependencies based on a configuration (similar to the "wiring" in other dependency injection containers). Finally he shows the use of the ReflectionBasedAbstractFactory that handles the injection in about the same way but instead of basing it on a configuration it uses PHP's own reflection to try to determine the class and autoload it into the current system.

Sammy Kaye Powers: Writing tests for PHP source (Part 5 & 6) on 25 July 2017

Sammy Kaye Powers has posted the latest parts in his series looking at testing the PHP language with phpt tests. So far he's helped you , , and . He continues the series with two new posts:

In the 5th part of his series he shows how to use the to locate lines of code in the PHP language core that aren't tested yet, how to create a new test to cover it and generating a code coverage report to see how much you've tested. In Part 6 he shows you how to take what you've created and submit it back to the PHP project on GitHub as a Pull Request (no RFC needed) based on changes from your own forked repository.

Community News: Latest PECL Releases (07.25.2017) on 25 July 2017

Latest PECL Releases:

  • - Version 1.1.2 is same as 1.1 except this release contains this changelog

    • Fixed bug #72988 (Libor M.)
    • Fixed bug #73198 (Langemeijer)
    • Fixed php_url_parse issue (Remi Collet)
    • fix Invalid write of size 1 (Remi Collet)
    • Fixed bug #73819 (Mitch Hagstrand)
    • Fixed bug #73410 (Mitch Hagstrand)
    • Travis CI (Mitch Hagstrand)
    • Various other fixes on PHP 7 code and code cleanup (Mitch Hagstrand, Libor M., Anatol Belski)

  • This release improves PHP 7.2 compatibility support


    • Restore original referent obj handler when it is no longer tracked

  • - Vector's minimum and default capacity down from 10 to 8. - Map and Set's minimum and default capacity down from 16 to 8. - Hash function of arrays is now the length of the array, so O(1).

  • - Merge changes made to unrar up to version 5.5.6. - Support PHP 7.0 and PHP 7.1. - Added functions RarEntry::getRedirType(), RarEntry::isRedirectToDirectory() and RarEntry::getRedirTarget(), as well as the following constants on RarEntry: FSREDIR_UNIXSYMLINK, FSREDIR_WINSYMLINK, FSREDIR_JUNCTION, FSREDIR_HARDLINK and FSREDIR_FILECOPY. - Changed stat handler to return UTC time for creation, modification and access time (does not work reliably on Windows). - Fix cloning of RarArchive being allowed.

  • * PCBC-495: update user management APIs * PCBC-478: add tests for Error Map using CouchbaseMock

  • - Mark release as stable - Change minimum version to 5.4.0

  • - Mustache delimiter preprocessing support behind the compat flag - Property lookup now generates a closure from a method if the value of the property is null or does not exist to emulate the behaviour of javascript where functions and properties share a symbol table - only supported for PHP 7 or greater - Changed target handlebars.c version to 0.6.4

  • Requires at least php 7.0 and libsodium 1.0.9.

  • Requires at least php 7.0 and libsodium 1.0.9.

Also from, here are some Security links:

No channel data


It's quiet in here...Add your comment