3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old = [ 'name' => 'Dae', 'dob' => '1970-01-01', 'blah' => 'blah', ]; function convertRow($row) { $new = [ 'table1' => [ 'name' => $old['name'], 'dob' => $old['dob'], ], 'table2' => [ 'blah' => $old['blah'], ], ]; } $data = convertRow($old); // Now do your inserts $firstTableData = $data['table1']; $secondTableData = $data['table2']; var_dump($firstTableData, $secondTableData);
Output for git.master, git.master_jit
Warning: Undefined variable $old in /in/FC15k on line 13 Warning: Trying to access array offset on value of type null in /in/FC15k on line 13 Warning: Undefined variable $old in /in/FC15k on line 14 Warning: Trying to access array offset on value of type null in /in/FC15k on line 14 Warning: Undefined variable $old in /in/FC15k on line 17 Warning: Trying to access array offset on value of type null in /in/FC15k on line 17 Warning: Trying to access array offset on value of type null in /in/FC15k on line 25 Warning: Trying to access array offset on value of type null in /in/FC15k on line 26 NULL NULL
Output for rfc.property-hooks
Warning: Undefined variable $old in /in/FC15k on line 13 Warning: Trying to access array offset on null in /in/FC15k on line 13 Warning: Undefined variable $old in /in/FC15k on line 14 Warning: Trying to access array offset on null in /in/FC15k on line 14 Warning: Undefined variable $old in /in/FC15k on line 17 Warning: Trying to access array offset on null in /in/FC15k on line 17 Warning: Trying to access array offset on null in /in/FC15k on line 25 Warning: Trying to access array offset on null in /in/FC15k on line 26 NULL NULL

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:
59.75 ms | 402 KiB | 8 Q