3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array ( 0 => array ( 'birth_place' => 'Administrasi Jakarta Barat', 'id' => '716', 'name' => 'Elvina Nuraini', 'birth_date' => '1975-08-28', 'gender' => 'female', ), 1 => array ( 'birth_place' => 'Administrasi Jakarta Barat', 'id' => '764', 'name' => 'Rina Kezia Novitasari', 'birth_date' => '1988-06-07', 'gender' => 'female', ), 2 => array ( 'birth_place' => 'Administrasi Jakarta Barat', 'id' => '922', 'name' => 'Viktor Firmansyah M.Pd', 'birth_date' => '1989-05-13', 'gender' => 'male', ), 3 => array ( 'birth_place' => 'Administrasi Jakarta Pusat', 'id' => '993', 'name' => 'Mursinin Banawa Marbun M.Pd', 'birth_date' => '1991-12-27', 'gender' => 'male', ), 4 => array ( 'birth_place' => 'Administrasi Jakarta Pusat', 'id' => '866', 'name' => 'Ibrahim Gunawan', 'birth_date' => '1995-01-01', 'gender' => 'male', ), ); var_export( array_values( array_reduce( $result, function($data, $row) { $group = $row['birth_place']; $data[$group] ??= [ 'birth_place' => $row['birth_place'], 'jumlah_data_user' => 0 ]; ++$data[$group]['jumlah_data_user']; unset($row['birth_place']); $data[$group]['users'][] = $row; return $data; } ) ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'birth_place' => 'Administrasi Jakarta Barat', 'jumlah_data_user' => 3, 'users' => array ( 0 => array ( 'id' => '716', 'name' => 'Elvina Nuraini', 'birth_date' => '1975-08-28', 'gender' => 'female', ), 1 => array ( 'id' => '764', 'name' => 'Rina Kezia Novitasari', 'birth_date' => '1988-06-07', 'gender' => 'female', ), 2 => array ( 'id' => '922', 'name' => 'Viktor Firmansyah M.Pd', 'birth_date' => '1989-05-13', 'gender' => 'male', ), ), ), 1 => array ( 'birth_place' => 'Administrasi Jakarta Pusat', 'jumlah_data_user' => 2, 'users' => array ( 0 => array ( 'id' => '993', 'name' => 'Mursinin Banawa Marbun M.Pd', 'birth_date' => '1991-12-27', 'gender' => 'male', ), 1 => array ( 'id' => '866', 'name' => 'Ibrahim Gunawan', 'birth_date' => '1995-01-01', 'gender' => 'male', ), ), ), )

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:
115.9 ms | 409 KiB | 5 Q