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-- Test natsort and natcasesort --INI-- precision=14 --FILE-- <?php $data = array( ..

Decoded Output download

--TEST--
Test natsort and natcasesort
--INI--
precision=14
--FILE--
<?php
$data = array(
    'Test1',
    'teST2'=>0,
    5=>'test2',
    'abc'=>'test10',
    'test21'
);

var_dump($data);

natsort($data);
var_dump($data);

natcasesort($data);
var_dump($data);
?>
--EXPECT--
array(5) {
  [0]=>
  string(5) "Test1"
  ["teST2"]=>
  int(0)
  [5]=>
  string(5) "test2"
  ["abc"]=>
  string(6) "test10"
  [6]=>
  string(6) "test21"
}
array(5) {
  ["teST2"]=>
  int(0)
  [0]=>
  string(5) "Test1"
  [5]=>
  string(5) "test2"
  ["abc"]=>
  string(6) "test10"
  [6]=>
  string(6) "test21"
}
array(5) {
  ["teST2"]=>
  int(0)
  [0]=>
  string(5) "Test1"
  [5]=>
  string(5) "test2"
  ["abc"]=>
  string(6) "test10"
  [6]=>
  string(6) "test21"
}

Did this file decode correctly?

Original Code

--TEST--
Test natsort and natcasesort
--INI--
precision=14
--FILE--
<?php
$data = array(
    'Test1',
    'teST2'=>0,
    5=>'test2',
    'abc'=>'test10',
    'test21'
);

var_dump($data);

natsort($data);
var_dump($data);

natcasesort($data);
var_dump($data);
?>
--EXPECT--
array(5) {
  [0]=>
  string(5) "Test1"
  ["teST2"]=>
  int(0)
  [5]=>
  string(5) "test2"
  ["abc"]=>
  string(6) "test10"
  [6]=>
  string(6) "test21"
}
array(5) {
  ["teST2"]=>
  int(0)
  [0]=>
  string(5) "Test1"
  [5]=>
  string(5) "test2"
  ["abc"]=>
  string(6) "test10"
  [6]=>
  string(6) "test21"
}
array(5) {
  ["teST2"]=>
  int(0)
  [0]=>
  string(5) "Test1"
  [5]=>
  string(5) "test2"
  ["abc"]=>
  string(6) "test10"
  [6]=>
  string(6) "test21"
}

Function Calls

var_dump 1

Variables

$data [{'key': 0, 'value': 'Test1'}, {'key': 'teST2', 'value': 0}, {'key': 5, 'value': 'test2'}, {'key': 'abc', 'value': 'test10'}, {'key': 4, 'value': 'test21'}]

Stats

MD5 65c44ba3bc2f951be9242381d549ffc9
Eval Count 0
Decode Time 102 ms