avatar

HERO

rheality

What is your favorite PHP 7 Feature?

(Dec 30 2015 at 05:47pm)

Last november saw the release PHP 7 and it came with lots of syntax sugars and new features. What was your favorite? Here is the introduction of "Null coalescing operator" which removed the need for non-stop issets e.g instead of:

<?php
$id = (isset($_GET['id'])) ? $_GET['id'] : false;
?>

You can write:

<?php
$id = $_GET['id'] ?? false;
?>

Tell us your favorite and don't forget to share xD.

[1K views]


You may also Like:

Quick reply


add files