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-- Check Collection operations --SKIPIF-- <?php if (!extension_loaded("collection"))..
Decoded Output download
--TEST--
Check Collection operations
--SKIPIF--
<?php if (!extension_loaded("collection")) print "skip"; ?>
--FILE--
<?php
$collection = \Vtiful\Kernel\Collection::init([
['name' => 'Sally'],
['school' => 'Arkansas'],
['age' => 28]
]);
$flattened = $collection->flatMap(function ($values) {
return array_map('strtoupper', $values);
});
var_dump($flattened);
?>
--EXPECT--
object(Vtiful\Kernel\Collection)#3 (3) {
[0]=>
array(1) {
["name"]=>
string(5) "SALLY"
}
[1]=>
array(1) {
["school"]=>
string(8) "ARKANSAS"
}
[2]=>
array(1) {
["age"]=>
string(2) "28"
}
}
Did this file decode correctly?
Original Code
--TEST--
Check Collection operations
--SKIPIF--
<?php if (!extension_loaded("collection")) print "skip"; ?>
--FILE--
<?php
$collection = \Vtiful\Kernel\Collection::init([
['name' => 'Sally'],
['school' => 'Arkansas'],
['age' => 28]
]);
$flattened = $collection->flatMap(function ($values) {
return array_map('strtoupper', $values);
});
var_dump($flattened);
?>
--EXPECT--
object(Vtiful\Kernel\Collection)#3 (3) {
[0]=>
array(1) {
["name"]=>
string(5) "SALLY"
}
[1]=>
array(1) {
["school"]=>
string(8) "ARKANSAS"
}
[2]=>
array(1) {
["age"]=>
string(2) "28"
}
}
Function Calls
None |
Stats
MD5 | 6cf9c39c2a700344f7ff7ede20e85898 |
Eval Count | 0 |
Decode Time | 64 ms |