background preloader

PHP7

Facebook Twitter

Getting Ready for PHP 7. A talk by @erikaheidi Wait...

Getting Ready for PHP 7

What Happened to PHP 6? Bad decisions about Unicode People got burned out 7 was chosen to avoid confusion Why Update Bux Fixes New Features Bla Bla Boring... Just a WP Benchmark More here Did I get your attention now? Now let's talk about BC breaks, or... What cold possibly go wrong? BC Breaks: Summary Ancient tags not recognized anymore ASP-style tags ( <%, <%= etc) Script-style tags ( <script language="php"> ) Extension removed: ereg ereg_* functions Deprecated since PHP 5.3 Use the PCRE extension instead (preg_*) Extension removed: mysql mysql_* functions Deprecated since PHP 5.5 Use the mysqli extension instead (mysqli_*) Other stuff removed split() (use explode()) Uniform Variable Syntax $person->$property['name'] $person->{$property['name']} {$person->$property}['name']

What to Expect When You're Expecting: PHP 7, Part 1. This is part one in our Expecting PHP 7 miniseries.

What to Expect When You're Expecting: PHP 7, Part 1

Read part two. As many of you are probably aware, the RFC I mentioned in my PHP 5.0.0 timeline passed with PHP 7 being the agreed upon name for the next major version of PHP. Regardless of your feelings on this topic, PHP 7 is a thing, and it’s coming this year! With the RFC for the PHP 7.0 Timeline passing almost unanimously (32 to 2), we have now entered into feature freeze, and we’ll see the first release candidate (RC) appearing in mid June. But what does this mean for you? The answer to that is: it depends.

A number of language edge cases have been cleaned up. Let’s get into the details. Inconsistency Fixes Unfortunately, the needle/haystack issues have not been fixed. The largest (and most invisible) is the addition of an Abstract Syntax Tree (AST) — an intermediate representation of the code during compilation. The second, which is the introduction of Uniform Variable Syntax, may cause you more issues. $obj->$properties['name'] The PHP 7 Revolution: Return Types and Removed Artifacts. With the planned date for PHP 7’s release rapidly approaching, the internals group is hard at work trying to fix our beloved language as much as possible by both removing artifacts and adding some long desired features.

The PHP 7 Revolution: Return Types and Removed Artifacts

There are many RFCs we could study and discuss, but in this post, I’d like to focus on three that grabbed my attention. PHP 5.7 vs PHP 7 As I mentioned in the last newsletter, 5.7 has been downvoted in favor of moving directly to PHP 7. This means there will be no new version between 5.6 and 7 – even if the new version was only to serve as a warning light to those still stuck on outdated code. Originally, 5.7 was not supposed to have new features, but was supposed to throw out notices and warnings of deprecation about code that’s about to change in v7. It would also warn about some keywords that are to be reserved in PHP 7, so that people can bring their code up to speed with a sort of “automatic” compatibility checker in the form of an entire PHP version.

What to Expect When You're Expecting: PHP 7, Part 1. PHP 7 Infographic - 5 things you need to know #php #zend. Guillaume Dievart - Développeur php. Vous avez certainement entendu parler de la nouvelle version majeure de PHP, non pas la 6 la 7 !!

Guillaume Dievart - Développeur php

Celle qui est censée vous éviter de regarder du côté de Hack ou tout autre conccurent. Je vais tenter de vous présenter à travers cet article les nouveautés qui m’ont parues les plus intéressantes. Paramètres typés La grande nouveauté, et certainement la plus attendue de PHP7 est le typage des paramètres scalaire.

Avant PHP7, vous utilisiez surement le typage des paramètres pour les objets et tableaux. <? La première instruction, permet d’activer le mode strict, qui aura comme impact de lever une fatale erreur si la variable injectée n’est pas du type attendu: <? A savoir 1) La directive declare(strict_types = 1) n’est prise en compte que dans le fichier courant. 2) Les alias integer et boolean ne sont pas disponibles. 3) Le type float accepte un int en mode strict. 4) Si le mode strict n’est pas actif, les valeurs seront converties:

PHP 7: Immediately Invoked Function Expressions. PHP7 will continue to borrow some of the beloved JavaScript features and will support Immediately Invoked Function Expressions (IIFEs): <?

PHP 7: Immediately Invoked Function Expressions

Php echo (function() { return 42; })(); Output for php7@20140901 - 20141101: 42 Currying (functions returning functions) is also possible in combination with the IIFE implementation: <? Output for php7@20140901 - 20141101: 52 Note that when accessing an outer variable from within a function (aka “inheriting variables from outer scope”), one – unlike in JavaScript – needs to use the use keyword to make that variable accessible: <?

/me is excited!