I have source data array like this:
$data = [
  'A' => 'test',
  'B' => [1, 2],
  'C' => [3, 4],
];
There can be different number of keys. In the example we have 3. The value of every key can be array or string.
Now I need to generate from this array the new one (using keys from source array) like this:
$newData = [
    0 => [
        'A' => 'test',
        'B' => 1,
        'C' => 3,
    ],
    1 => [
        'A' => 'test',
        'B' => 1,
        'C' => 4,
    ],
    2 => [
        'A' => 'test',
        'B' => 2,
        'C' => 3,
    ],
    3 => [
        'A' => 'test',
        'B' => 2,
        'C' => 4,
    ],
];
Start implementing the solution but maybe someone have something similar.