3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'data' => [ [ 'attribute_set' => 'default', 'description' => 'productdescription', 'is_in_stock' => 1, 'meta_description' => 'Product meta description', 'meta_keyword' => 'Product meta keyword', 'meta_title' => 'Product meta title', 'name' => 'myproduct6', 'price' => 100, 'qty' => 1000, 're_skus' => 'sdfefwef', 'short_description' => 'this is a short descriptio', 'sku' => 'myproduct_surabhi7', 'status' => 1, 'store' => 'admin', 'tax_class_id' => 4, 'type' => 'simple', 'url_key' => 'my-product', 'url_path' => 'my-product.html', 'visibility' => 4, 'weight' => 10, ], [ 'attribute_set' => 'default', 'description' => 'productdescription', 'is_in_stock' => 1, 'meta_description' => 'Product meta description', 'meta_keyword' => 'Product meta keyword', 'meta_title' => 'Product meta title', 'name' => 'myproduct6', 'price' => 100, 'qty' => 1000, 're_skus' => 'sdfefwef', 'short_description' => 'this is a short descriptio', 'sku' => 'myproduct_surabhi7', 'status' => 1, 'store' => 'admin', 'tax_class_id' => 4, 'type' => 'simple', 'url_key' => 'my-product', 'url_path' => 'my-product.html', 'visibility' => 4, 'weight' => 10, ] ] ] ]; $result = []; foreach ($array[0]['data'] as $i => $data) { $result[$i][$i] = $data; } var_export($result);
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
array ( 0 => array ( 0 => array ( 'attribute_set' => 'default', 'description' => 'productdescription', 'is_in_stock' => 1, 'meta_description' => 'Product meta description', 'meta_keyword' => 'Product meta keyword', 'meta_title' => 'Product meta title', 'name' => 'myproduct6', 'price' => 100, 'qty' => 1000, 're_skus' => 'sdfefwef', 'short_description' => 'this is a short descriptio', 'sku' => 'myproduct_surabhi7', 'status' => 1, 'store' => 'admin', 'tax_class_id' => 4, 'type' => 'simple', 'url_key' => 'my-product', 'url_path' => 'my-product.html', 'visibility' => 4, 'weight' => 10, ), ), 1 => array ( 1 => array ( 'attribute_set' => 'default', 'description' => 'productdescription', 'is_in_stock' => 1, 'meta_description' => 'Product meta description', 'meta_keyword' => 'Product meta keyword', 'meta_title' => 'Product meta title', 'name' => 'myproduct6', 'price' => 100, 'qty' => 1000, 're_skus' => 'sdfefwef', 'short_description' => 'this is a short descriptio', 'sku' => 'myproduct_surabhi7', 'status' => 1, 'store' => 'admin', 'tax_class_id' => 4, 'type' => 'simple', 'url_key' => 'my-product', 'url_path' => 'my-product.html', 'visibility' => 4, 'weight' => 10, ), ), )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
80.38 ms | 408 KiB | 5 Q