3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function __construct($data) { array_map(function($field) use ($data) { $this->$field = $data[$field]; }, array_keys($data)); print_r(get_object_vars($this)); } } $a = new A(['hej' => 'san', 'hopp' => 'san']);
based on W895j
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
Array ( [hej] => san [hopp] => san )