1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 05:21:02 +02:00
Files
archived-php-src/ext/standard/tests/array/natcasesort_variation6.phpt
2020-06-24 13:13:44 +02:00

52 lines
807 B
PHP

--TEST--
Test natcasesort() function : usage variations - referenced variables
--FILE--
<?php
/*
* Pass an array of referenced variables to test how natcasesort() re-orders it
*/
echo "*** Testing natcasesort() : usage variation ***\n";
$value1 = 100;
$value2 = 33;
$value3 = 555;
echo "\n-- Initial test --\n";
$array = array( &$value1 , &$value2, &$value3);
var_dump( natcasesort($array) );
var_dump($array);
echo "\n-- Change \$value1 --\n";
$value1 = -29;
var_dump( natcasesort($array) );
var_dump($array);
echo "Done";
?>
--EXPECT--
*** Testing natcasesort() : usage variation ***
-- Initial test --
bool(true)
array(3) {
[1]=>
&int(33)
[0]=>
&int(100)
[2]=>
&int(555)
}
-- Change $value1 --
bool(true)
array(3) {
[0]=>
&int(-29)
[1]=>
&int(33)
[2]=>
&int(555)
}
Done