Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- NDArray::flatten --FILE-- <?php use \NDArray as nd; $a = nd::array([[1, 2, 3, 4]..
Decoded Output download
--TEST--
NDArray::flatten
--FILE--
<?php
use \NDArray as nd;
$a = nd::array([[1, 2, 3, 4]]);
$b = nd::array([[5, 6], [7, 8]]);
$c = nd::array([[[5, 6], [7, 8]], [[5, 6], [7, 8]]]);
$d = nd::array([1, 2, 3, 4]);
print_r(nd::flatten($a)->toArray());
print_r(nd::flatten($b)->toArray());
print_r(nd::flatten($c)->toArray());
print_r(nd::flatten($d)->toArray());
print_r(nd::flatten([[5, 6], [7, 8]])->toArray());
?>
--EXPECT--
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)
Array
(
[0] => 5
[1] => 6
[2] => 7
[3] => 8
)
Array
(
[0] => 5
[1] => 6
[2] => 7
[3] => 8
[4] => 5
[5] => 6
[6] => 7
[7] => 8
)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)
Array
(
[0] => 5
[1] => 6
[2] => 7
[3] => 8
)
Did this file decode correctly?
Original Code
--TEST--
NDArray::flatten
--FILE--
<?php
use \NDArray as nd;
$a = nd::array([[1, 2, 3, 4]]);
$b = nd::array([[5, 6], [7, 8]]);
$c = nd::array([[[5, 6], [7, 8]], [[5, 6], [7, 8]]]);
$d = nd::array([1, 2, 3, 4]);
print_r(nd::flatten($a)->toArray());
print_r(nd::flatten($b)->toArray());
print_r(nd::flatten($c)->toArray());
print_r(nd::flatten($d)->toArray());
print_r(nd::flatten([[5, 6], [7, 8]])->toArray());
?>
--EXPECT--
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)
Array
(
[0] => 5
[1] => 6
[2] => 7
[3] => 8
)
Array
(
[0] => 5
[1] => 6
[2] => 7
[3] => 8
[4] => 5
[5] => 6
[6] => 7
[7] => 8
)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)
Array
(
[0] => 5
[1] => 6
[2] => 7
[3] => 8
)
Function Calls
None |
Stats
MD5 | 6694dc2aabf50cf501600e14d407e21a |
Eval Count | 0 |
Decode Time | 72 ms |