3v4l.org

run code in 500+ PHP versions simultaneously
<?php $students = [ [ "country" => "japan", "school" => "kyoto university", "name" => "Naruto Uzumaki" ], [ "country" => "usa", "school" => "harvard university", "name" => "Naruto Uzumaki" ], [ "country" => "japan", "school" => "tokyo university", "name" => "sasuke Uchiha" ], [ "country" => "japan", "school" => "tokyo university", "name" => "kakashi hatake" ], ]; $result = []; foreach ($students as $student) { extract($student); $result[$country][$school] = $student; } var_export($result);
Output for rfc.property-hooks, git.master, git.master_jit
array ( 'japan' => array ( 'kyoto university' => array ( 'country' => 'japan', 'school' => 'kyoto university', 'name' => 'Naruto Uzumaki', ), 'tokyo university' => array ( 'country' => 'japan', 'school' => 'tokyo university', 'name' => 'kakashi hatake', ), ), 'usa' => array ( 'harvard university' => array ( 'country' => 'usa', 'school' => 'harvard university', 'name' => 'Naruto Uzumaki', ), ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
32.89 ms | 1355 KiB | 4 Q