Created
April 11, 2023 08:10
-
-
Save palexandrite/f3f8b27c12ccadf40d5bbb80f5722ee9 to your computer and use it in GitHub Desktop.
Some PHP notes about new features in PHP 7.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The new feature of the list function | |
*/ | |
class Foo { | |
public $name; | |
public $email; | |
public function __construct($arr) | |
{ | |
list("name" => $this->name, "email" => $this->email) = $arr; | |
} | |
} | |
$b = new Foo(['name' => 'wonder', 'email' => 'awesome']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment