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

Three Devs & A Maybe:
Episode 61 - Conference Experiences, RFC's & The PHP League with Phil Sturgeon
Apr 20, 2015 @ 08:58:40

The Three Devs and a Maybe podcast has posted an episode recently talking about some of their own experiences at conferences, RFCs and an interview with special guest Phil Sturgeon.

This episode we are fortunate enough to have Phil Sturgeon back on the show. Originally recorded on the 11th Feb and only now being released (blame Edd), the show starts of with a comparison between Phil and Fraser's snowboarding injuries. We then move on to discuss standing desks, Sunshine PHP, American weather, and conference experiences. Following this DDD (Development Driven Development...) is touched upon, along with a look at the current stack Phil is using at work. Finally we chat about the 'attack-of-the-clone' packages Phil has noticed around the PHP community (ultra-tiny-small-restful frameworks etc.) and how far the 'The League of Extraordinary Packages' has grown.

They talk some about The League but also about other topics including the No Capes podcast, the PHP UK Conference, the domain-driven design community and scalar type hints. You can listen to this recent episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the show, consider subscribing to their feed too.

tagged: threedevsandamaybe podcast ep61 conference experience rfc thephpleague philsturgeon

Link: http://threedevsandamaybe.com/conference-experiences-rfcs-and-the-php-league-with-phil-sturgeon/

Medium.com:
PHP7: More strict! (but only if you want it to be)
Mar 18, 2015 @ 10:48:38

In this new article Er Galvao Abbott talks about the struggle (and finally, inclusion) of type hinting in PHP, more specifically coming in PHP7, and how strict they can be.

It wasn’t easy (we knew it wouldn’t be) and certainly wasn’t pretty (we sort of knew that as well), but it’s finally official: PHP7 will come with Scalar Type Hints (STH) and an optional “strict mode”. [...] This is basically a step towards a more strict way of coding in PHP. Will we see more steps in that direction in the future? We don’t know and we’re OK with that for now. What’s brilliant about the body of work represented by these RFCs is that by implementing their concepts and specially making the “strict mode” optional the choice of being more strict remains with the programmer.

He talks some about the background of the want and need for strict typing in PHP and mentions three RFCs that will influence the type hints and handling in PHP7:

He summarizes each RFC and what it contributes to the language. He ends the post by dispelling one thing about all of this new typing functionality - PHP will remain loosely typed, this new functionality is in a "strict mode" only used when specified.

tagged: php7 strict type hint mode rfc introduction feature

Link: https://medium.com/@galvao/php7-more-strict-but-only-if-you-want-it-to-be-78d6690f2090

Phil Sturgeon:
PHP 7 Feature Freeze
Mar 16, 2015 @ 09:04:44

Phil Sturgeon has a new post to his site looking at the PHP7 feature freeze for this upcoming major PHP release (implemented as of yesterday, the 15th). In it he provides a list of features, their related RFCs and how likely they are to make it into PHP7.

Today was the feature freeze for PHP 7. That means no new votes can be started for a feature that is aimed at PHP 7.0, and would instead have to go into PHP 7.1. Instead of heading out to St Patric’s Day with a bunch of New Yorkers making dubious claims about their tenuous connection to Irish ancestry as an excuse to drink, I thought it would be a good time to review some of the more recent RFCs that made it in, and those that didn’t.

His list includes:

  • Remove PHP 4 Constructors
  • Spaceship Operator
  • Replacing current json extension with jsond
  • Skipping Optional Parameters for Functions
  • Constructor behaviour of internal classes
  • Reclassify E_STRICT notices

Each one has a link to the current version of the RFC, the current status and Phil's own opinion of the feature (usually just one word).

tagged: php7 feature freeze rfc list status opinion

Link: https://philsturgeon.uk/php/2015/03/15/php-7-feature-freeze/

Anthony Ferrara:
Scalar Types and PHP
Feb 12, 2015 @ 11:25:47

Anthony Ferrara has tossed his own hat into the ring around the debate that's been going about the RFC for scalar type hints in PHP. In his post he agrees with (most of) the suggestions made in the proposal around strict, weak and the "compromise" of mixed typing.

There's currently a proposal that's under vote to add Pascal Martin's excellent post about it. What I want to talk about is more of an opinion. Why I believe this is the correct approach to the problem.

He starts off talking about the "all strict" angle that some suggested as the proper approach then moves into the "weak argument" explaining the difference between the two. He shares a bit of history around the problems detecting subtle bugs caused by typing issues and how it is definitely a problem that needs solving. Finally, he talks about the mixed-typing compromise and provides some code samples showing a common bug that can happen with weak typing.

tagged: scalar type hint rfc opinion example weak compromise mixedtype

Link: http://blog.ircmaxell.com/2015/02/scalar-types-and-php.html

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

Stanislav Malyshev:
Objects as keys
Dec 15, 2014 @ 09:18:50

In his latest post Stanislav Malyshev looks at a RFC he's proposed to allow array keys to be objects including some of his thoughts behind the proposal and how he sees it being helpful to the language.

I’m going to put to vote soon another of my RFCs, namely one about “objects as keys“. So, I want to outline the case for it here and address some criticisms and questions raised while discussing it.

He starts off by answering the "why" question, mentioning specially the introduction of things like GMP numbers and how, despite them seeming to work like numbers, other things can be done with them. He talks about how you'd use this functionality "the right way" and how that'd relate back to value objects. He answers a few other questions about the proposal including why it's better than just using __toString or spl_object_hash instead. He spends the rest of the post looking at some of the implementation problems, disadvantages and some of the possible names (function names) for the handling.

tagged: object array key rfc proposal gmp number

Link: http://php100.wordpress.com/2014/12/14/objects-as-keys/

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

Stanislav Malyshev:
unserialize() and being practical
Nov 04, 2014 @ 10:49:40

Stanislav Malyshev has a new post to his site talking about his proposal for a filtered unserialize change and why he sees it as a practical next step.

I have recently revived my “filtered unserialize()” RFC and I plan to put it to vote today. Before I do that, I’d like to outline the arguments on why I think it is a good thing and put it in a somewhat larger context. It is known that using unserialize() on outside data can lead to trouble unless you are very careful. Which in projects large enough usually means “always”, since practically you rarely can predict all interactions amongst a million lines of code. So, what can we do?

He touches on three points that would make it difficult to just not use it this way (on external data) including the fact that there's not really any other way to work with serialized data in PHP. He suggests that by adding filtering to the unserialize handling of the language it can protect from issues around working with serialized external data.

Is this a security measure? [...] Yes, it does not provide perfect security, and yes, you should not rely only on that for security. Security, much like ogres and onions, has layers. So this is trying to provide one more layer – in case that is what you need.
tagged: unserialize rfc filter practical security reasons

Link: https://php100.wordpress.com/2014/11/03/unserialize-and-being-practical/

Anthony Ferrara:
What's In A Type
Oct 24, 2014 @ 13:55:39

In a new post to his site Anthony Ferrara takes on the topic of typing in PHP, discussing some of the main ideas around the current typing scheme and the discussions being have about potential changes.

There has been a lot of talk about typing in PHP lately. There are a couple of popular proposals for how to clean up PHP's APIs to be simpler. Most of them involve changing PHP's type system at a very fundamental level. So I thought it would be a good idea to talk about that. What goes into a type?

He starts at the highest level, covering what "typing" is in general and some of the tradeoffs that come with being a strongly typed versus weakly typed language. He then gets into PHP's two "semi-independent type systems" - one for objects and one for everything else. He includes some code examples to illustrate and how, for the non-object handling, context means everything for how the types are switched. He also talks about polymorphism, the chaos that could come from scalars becoming objects and a current RFC suggesting the addition of "safe casting" functions to PHP to provide less "magic" when shifting values from one type to another.

tagged: type switching casting rfc proposal function weak strong

Link: http://blog.ircmaxell.com/2014/10/whats-in-type.html

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