<?php
$foo = [1, 2, 3];
$bar = ['one', 'two', 'three'];
$baz = ['first','second','third'];
$arrays = ['$foo', '$bar', '$baz'];
$str = implode(', ', $arrays);
eval("\$map = array_map(null, $str);");
print_r($map);
- Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.27, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- Array
(
[0] => Array
(
[0] => 1
[1] => one
[2] => first
)
[1] => Array
(
[0] => 2
[1] => two
[2] => second
)
[2] => Array
(
[0] => 3
[1] => three
[2] => third
)
)
preferences:
175.09 ms | 404 KiB | 264 Q