mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell report[1] in tests, code comments and documentation. [1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
This commit is contained in:
parent
eff56f83af
commit
dabc28d182
168 changed files with 781 additions and 781 deletions
10
EXTENSIONS
10
EXTENSIONS
|
@ -60,7 +60,7 @@ SINCE: 5.3
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
EXTENSION: phpdbg
|
EXTENSION: phpdbg
|
||||||
PRIMARY MAINTAINER: Joe Watkins <krakjoe@php.net>, Bob Weinand <bwoebi@php.net>
|
PRIMARY MAINTAINER: Joe Watkins <krakjoe@php.net>, Bob Weinand <bwoebi@php.net>
|
||||||
MAINTENANCE: Unkown
|
MAINTENANCE: Unknown
|
||||||
STATUS: 5.6
|
STATUS: 5.6
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ STATUS: Working
|
||||||
SINCE: 4.0.2
|
SINCE: 4.0.2
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
EXTENSION: readline
|
EXTENSION: readline
|
||||||
PRIMARY MAINTAINER: Unkown
|
PRIMARY MAINTAINER: Unknown
|
||||||
MAINTENANCE: Unknown
|
MAINTENANCE: Unknown
|
||||||
STATUS: Working
|
STATUS: Working
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
@ -480,17 +480,17 @@ STATUS: Working
|
||||||
SINCE: 5.0.0
|
SINCE: 5.0.0
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
EXTENSION: sysvmsg
|
EXTENSION: sysvmsg
|
||||||
PRIMARY MAINTAINER: Unkown
|
PRIMARY MAINTAINER: Unknown
|
||||||
MAINTENANCE: Unknown
|
MAINTENANCE: Unknown
|
||||||
STATUS: Working
|
STATUS: Working
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
EXTENSION: sysvsem
|
EXTENSION: sysvsem
|
||||||
PRIMARY MAINTAINER: Unkown
|
PRIMARY MAINTAINER: Unknown
|
||||||
MAINTENANCE: Unknown
|
MAINTENANCE: Unknown
|
||||||
STATUS: Working
|
STATUS: Working
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
EXTENSION: sysvshm
|
EXTENSION: sysvshm
|
||||||
PRIMARY MAINTAINER: Unkown
|
PRIMARY MAINTAINER: Unknown
|
||||||
MAINTENANCE: Unknown
|
MAINTENANCE: Unknown
|
||||||
STATUS: Working
|
STATUS: Working
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -13,7 +13,7 @@ function foo($ex = NULL) {
|
||||||
if ($ex) throw $ex;
|
if ($ex) throw $ex;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
var_dump("catched");
|
var_dump("caught");
|
||||||
if ($ex) return "return1";
|
if ($ex) return "return1";
|
||||||
} finally {
|
} finally {
|
||||||
var_dump("finally2");
|
var_dump("finally2");
|
||||||
|
@ -34,6 +34,6 @@ string(8) "finally2"
|
||||||
string(5) "label"
|
string(5) "label"
|
||||||
string(7) "return2"
|
string(7) "return2"
|
||||||
string(8) "finally1"
|
string(8) "finally1"
|
||||||
string(7) "catched"
|
string(6) "caught"
|
||||||
string(8) "finally2"
|
string(8) "finally2"
|
||||||
string(7) "return1"
|
string(7) "return1"
|
||||||
|
|
|
@ -20,7 +20,7 @@ function foo($ret = FALSE) {
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
goto local;
|
goto local;
|
||||||
local:
|
local:
|
||||||
var_dump("catched");
|
var_dump("caught");
|
||||||
if ($ret) return "return";
|
if ($ret) return "return";
|
||||||
} finally {
|
} finally {
|
||||||
var_dump("finally2");
|
var_dump("finally2");
|
||||||
|
@ -36,11 +36,11 @@ var_dump(foo(true));
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
string(8) "finally1"
|
string(8) "finally1"
|
||||||
string(7) "catched"
|
string(6) "caught"
|
||||||
string(8) "finally2"
|
string(8) "finally2"
|
||||||
string(5) "label"
|
string(5) "label"
|
||||||
NULL
|
NULL
|
||||||
string(8) "finally1"
|
string(8) "finally1"
|
||||||
string(7) "catched"
|
string(6) "caught"
|
||||||
string(8) "finally2"
|
string(8) "finally2"
|
||||||
string(6) "return"
|
string(6) "return"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Testing clone on objects whoose class derived from DateTimeZone class
|
Testing clone on objects whose class derived from DateTimeZone class
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
//Set the default time zone
|
//Set the default time zone
|
||||||
|
@ -15,7 +15,7 @@ class DateTimeZoneExt2 extends DateTimeZoneExt1 {
|
||||||
public $property4 = 10.5;
|
public $property4 = 10.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "*** Testing clone on objects whoose class derived from DateTimeZone class ***\n";
|
echo "*** Testing clone on objects whose class derived from DateTimeZone class ***\n";
|
||||||
|
|
||||||
$d1 = new DateTimeZoneExt1("Europe/London");
|
$d1 = new DateTimeZoneExt1("Europe/London");
|
||||||
var_dump($d1);
|
var_dump($d1);
|
||||||
|
@ -29,7 +29,7 @@ var_dump($d2_clone);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
*** Testing clone on objects whoose class derived from DateTimeZone class ***
|
*** Testing clone on objects whose class derived from DateTimeZone class ***
|
||||||
object(DateTimeZoneExt1)#%d (4) {
|
object(DateTimeZoneExt1)#%d (4) {
|
||||||
["property1"]=>
|
["property1"]=>
|
||||||
int(99)
|
int(99)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test clone of objects whoose class derived from DateTime class
|
Test clone of objects whose class derived from DateTime class
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
//Set the default time zone
|
//Set the default time zone
|
||||||
|
@ -16,7 +16,7 @@ class DateTimeExt2 extends DateTimeExt1 {
|
||||||
public $property4 = 10.5;
|
public $property4 = 10.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "*** Testing clone on objects whoose class derived from DateTime class ***\n";
|
echo "*** Testing clone on objects whose class derived from DateTime class ***\n";
|
||||||
|
|
||||||
$d1 = new DateTimeExt1("2009-02-03 12:34:41 GMT");
|
$d1 = new DateTimeExt1("2009-02-03 12:34:41 GMT");
|
||||||
var_dump($d1);
|
var_dump($d1);
|
||||||
|
@ -29,7 +29,7 @@ $d2_clone = clone $d2;
|
||||||
var_dump($d2_clone);
|
var_dump($d2_clone);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
*** Testing clone on objects whoose class derived from DateTime class ***
|
*** Testing clone on objects whose class derived from DateTime class ***
|
||||||
object(DateTimeExt1)#%d (5) {
|
object(DateTimeExt1)#%d (5) {
|
||||||
["property1"]=>
|
["property1"]=>
|
||||||
int(99)
|
int(99)
|
||||||
|
|
|
@ -54,7 +54,7 @@ static zend_bool needs_pi(const zend_op_array *op_array, zend_dfg *dfg, zend_ssa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that both sucessors of the from block aren't the same. Pi nodes are associated
|
/* Make sure that both successors of the from block aren't the same. Pi nodes are associated
|
||||||
* with predecessor blocks, so we can't distinguish which edge the pi belongs to. */
|
* with predecessor blocks, so we can't distinguish which edge the pi belongs to. */
|
||||||
from_block = &ssa->cfg.blocks[from];
|
from_block = &ssa->cfg.blocks[from];
|
||||||
ZEND_ASSERT(from_block->successors_count == 2);
|
ZEND_ASSERT(from_block->successors_count == 2);
|
||||||
|
|
|
@ -8852,7 +8852,7 @@ static uint32_t zend_get_known_property_offset(zend_class_entry *ce, zend_string
|
||||||
|
|
||||||
if (ce->ce_flags & ZEND_ACC_INHERITED) {
|
if (ce->ce_flags & ZEND_ACC_INHERITED) {
|
||||||
if (!ce->parent) {
|
if (!ce->parent) {
|
||||||
/* propery offests may be changed by inheritance */
|
/* property offests may be changed by inheritance */
|
||||||
return ZEND_WRONG_PROPERTY_OFFSET;
|
return ZEND_WRONG_PROPERTY_OFFSET;
|
||||||
} else {
|
} else {
|
||||||
zend_class_entry *parent = ce->parent;
|
zend_class_entry *parent = ce->parent;
|
||||||
|
|
|
@ -16,7 +16,7 @@ MySQLPDOTest::skip();
|
||||||
class myclass implements Serializable {
|
class myclass implements Serializable {
|
||||||
|
|
||||||
private static $instance = null;
|
private static $instance = null;
|
||||||
protected $myprotected = 'a protected propery';
|
protected $myprotected = 'a protected property';
|
||||||
|
|
||||||
// Good old magic stuff
|
// Good old magic stuff
|
||||||
private function __construct($caller = NULL) {
|
private function __construct($caller = NULL) {
|
||||||
|
@ -129,14 +129,14 @@ Unserializing the previously serialized object...
|
||||||
myclass::unserialize('Data from serialize')
|
myclass::unserialize('Data from serialize')
|
||||||
object(myclass)#4 (1) {
|
object(myclass)#4 (1) {
|
||||||
["myprotected":protected]=>
|
["myprotected":protected]=>
|
||||||
string(19) "a protected propery"
|
string(20) "a protected property"
|
||||||
}
|
}
|
||||||
|
|
||||||
Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
|
Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
|
||||||
myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
|
myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
|
||||||
object(myclass)#%d (1) {
|
object(myclass)#%d (1) {
|
||||||
["myprotected":protected]=>
|
["myprotected":protected]=>
|
||||||
string(19) "a protected propery"
|
string(20) "a protected property"
|
||||||
}
|
}
|
||||||
|
|
||||||
Using PDO::FETCH_CLASS to fetch the object from DB and unserialize it...
|
Using PDO::FETCH_CLASS to fetch the object from DB and unserialize it...
|
||||||
|
@ -144,7 +144,7 @@ myclass::__set(myobj, 'C:7:"myclass":19:{Data from serialize}')
|
||||||
myclass::__construct(PDO shall call __construct())
|
myclass::__construct(PDO shall call __construct())
|
||||||
object(myclass)#%d (2) {
|
object(myclass)#%d (2) {
|
||||||
["myprotected":protected]=>
|
["myprotected":protected]=>
|
||||||
string(19) "a protected propery"
|
string(20) "a protected property"
|
||||||
["myobj"]=>
|
["myobj"]=>
|
||||||
string(38) "C:7:"myclass":19:{Data from serialize}"
|
string(38) "C:7:"myclass":19:{Data from serialize}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ require 'ext/pdo/tests/pdo_test.inc';
|
||||||
$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
|
$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
|
||||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
|
||||||
|
|
||||||
$rs = $db->query('select blah from a_table_that_doesnt_exist');
|
$rs = $db->query('select blah from a_table_that_does_not_exist');
|
||||||
var_dump($rs);
|
var_dump($rs);
|
||||||
var_dump($db->errorInfo());
|
var_dump($db->errorInfo());
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
|
|
@ -70,7 +70,7 @@ $r = pg_query($db, "SELECT * FROM tmp_statistics");
|
||||||
while (false != ($row = pg_fetch_row($r))) {
|
while (false != ($row = pg_fetch_row($r))) {
|
||||||
var_dump($row);
|
var_dump($row);
|
||||||
}
|
}
|
||||||
echo $errors, " errors catched\n";
|
echo $errors, " errors caught\n";
|
||||||
|
|
||||||
pg_query($db, "DROP TABLE tmp_statistics");
|
pg_query($db, "DROP TABLE tmp_statistics");
|
||||||
pg_close($db);
|
pg_close($db);
|
||||||
|
@ -191,4 +191,4 @@ array(2) {
|
||||||
[1]=>
|
[1]=>
|
||||||
string(19) "2001:4f8:3:ba::/112"
|
string(19) "2001:4f8:3:ba::/112"
|
||||||
}
|
}
|
||||||
7 errors catched
|
7 errors caught
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
ReflectionMethod::__toString() tests (overriden method)
|
ReflectionMethod::__toString() tests (overridden method)
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
class Foo {
|
class Foo {
|
||||||
|
|
|
@ -20,7 +20,7 @@ foreach($classes as $class) {
|
||||||
echo "Reflecting on class $class: \n";
|
echo "Reflecting on class $class: \n";
|
||||||
$rc = new ReflectionClass($class);
|
$rc = new ReflectionClass($class);
|
||||||
var_dump($rc->getConstant('a'));
|
var_dump($rc->getConstant('a'));
|
||||||
var_dump($rc->getConstant('doesntexist'));
|
var_dump($rc->getConstant('doesnotexist'));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
|
|
@ -37,9 +37,9 @@ foreach($classes as $class) {
|
||||||
var_dump($rc->getMethod("s"));
|
var_dump($rc->getMethod("s"));
|
||||||
echo " --> Check for F(): ";
|
echo " --> Check for F(): ";
|
||||||
var_dump($rc->getMethod("F"));
|
var_dump($rc->getMethod("F"));
|
||||||
echo " --> Check for doesntExist(): ";
|
echo " --> Check for doesNotExist(): ";
|
||||||
try {
|
try {
|
||||||
var_dump($rc->getMethod("doesntExist"));
|
var_dump($rc->getMethod("doesNotExist"));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo $e->getMessage() . "\n";
|
echo $e->getMessage() . "\n";
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ Reflecting on class pubf:
|
||||||
["class"]=>
|
["class"]=>
|
||||||
string(4) "pubf"
|
string(4) "pubf"
|
||||||
}
|
}
|
||||||
--> Check for doesntExist(): Method doesntExist does not exist
|
--> Check for doesNotExist(): Method doesNotExist does not exist
|
||||||
Reflecting on class subpubf:
|
Reflecting on class subpubf:
|
||||||
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -85,7 +85,7 @@ Reflecting on class subpubf:
|
||||||
["class"]=>
|
["class"]=>
|
||||||
string(4) "pubf"
|
string(4) "pubf"
|
||||||
}
|
}
|
||||||
--> Check for doesntExist(): Method doesntExist does not exist
|
--> Check for doesNotExist(): Method doesNotExist does not exist
|
||||||
Reflecting on class protf:
|
Reflecting on class protf:
|
||||||
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -105,7 +105,7 @@ Reflecting on class protf:
|
||||||
["class"]=>
|
["class"]=>
|
||||||
string(5) "protf"
|
string(5) "protf"
|
||||||
}
|
}
|
||||||
--> Check for doesntExist(): Method doesntExist does not exist
|
--> Check for doesNotExist(): Method doesNotExist does not exist
|
||||||
Reflecting on class subprotf:
|
Reflecting on class subprotf:
|
||||||
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -125,7 +125,7 @@ Reflecting on class subprotf:
|
||||||
["class"]=>
|
["class"]=>
|
||||||
string(5) "protf"
|
string(5) "protf"
|
||||||
}
|
}
|
||||||
--> Check for doesntExist(): Method doesntExist does not exist
|
--> Check for doesNotExist(): Method doesNotExist does not exist
|
||||||
Reflecting on class privf:
|
Reflecting on class privf:
|
||||||
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -145,7 +145,7 @@ Reflecting on class privf:
|
||||||
["class"]=>
|
["class"]=>
|
||||||
string(5) "privf"
|
string(5) "privf"
|
||||||
}
|
}
|
||||||
--> Check for doesntExist(): Method doesntExist does not exist
|
--> Check for doesNotExist(): Method doesNotExist does not exist
|
||||||
Reflecting on class subprivf:
|
Reflecting on class subprivf:
|
||||||
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
--> Check for f(): object(ReflectionMethod)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -165,4 +165,4 @@ Reflecting on class subprivf:
|
||||||
["class"]=>
|
["class"]=>
|
||||||
string(5) "privf"
|
string(5) "privf"
|
||||||
}
|
}
|
||||||
--> Check for doesntExist(): Method doesntExist does not exist
|
--> Check for doesNotExist(): Method doesNotExist does not exist
|
||||||
|
|
|
@ -50,8 +50,8 @@ foreach($classes as $class) {
|
||||||
echo $e->getMessage() . "\n";
|
echo $e->getMessage() . "\n";
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
echo " --> Check for doesntExist: ";
|
echo " --> Check for doesNotExist: ";
|
||||||
var_dump($rc->getProperty("doesntExist"));
|
var_dump($rc->getProperty("doesNotExist"));
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
echo $e->getMessage() . "\n";
|
echo $e->getMessage() . "\n";
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ Reflecting on class pubf:
|
||||||
string(4) "pubf"
|
string(4) "pubf"
|
||||||
}
|
}
|
||||||
--> Check for A: Property A does not exist
|
--> Check for A: Property A does not exist
|
||||||
--> Check for doesntExist: Property doesntExist does not exist
|
--> Check for doesNotExist: Property doesNotExist does not exist
|
||||||
Reflecting on class subpubf:
|
Reflecting on class subpubf:
|
||||||
--> Check for s: object(ReflectionProperty)#%d (2) {
|
--> Check for s: object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -88,7 +88,7 @@ Reflecting on class subpubf:
|
||||||
string(4) "pubf"
|
string(4) "pubf"
|
||||||
}
|
}
|
||||||
--> Check for A: Property A does not exist
|
--> Check for A: Property A does not exist
|
||||||
--> Check for doesntExist: Property doesntExist does not exist
|
--> Check for doesNotExist: Property doesNotExist does not exist
|
||||||
Reflecting on class protf:
|
Reflecting on class protf:
|
||||||
--> Check for s: object(ReflectionProperty)#%d (2) {
|
--> Check for s: object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -103,7 +103,7 @@ Reflecting on class protf:
|
||||||
string(5) "protf"
|
string(5) "protf"
|
||||||
}
|
}
|
||||||
--> Check for A: Property A does not exist
|
--> Check for A: Property A does not exist
|
||||||
--> Check for doesntExist: Property doesntExist does not exist
|
--> Check for doesNotExist: Property doesNotExist does not exist
|
||||||
Reflecting on class subprotf:
|
Reflecting on class subprotf:
|
||||||
--> Check for s: object(ReflectionProperty)#%d (2) {
|
--> Check for s: object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -118,7 +118,7 @@ Reflecting on class subprotf:
|
||||||
string(5) "protf"
|
string(5) "protf"
|
||||||
}
|
}
|
||||||
--> Check for A: Property A does not exist
|
--> Check for A: Property A does not exist
|
||||||
--> Check for doesntExist: Property doesntExist does not exist
|
--> Check for doesNotExist: Property doesNotExist does not exist
|
||||||
Reflecting on class privf:
|
Reflecting on class privf:
|
||||||
--> Check for s: object(ReflectionProperty)#%d (2) {
|
--> Check for s: object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -133,7 +133,7 @@ Reflecting on class privf:
|
||||||
string(5) "privf"
|
string(5) "privf"
|
||||||
}
|
}
|
||||||
--> Check for A: Property A does not exist
|
--> Check for A: Property A does not exist
|
||||||
--> Check for doesntExist: Property doesntExist does not exist
|
--> Check for doesNotExist: Property doesNotExist does not exist
|
||||||
Reflecting on class subprivf:
|
Reflecting on class subprivf:
|
||||||
--> Check for s: object(ReflectionProperty)#%d (2) {
|
--> Check for s: object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -143,4 +143,4 @@ Reflecting on class subprivf:
|
||||||
}
|
}
|
||||||
--> Check for a: Property a does not exist
|
--> Check for a: Property a does not exist
|
||||||
--> Check for A: Property A does not exist
|
--> Check for A: Property A does not exist
|
||||||
--> Check for doesntExist: Property doesntExist does not exist
|
--> Check for doesNotExist: Property doesNotExist does not exist
|
||||||
|
|
|
@ -70,7 +70,7 @@ showInfo("privB");
|
||||||
showInfo("pubC");
|
showInfo("pubC");
|
||||||
showInfo("protC");
|
showInfo("protC");
|
||||||
showInfo("privC");
|
showInfo("privC");
|
||||||
showInfo("doesntExist");
|
showInfo("doesNotExist");
|
||||||
|
|
||||||
showInfo("A::pubC");
|
showInfo("A::pubC");
|
||||||
showInfo("A::protC");
|
showInfo("A::protC");
|
||||||
|
@ -89,9 +89,9 @@ showInfo("C::privC");
|
||||||
showInfo("X::pubC");
|
showInfo("X::pubC");
|
||||||
showInfo("X::protC");
|
showInfo("X::protC");
|
||||||
showInfo("X::privC");
|
showInfo("X::privC");
|
||||||
showInfo("X::doesntExist");
|
showInfo("X::doesNotExist");
|
||||||
|
|
||||||
showInfo("doesntexist::doesntExist");
|
showInfo("doesNotexist::doesNotExist");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
@ -155,8 +155,8 @@ object(ReflectionProperty)#%d (2) {
|
||||||
string(1) "C"
|
string(1) "C"
|
||||||
}
|
}
|
||||||
Cannot access non-public member C::$privC
|
Cannot access non-public member C::$privC
|
||||||
--- (Reflecting on doesntExist) ---
|
--- (Reflecting on doesNotExist) ---
|
||||||
Property doesntExist does not exist
|
Property doesNotExist does not exist
|
||||||
--- (Reflecting on A::pubC) ---
|
--- (Reflecting on A::pubC) ---
|
||||||
object(ReflectionProperty)#%d (2) {
|
object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -245,7 +245,7 @@ Fully qualified property name X::pubC does not specify a base class of C
|
||||||
Fully qualified property name X::protC does not specify a base class of C
|
Fully qualified property name X::protC does not specify a base class of C
|
||||||
--- (Reflecting on X::privC) ---
|
--- (Reflecting on X::privC) ---
|
||||||
Fully qualified property name X::privC does not specify a base class of C
|
Fully qualified property name X::privC does not specify a base class of C
|
||||||
--- (Reflecting on X::doesntExist) ---
|
--- (Reflecting on X::doesNotExist) ---
|
||||||
Fully qualified property name X::doesntExist does not specify a base class of C
|
Fully qualified property name X::doesNotExist does not specify a base class of C
|
||||||
--- (Reflecting on doesntexist::doesntExist) ---
|
--- (Reflecting on doesNotexist::doesNotExist) ---
|
||||||
Class doesntexist does not exist
|
Class doesnotexist does not exist
|
||||||
|
|
|
@ -70,7 +70,7 @@ showInfo("privB");
|
||||||
showInfo("pubC");
|
showInfo("pubC");
|
||||||
showInfo("protC");
|
showInfo("protC");
|
||||||
showInfo("privC");
|
showInfo("privC");
|
||||||
showInfo("doesntExist");
|
showInfo("doesNotExist");
|
||||||
|
|
||||||
showInfo("A::pubC");
|
showInfo("A::pubC");
|
||||||
showInfo("A::protC");
|
showInfo("A::protC");
|
||||||
|
@ -89,9 +89,9 @@ showInfo("C::privC");
|
||||||
showInfo("X::pubC");
|
showInfo("X::pubC");
|
||||||
showInfo("X::protC");
|
showInfo("X::protC");
|
||||||
showInfo("X::privC");
|
showInfo("X::privC");
|
||||||
showInfo("X::doesntExist");
|
showInfo("X::doesNotExist");
|
||||||
|
|
||||||
showInfo("doesntexist::doesntExist");
|
showInfo("doesNotexist::doesNotExist");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
@ -155,8 +155,8 @@ object(ReflectionProperty)#%d (2) {
|
||||||
string(1) "C"
|
string(1) "C"
|
||||||
}
|
}
|
||||||
Cannot access non-public member C::$privC
|
Cannot access non-public member C::$privC
|
||||||
--- (Reflecting on doesntExist) ---
|
--- (Reflecting on doesNotExist) ---
|
||||||
Property doesntExist does not exist
|
Property doesNotExist does not exist
|
||||||
--- (Reflecting on A::pubC) ---
|
--- (Reflecting on A::pubC) ---
|
||||||
object(ReflectionProperty)#%d (2) {
|
object(ReflectionProperty)#%d (2) {
|
||||||
["name"]=>
|
["name"]=>
|
||||||
|
@ -245,7 +245,7 @@ Fully qualified property name X::pubC does not specify a base class of C
|
||||||
Fully qualified property name X::protC does not specify a base class of C
|
Fully qualified property name X::protC does not specify a base class of C
|
||||||
--- (Reflecting on X::privC) ---
|
--- (Reflecting on X::privC) ---
|
||||||
Fully qualified property name X::privC does not specify a base class of C
|
Fully qualified property name X::privC does not specify a base class of C
|
||||||
--- (Reflecting on X::doesntExist) ---
|
--- (Reflecting on X::doesNotExist) ---
|
||||||
Fully qualified property name X::doesntExist does not specify a base class of C
|
Fully qualified property name X::doesNotExist does not specify a base class of C
|
||||||
--- (Reflecting on doesntexist::doesntExist) ---
|
--- (Reflecting on doesNotexist::doesNotExist) ---
|
||||||
Class doesntexist does not exist
|
Class doesnotexist does not exist
|
||||||
|
|
|
@ -19,14 +19,14 @@ var_dump($rc->hasConstant("myConst"));
|
||||||
echo "Check existing constant, different case: ";
|
echo "Check existing constant, different case: ";
|
||||||
var_dump($rc->hasConstant("MyCoNsT"));
|
var_dump($rc->hasConstant("MyCoNsT"));
|
||||||
echo "Check absent constant: ";
|
echo "Check absent constant: ";
|
||||||
var_dump($rc->hasConstant("doesntExist"));
|
var_dump($rc->hasConstant("doesNotExist"));
|
||||||
|
|
||||||
|
|
||||||
$rd = new ReflectionClass("D");
|
$rd = new ReflectionClass("D");
|
||||||
echo "Check inherited constant: ";
|
echo "Check inherited constant: ";
|
||||||
var_dump($rd->hasConstant("myConst"));
|
var_dump($rd->hasConstant("myConst"));
|
||||||
echo "Check absent constant: ";
|
echo "Check absent constant: ";
|
||||||
var_dump($rd->hasConstant("doesntExist"));
|
var_dump($rd->hasConstant("doesNotExist"));
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
Check existing constant: bool(true)
|
Check existing constant: bool(true)
|
||||||
|
|
|
@ -37,8 +37,8 @@ foreach($classes as $class) {
|
||||||
var_dump($rc->hasMethod("s"));
|
var_dump($rc->hasMethod("s"));
|
||||||
echo " --> Check for F(): ";
|
echo " --> Check for F(): ";
|
||||||
var_dump($rc->hasMethod("F"));
|
var_dump($rc->hasMethod("F"));
|
||||||
echo " --> Check for doesntExist(): ";
|
echo " --> Check for doesNotExist(): ";
|
||||||
var_dump($rc->hasMethod("doesntExist"));
|
var_dump($rc->hasMethod("doesNotExist"));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
@ -46,30 +46,30 @@ Reflecting on class pubf:
|
||||||
--> Check for f(): bool(true)
|
--> Check for f(): bool(true)
|
||||||
--> Check for s(): bool(true)
|
--> Check for s(): bool(true)
|
||||||
--> Check for F(): bool(true)
|
--> Check for F(): bool(true)
|
||||||
--> Check for doesntExist(): bool(false)
|
--> Check for doesNotExist(): bool(false)
|
||||||
Reflecting on class subpubf:
|
Reflecting on class subpubf:
|
||||||
--> Check for f(): bool(true)
|
--> Check for f(): bool(true)
|
||||||
--> Check for s(): bool(true)
|
--> Check for s(): bool(true)
|
||||||
--> Check for F(): bool(true)
|
--> Check for F(): bool(true)
|
||||||
--> Check for doesntExist(): bool(false)
|
--> Check for doesNotExist(): bool(false)
|
||||||
Reflecting on class protf:
|
Reflecting on class protf:
|
||||||
--> Check for f(): bool(true)
|
--> Check for f(): bool(true)
|
||||||
--> Check for s(): bool(true)
|
--> Check for s(): bool(true)
|
||||||
--> Check for F(): bool(true)
|
--> Check for F(): bool(true)
|
||||||
--> Check for doesntExist(): bool(false)
|
--> Check for doesNotExist(): bool(false)
|
||||||
Reflecting on class subprotf:
|
Reflecting on class subprotf:
|
||||||
--> Check for f(): bool(true)
|
--> Check for f(): bool(true)
|
||||||
--> Check for s(): bool(true)
|
--> Check for s(): bool(true)
|
||||||
--> Check for F(): bool(true)
|
--> Check for F(): bool(true)
|
||||||
--> Check for doesntExist(): bool(false)
|
--> Check for doesNotExist(): bool(false)
|
||||||
Reflecting on class privf:
|
Reflecting on class privf:
|
||||||
--> Check for f(): bool(true)
|
--> Check for f(): bool(true)
|
||||||
--> Check for s(): bool(true)
|
--> Check for s(): bool(true)
|
||||||
--> Check for F(): bool(true)
|
--> Check for F(): bool(true)
|
||||||
--> Check for doesntExist(): bool(false)
|
--> Check for doesNotExist(): bool(false)
|
||||||
Reflecting on class subprivf:
|
Reflecting on class subprivf:
|
||||||
--> Check for f(): bool(true)
|
--> Check for f(): bool(true)
|
||||||
--> Check for s(): bool(true)
|
--> Check for s(): bool(true)
|
||||||
--> Check for F(): bool(true)
|
--> Check for F(): bool(true)
|
||||||
--> Check for doesntExist(): bool(false)
|
--> Check for doesNotExist(): bool(false)
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ foreach($classes as $class) {
|
||||||
var_dump($rc->hasProperty("a"));
|
var_dump($rc->hasProperty("a"));
|
||||||
echo " --> Check for A: ";
|
echo " --> Check for A: ";
|
||||||
var_dump($rc->hasProperty("A"));
|
var_dump($rc->hasProperty("A"));
|
||||||
echo " --> Check for doesntExist: ";
|
echo " --> Check for doesNotExist: ";
|
||||||
var_dump($rc->hasProperty("doesntExist"));
|
var_dump($rc->hasProperty("doesNotExist"));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
@ -46,29 +46,29 @@ Reflecting on class pubf:
|
||||||
--> Check for s: bool(true)
|
--> Check for s: bool(true)
|
||||||
--> Check for a: bool(true)
|
--> Check for a: bool(true)
|
||||||
--> Check for A: bool(false)
|
--> Check for A: bool(false)
|
||||||
--> Check for doesntExist: bool(false)
|
--> Check for doesNotExist: bool(false)
|
||||||
Reflecting on class subpubf:
|
Reflecting on class subpubf:
|
||||||
--> Check for s: bool(true)
|
--> Check for s: bool(true)
|
||||||
--> Check for a: bool(true)
|
--> Check for a: bool(true)
|
||||||
--> Check for A: bool(false)
|
--> Check for A: bool(false)
|
||||||
--> Check for doesntExist: bool(false)
|
--> Check for doesNotExist: bool(false)
|
||||||
Reflecting on class protf:
|
Reflecting on class protf:
|
||||||
--> Check for s: bool(true)
|
--> Check for s: bool(true)
|
||||||
--> Check for a: bool(true)
|
--> Check for a: bool(true)
|
||||||
--> Check for A: bool(false)
|
--> Check for A: bool(false)
|
||||||
--> Check for doesntExist: bool(false)
|
--> Check for doesNotExist: bool(false)
|
||||||
Reflecting on class subprotf:
|
Reflecting on class subprotf:
|
||||||
--> Check for s: bool(true)
|
--> Check for s: bool(true)
|
||||||
--> Check for a: bool(true)
|
--> Check for a: bool(true)
|
||||||
--> Check for A: bool(false)
|
--> Check for A: bool(false)
|
||||||
--> Check for doesntExist: bool(false)
|
--> Check for doesNotExist: bool(false)
|
||||||
Reflecting on class privf:
|
Reflecting on class privf:
|
||||||
--> Check for s: bool(true)
|
--> Check for s: bool(true)
|
||||||
--> Check for a: bool(true)
|
--> Check for a: bool(true)
|
||||||
--> Check for A: bool(false)
|
--> Check for A: bool(false)
|
||||||
--> Check for doesntExist: bool(false)
|
--> Check for doesNotExist: bool(false)
|
||||||
Reflecting on class subprivf:
|
Reflecting on class subprivf:
|
||||||
--> Check for s: bool(true)
|
--> Check for s: bool(true)
|
||||||
--> Check for a: bool(false)
|
--> Check for a: bool(false)
|
||||||
--> Check for A: bool(false)
|
--> Check for A: bool(false)
|
||||||
--> Check for doesntExist: bool(false)
|
--> Check for doesNotExist: bool(false)
|
||||||
|
|
|
@ -20,7 +20,7 @@ foreach($classes as $class) {
|
||||||
echo "Reflecting on instance of class $class: \n";
|
echo "Reflecting on instance of class $class: \n";
|
||||||
$rc = new ReflectionObject(new $class);
|
$rc = new ReflectionObject(new $class);
|
||||||
var_dump($rc->getConstant('a'));
|
var_dump($rc->getConstant('a'));
|
||||||
var_dump($rc->getConstant('doesntexist'));
|
var_dump($rc->getConstant('doesNotexist'));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Bug #53366 (Reflection doesnt get dynamic property value from getProperty())
|
Bug #53366 (Reflection doesn't get dynamic property value from getProperty())
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SimpleXML: overriden count() method
|
SimpleXML: overridden count() method
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: SimpleXMLIterator and overriden count()
|
SPL: SimpleXMLIterator and overridden count()
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded('simplexml')) print 'skip';
|
if (!extension_loaded('simplexml')) print 'skip';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Request #50698_1 (SoapClient should handle wsdls with some incompatiable endpoints)
|
Request #50698_1 (SoapClient should handle wsdls with some incompatible endpoints)
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require_once('skipif.inc'); ?>
|
<?php require_once('skipif.inc'); ?>
|
||||||
--INI--
|
--INI--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatible and incompatiable endpoints.)
|
Request #50698_2 (SoapClient should handle wsdls with some incompatible endpoints -- EDGECASE: Large mix of compatible and incompatible endpoints.)
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require_once('skipif.inc'); ?>
|
<?php require_once('skipif.inc'); ?>
|
||||||
--INI--
|
--INI--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Request #50698_3 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large set of endpoints all incompatiable.)
|
Request #50698_3 (SoapClient should handle wsdls with some incompatible endpoints -- EDGECASE: Large set of endpoints all incompatible.)
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require_once('skipif.inc'); ?>
|
<?php require_once('skipif.inc'); ?>
|
||||||
--INI--
|
--INI--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Request #50698_4 (SoapClient should handle wsdls with some incompatiable endpoints)
|
Request #50698_4 (SoapClient should handle wsdls with some incompatible endpoints)
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require_once('skipif.inc'); ?>
|
<?php require_once('skipif.inc'); ?>
|
||||||
--INI--
|
--INI--
|
||||||
|
|
|
@ -7,7 +7,7 @@ Bug #70469 (SoapClient should not generate E_ERROR if exceptions enabled)
|
||||||
try {
|
try {
|
||||||
$x = new SoapClient('http://i_dont_exist.com/some.wsdl');
|
$x = new SoapClient('http://i_dont_exist.com/some.wsdl');
|
||||||
} catch (SoapFault $e) {
|
} catch (SoapFault $e) {
|
||||||
echo "catched\n";
|
echo "caught\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$error = error_get_last();
|
$error = error_get_last();
|
||||||
|
@ -16,5 +16,5 @@ if ($error === null) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
catched
|
caught
|
||||||
ok
|
ok
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: ArrayObject with overriden count()
|
SPL: ArrayObject with overridden count()
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$obj = new ArrayObject(array(1,2));
|
$obj = new ArrayObject(array(1,2));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: SplDoublyLinkedList with overriden count()
|
SPL: SplDoublyLinkedList with overridden count()
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$obj = new SplDoublyLinkedList();
|
$obj = new SplDoublyLinkedList();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: FixedArray: overriden count()
|
SPL: FixedArray: overridden count()
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$obj = new SplFixedArray(2);
|
$obj = new SplFixedArray(2);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: FixedArray: overriden iterator methods
|
SPL: FixedArray: overridden iterator methods
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
class SplFixedArray2 extends SplFixedArray {
|
class SplFixedArray2 extends SplFixedArray {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: SplHeap with overriden count()
|
SPL: SplHeap with overridden count()
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$obj = new SplMaxHeap();
|
$obj = new SplMaxHeap();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: SplHeap with overriden compare()
|
SPL: SplHeap with overridden compare()
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
class SplMinHeap2 extends SplMinHeap {
|
class SplMinHeap2 extends SplMinHeap {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
SPL: RecursiveIteratorIterator - Ensure that non-overriden methods execute problem free.
|
SPL: RecursiveIteratorIterator - Ensure that non-overridden methods execute problem free.
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test array_chunk() function : basic functionality - defualt 'preserve_keys'
|
Test array_chunk() function : basic functionality - default 'preserve_keys'
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
|
/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
|
||||||
|
|
|
@ -23,7 +23,7 @@ $input_array = array (
|
||||||
"array3" => array(1)
|
"array3" => array(1)
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing array_chunk() by supplying an array containing different sub arrays & 'preserve_key' as defualt --\n";
|
echo "\n-- Testing array_chunk() by supplying an array containing different sub arrays & 'preserve_key' as default --\n";
|
||||||
var_dump( array_chunk($input_array, $size) );
|
var_dump( array_chunk($input_array, $size) );
|
||||||
|
|
||||||
echo "\n-- Testing array_chunk() by supplying an array containing different sub arrays & 'preserve_key' = true --\n";
|
echo "\n-- Testing array_chunk() by supplying an array containing different sub arrays & 'preserve_key' = true --\n";
|
||||||
|
@ -37,7 +37,7 @@ echo "Done";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing array_chunk() : usage variations ***
|
*** Testing array_chunk() : usage variations ***
|
||||||
|
|
||||||
-- Testing array_chunk() by supplying an array containing different sub arrays & 'preserve_key' as defualt --
|
-- Testing array_chunk() by supplying an array containing different sub arrays & 'preserve_key' as default --
|
||||||
array(2) {
|
array(2) {
|
||||||
[0]=>
|
[0]=>
|
||||||
array(2) {
|
array(2) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ $inputs = array (
|
||||||
'1' => 1,
|
'1' => 1,
|
||||||
'0' => 0),
|
'0' => 0),
|
||||||
|
|
||||||
//defualt keys => float values
|
//default keys => float values
|
||||||
/*7*/ array(2.00000000000001, 1.00, 0.01E-9),
|
/*7*/ array(2.00000000000001, 1.00, 0.01E-9),
|
||||||
|
|
||||||
//numeric keys => float values
|
//numeric keys => float values
|
||||||
|
|
|
@ -90,7 +90,7 @@ $arrays = array(
|
||||||
/*24*/ $fp
|
/*24*/ $fp
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $unexpected_value) {
|
foreach($arrays as $unexpected_value) {
|
||||||
echo "\n-- Iteration $iterator --";
|
echo "\n-- Iteration $iterator --";
|
||||||
|
|
|
@ -90,7 +90,7 @@ $arrays = array(
|
||||||
/*24*/ $fp
|
/*24*/ $fp
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $unexpected_value) {
|
foreach($arrays as $unexpected_value) {
|
||||||
echo "\n-- Iteration $iterator --";
|
echo "\n-- Iteration $iterator --";
|
||||||
|
|
|
@ -71,7 +71,7 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ $arr2 = array (
|
||||||
'', null => "null", '' => 'emptys', "emptyd" => "",
|
'', null => "null", '' => 'emptys', "emptyd" => "",
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr1) {
|
foreach($arrays as $arr1) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -80,11 +80,11 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr2) {
|
foreach($arrays as $arr2) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -63,7 +63,7 @@ $arr2 = array(0 => 0, 2 => "float", 4 => "f3", 33333333 => "f4",
|
||||||
"\tHello" => 111, 2.2, 'color', "Hello world" => "string",
|
"\tHello" => 111, 2.2, 'color', "Hello world" => "string",
|
||||||
"pen\n" => 33, 133 => "int");
|
"pen\n" => 33, 133 => "int");
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr1) {
|
foreach($arrays as $arr1) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -63,7 +63,7 @@ $arr1 = array(0 => 0, 2 => "float", 4 => "f3", 33333333 => "f4",
|
||||||
"\tHello" => 111, 2.2, 'color', "Hello world" => "string",
|
"\tHello" => 111, 2.2, 'color', "Hello world" => "string",
|
||||||
"pen\n" => 33, 133 => "int");
|
"pen\n" => 33, 133 => "int");
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr2) {
|
foreach($arrays as $arr2) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -71,7 +71,7 @@ $arr2 = array(0 => "0", 1, "two" => 2, "float" => 2.3333, "f1" => 1.2,
|
||||||
"heredoc" => "Hello world", 11 => new classA(), "resource" => $fp,
|
"heredoc" => "Hello world", 11 => new classA(), "resource" => $fp,
|
||||||
"int" => 133, 222 => "fruit");
|
"int" => 133, 222 => "fruit");
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr1) {
|
foreach($arrays as $arr1) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -71,7 +71,7 @@ $arr1 = array(0 => "0", 1, "two" => 2, "float" => 2.3333, "f1" => 1.2,
|
||||||
"heredoc" => "Hello world", 11 => new classA(), "resource" => $fp,
|
"heredoc" => "Hello world", 11 => new classA(), "resource" => $fp,
|
||||||
"int" => 133, 222 => "fruit");
|
"int" => 133, 222 => "fruit");
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect_assoc()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect_assoc()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr2) {
|
foreach($arrays as $arr2) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -89,7 +89,7 @@ $arrays = array(
|
||||||
/*24*/ $fp
|
/*24*/ $fp
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $unexpected_value) {
|
foreach($arrays as $unexpected_value) {
|
||||||
echo "\n-- Iterator $iterator --";
|
echo "\n-- Iterator $iterator --";
|
||||||
|
|
|
@ -89,7 +89,7 @@ $arrays = array(
|
||||||
/*24*/ $fp
|
/*24*/ $fp
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $unexpected_value) {
|
foreach($arrays as $unexpected_value) {
|
||||||
echo "\n-- Iterator $iterator --";
|
echo "\n-- Iterator $iterator --";
|
||||||
|
|
|
@ -70,7 +70,7 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ $arr2 = array (
|
||||||
'', null => "null", '' => 'emptys'
|
'', null => "null", '' => 'emptys'
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr1) {
|
foreach($arrays as $arr1) {
|
||||||
echo "-- Iterator $iterator --\n";
|
echo "-- Iterator $iterator --\n";
|
||||||
|
|
|
@ -79,11 +79,11 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr2) {
|
foreach($arrays as $arr2) {
|
||||||
echo "-- Iteration $iterator --\n";
|
echo "-- Iteration $iterator --\n";
|
||||||
|
|
|
@ -60,7 +60,7 @@ $arrays = array (
|
||||||
// array to be passsed to $arr2 argument
|
// array to be passsed to $arr2 argument
|
||||||
$arr2 = array(1, "float", "f4", "hello", 2.2, 'color', "string", "pen\n", 11);
|
$arr2 = array(1, "float", "f4", "hello", 2.2, 'color', "string", "pen\n", 11);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr1) {
|
foreach($arrays as $arr1) {
|
||||||
echo "-- Iterator $iterator --\n";
|
echo "-- Iterator $iterator --\n";
|
||||||
|
|
|
@ -60,7 +60,7 @@ $arrays = array (
|
||||||
// array to be passsed to $arr1 argument
|
// array to be passsed to $arr1 argument
|
||||||
$arr1 = array(1, "float", "f4", "hello", 2.2, 'color', "string", "pen\n", 11);
|
$arr1 = array(1, "float", "f4", "hello", 2.2, 'color', "string", "pen\n", 11);
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr2) {
|
foreach($arrays as $arr2) {
|
||||||
echo "-- Iterator $iterator --\n";
|
echo "-- Iterator $iterator --\n";
|
||||||
|
|
|
@ -68,7 +68,7 @@ $arrays = array (
|
||||||
$arr2 = array(1, 2, 1.2, 2.3333, "col\tor", '\v\fworld', $fp,
|
$arr2 = array(1, 2, 1.2, 2.3333, "col\tor", '\v\fworld', $fp,
|
||||||
"Hello world", $heredoc, new classA(), 444.432, "fruit");
|
"Hello world", $heredoc, new classA(), 444.432, "fruit");
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr1) {
|
foreach($arrays as $arr1) {
|
||||||
echo "-- Iterator $iterator --\n";
|
echo "-- Iterator $iterator --\n";
|
||||||
|
|
|
@ -68,7 +68,7 @@ $arrays = array (
|
||||||
$arr1 = array(1, 2, 1.2, 2.3333, "col\tor", '\v\fworld', $fp,
|
$arr1 = array(1, 2, 1.2, 2.3333, "col\tor", '\v\fworld', $fp,
|
||||||
"Hello world", $heredoc, new classA(), 444.432, "fruit");
|
"Hello world", $heredoc, new classA(), 444.432, "fruit");
|
||||||
|
|
||||||
// loop through each sub-array within $arrrays to check the behavior of array_intersect()
|
// loop through each sub-array within $arrays to check the behavior of array_intersect()
|
||||||
$iterator = 1;
|
$iterator = 1;
|
||||||
foreach($arrays as $arr2) {
|
foreach($arrays as $arr2) {
|
||||||
echo "-- Iterator $iterator --\n";
|
echo "-- Iterator $iterator --\n";
|
||||||
|
|
|
@ -42,7 +42,7 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*18*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*18*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ $inputs = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*19*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*18*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*18*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ $arrays = array (
|
||||||
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
array(1 => '', 2 => "", 3 => NULL, 4 => null, 5 => false, 6 => true),
|
||||||
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
array('' => 1, "" => 2, NULL => 3, null => 4, false => 5, true => 6),
|
||||||
|
|
||||||
// array with repetative keys
|
// array with repetitive keys
|
||||||
/*18*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
/*18*/ array("One" => 1, "two" => 2, "One" => 10, "two" => 20, "three" => 3)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : object functionality - sort objects
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing arsort() by providing integer/string object arrays with following flag values
|
* testing arsort() by providing integer/string object arrays with following flag values
|
||||||
* 1. Defualt flag value
|
* 1. Default flag value
|
||||||
* 2. SORT_REGULAR - compare items normally
|
* 2. SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -59,14 +59,14 @@ $unsorted_str_obj = array (
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
echo "\n-- Testing arsort() by supplying various object arrays, 'flag' value is defualt --\n";
|
echo "\n-- Testing arsort() by supplying various object arrays, 'flag' value is default --\n";
|
||||||
|
|
||||||
// testing arsort() function by supplying integer object array, flag value is defualt
|
// testing arsort() function by supplying integer object array, flag value is default
|
||||||
$temp_array = $unsorted_int_obj;
|
$temp_array = $unsorted_int_obj;
|
||||||
var_dump(arsort($temp_array) );
|
var_dump(arsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
||||||
// testing arsort() function by supplying string object array, flag value is defualt
|
// testing arsort() function by supplying string object array, flag value is default
|
||||||
$temp_array = $unsorted_str_obj;
|
$temp_array = $unsorted_str_obj;
|
||||||
var_dump(arsort($temp_array) );
|
var_dump(arsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : object functionality - sorting objects with diff. acces
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing arsort() by providing integer/string object arrays with following flag values
|
* testing arsort() by providing integer/string object arrays with following flag values
|
||||||
* 1. Defualt flag value
|
* 1. Default flag value
|
||||||
2. SORT_REGULAR - compare items normally
|
2. SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : usage variations - sort octal values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing arsort() by providing different octal array for $array argument with following flag values
|
* testing arsort() by providing different octal array for $array argument with following flag values
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_oct_array = array (
|
||||||
077 => 077, -066 => -066, -0345 => -0345, 0 => 0
|
077 => 077, -066 => -066, -0345 => -0345, 0 => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing arsort() by supplying octal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing arsort() by supplying octal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_oct_array;
|
$temp_array = $unsorted_oct_array;
|
||||||
var_dump( arsort($temp_array) ); // expecting : bool(true)
|
var_dump( arsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing arsort() : usage variations ***
|
*** Testing arsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing arsort() by supplying octal value array, 'flag' value is defualt --
|
-- Testing arsort() by supplying octal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[669]=>
|
[669]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : usage variations - sort integer/float values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing arsort() by providing different integer/float value arrays for $array argument with following values
|
* Testing arsort() by providing different integer/float value arrays for $array argument with following values
|
||||||
* 1. flag value as defualt
|
* 1. flag value as default
|
||||||
* 2. SORT_REGULAR - compare items normally
|
* 2. SORT_REGULAR - compare items normally
|
||||||
* 3. SORT_NUMERIC - compare items numerically
|
* 3. SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : usage variations - sort reference variables
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing arsort() by providing reference variable array with following flag values
|
* Testing arsort() by providing reference variable array with following flag values
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
* SORT_NUMERIC - compare items numerically
|
* SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,7 @@ $value3 = 555;
|
||||||
// an array containing integer references
|
// an array containing integer references
|
||||||
$unsorted_numerics = array( 1 => &$value1 , 2 => &$value2, 3 => &$value3);
|
$unsorted_numerics = array( 1 => &$value1 , 2 => &$value2, 3 => &$value3);
|
||||||
|
|
||||||
echo "\n-- Testing arsort() by supplying reference variable array, 'flag' value is defualt --\n";
|
echo "\n-- Testing arsort() by supplying reference variable array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_numerics;
|
$temp_array = $unsorted_numerics;
|
||||||
var_dump( arsort($temp_array) ); // expecting : bool(true)
|
var_dump( arsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
@ -44,7 +44,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing arsort() :usage variations ***
|
*** Testing arsort() :usage variations ***
|
||||||
|
|
||||||
-- Testing arsort() by supplying reference variable array, 'flag' value is defualt --
|
-- Testing arsort() by supplying reference variable array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[3]=>
|
[3]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : usage variations - sort strings
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing arsort() by providing different string arrays for $array argument with following flag values
|
* testing arsort() by providing different string arrays for $array argument with following flag values
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
* SORT_STRING - compare items as strings
|
* SORT_STRING - compare items as strings
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : usage variations - sort hexadecimal values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing arsort() by providing different hexa-decimal array for $array argument with following flag values
|
* testing arsort() by providing different hexa-decimal array for $array argument with following flag values
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
* SORT_NUMERIC - compare items numerically
|
* SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_hex_array = array ( 0x1AB => 0x1AB, 0xFFF => 0xFFF, 0xF => 0xF, 0xFF =
|
||||||
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing arsort() by supplying hexadecimal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing arsort() by supplying hexadecimal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_hex_array;
|
$temp_array = $unsorted_hex_array;
|
||||||
var_dump(arsort($temp_array) ); // expecting : bool(true)
|
var_dump(arsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing arsort() : usage variations ***
|
*** Testing arsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing arsort() by supplying hexadecimal value array, 'flag' value is defualt --
|
-- Testing arsort() by supplying hexadecimal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[4095]=>
|
[4095]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test arsort() function : usage variations - sort bool values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing arsort() by providing bool value array for $array argument with following flag values.
|
* testing arsort() by providing bool value array for $array argument with following flag values.
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ echo "*** Testing arsort() : usage variations ***\n";
|
||||||
// bool value array
|
// bool value array
|
||||||
$bool_values = array (1 => true, 2 => false, 3 => TRUE, 4 => FALSE);
|
$bool_values = array (1 => true, 2 => false, 3 => TRUE, 4 => FALSE);
|
||||||
|
|
||||||
echo "\n-- Testing arsort() by supplying bool value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing arsort() by supplying bool value array, 'flag' value is default --\n";
|
||||||
$temp_array = $bool_values;
|
$temp_array = $bool_values;
|
||||||
var_dump(arsort($temp_array) );
|
var_dump(arsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -44,7 +44,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing arsort() : usage variations ***
|
*** Testing arsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing arsort() by supplying bool value array, 'flag' value is defualt --
|
-- Testing arsort() by supplying bool value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[1]=>
|
[1]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : object functionality - sort objects
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing asort() by providing integer/string object arrays with following flag values
|
* testing asort() by providing integer/string object arrays with following flag values
|
||||||
* 1. Defualt flag value
|
* 1. Default flag value
|
||||||
* 2. SORT_REGULAR - compare items normally
|
* 2. SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -59,14 +59,14 @@ $unsorted_str_obj = array (
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
echo "\n-- Testing asort() by supplying various object arrays, 'flag' value is defualt --\n";
|
echo "\n-- Testing asort() by supplying various object arrays, 'flag' value is default --\n";
|
||||||
|
|
||||||
// testing asort() function by supplying integer object array, flag value is defualt
|
// testing asort() function by supplying integer object array, flag value is default
|
||||||
$temp_array = $unsorted_int_obj;
|
$temp_array = $unsorted_int_obj;
|
||||||
var_dump(asort($temp_array) );
|
var_dump(asort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
||||||
// testing asort() function by supplying string object array, flag value is defualt
|
// testing asort() function by supplying string object array, flag value is default
|
||||||
$temp_array = $unsorted_str_obj;
|
$temp_array = $unsorted_str_obj;
|
||||||
var_dump(asort($temp_array) );
|
var_dump(asort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -87,7 +87,7 @@ echo "Done\n";
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
*** Testing asort() : object functionality ***
|
*** Testing asort() : object functionality ***
|
||||||
|
|
||||||
-- Testing asort() by supplying various object arrays, 'flag' value is defualt --
|
-- Testing asort() by supplying various object arrays, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[4]=>
|
[4]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : object functionality - sorting objects with diff. access
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing asort() by providing integer/string object arrays with following flag values
|
* testing asort() by providing integer/string object arrays with following flag values
|
||||||
* 1. Defualt flag value
|
* 1. Default flag value
|
||||||
2. SORT_REGULAR - compare items normally
|
2. SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : usage variations - sort octal values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing asort() by providing different octal array for $array argument with following flag values
|
* testing asort() by providing different octal array for $array argument with following flag values
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_oct_array = array (
|
||||||
077 => 077, -066 => -066, -0345 => -0345, 0 => 0
|
077 => 077, -066 => -066, -0345 => -0345, 0 => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing asort() by supplying octal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing asort() by supplying octal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_oct_array;
|
$temp_array = $unsorted_oct_array;
|
||||||
var_dump( asort($temp_array) ); // expecting : bool(true)
|
var_dump( asort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing asort() : usage variations ***
|
*** Testing asort() : usage variations ***
|
||||||
|
|
||||||
-- Testing asort() by supplying octal value array, 'flag' value is defualt --
|
-- Testing asort() by supplying octal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[-229]=>
|
[-229]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : usage variations - sort integer/float values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing asort() by providing different integer/float value arrays for $array argument with following values
|
* Testing asort() by providing different integer/float value arrays for $array argument with following values
|
||||||
* 1. flag value as defualt
|
* 1. flag value as default
|
||||||
* 2. SORT_REGULAR - compare items normally
|
* 2. SORT_REGULAR - compare items normally
|
||||||
* 3. SORT_NUMERIC - compare items numerically
|
* 3. SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : usage variations - sort reference variables
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing asort() by providing reference variable array with following flag values
|
* Testing asort() by providing reference variable array with following flag values
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
* SORT_NUMERIC - compare items numerically
|
* SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,7 @@ $value3 = 555;
|
||||||
// an array containing integer references
|
// an array containing integer references
|
||||||
$unsorted_numerics = array( 1 => &$value1 , 2 => &$value2, 3 => &$value3);
|
$unsorted_numerics = array( 1 => &$value1 , 2 => &$value2, 3 => &$value3);
|
||||||
|
|
||||||
echo "\n-- Testing asort() by supplying reference variable array, 'flag' value is defualt --\n";
|
echo "\n-- Testing asort() by supplying reference variable array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_numerics;
|
$temp_array = $unsorted_numerics;
|
||||||
var_dump( asort($temp_array) ); // expecting : bool(true)
|
var_dump( asort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
@ -44,7 +44,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing asort() :usage variations ***
|
*** Testing asort() :usage variations ***
|
||||||
|
|
||||||
-- Testing asort() by supplying reference variable array, 'flag' value is defualt --
|
-- Testing asort() by supplying reference variable array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[2]=>
|
[2]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : usage variations - sort strings
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing asort() by providing different string arrays for $array argument with following flag values
|
* testing asort() by providing different string arrays for $array argument with following flag values
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
* SORT_STRING - compare items as strings
|
* SORT_STRING - compare items as strings
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : usage variations - sort hexadecimal values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing asort() by providing different hexa-decimal array for $array argument with following flag values
|
* testing asort() by providing different hexa-decimal array for $array argument with following flag values
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
* SORT_NUMERIC - compare items numerically
|
* SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_hex_array = array ( 0x1AB => 0x1AB, 0xFFF => 0xFFF, 0xF => 0xF, 0xFF =
|
||||||
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing asort() by supplying hexadecimal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing asort() by supplying hexadecimal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_hex_array;
|
$temp_array = $unsorted_hex_array;
|
||||||
var_dump(asort($temp_array) ); // expecting : bool(true)
|
var_dump(asort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing asort() : usage variations ***
|
*** Testing asort() : usage variations ***
|
||||||
|
|
||||||
-- Testing asort() by supplying hexadecimal value array, 'flag' value is defualt --
|
-- Testing asort() by supplying hexadecimal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[-682]=>
|
[-682]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test asort() function : usage variations - sort bool values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing asort() by providing bool value array for $array argument with following flag values.
|
* testing asort() by providing bool value array for $array argument with following flag values.
|
||||||
* flag value as defualt
|
* flag value as default
|
||||||
* SORT_REGULAR - compare items normally
|
* SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ echo "*** Testing asort() : usage variations ***\n";
|
||||||
// bool value array
|
// bool value array
|
||||||
$bool_values = array (1 => true, 2 => false, 3 => TRUE, 4 => FALSE);
|
$bool_values = array (1 => true, 2 => false, 3 => TRUE, 4 => FALSE);
|
||||||
|
|
||||||
echo "\n-- Testing asort() by supplying bool value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing asort() by supplying bool value array, 'flag' value is default --\n";
|
||||||
$temp_array = $bool_values;
|
$temp_array = $bool_values;
|
||||||
var_dump(asort($temp_array) );
|
var_dump(asort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -44,7 +44,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing asort() : usage variations ***
|
*** Testing asort() : usage variations ***
|
||||||
|
|
||||||
-- Testing asort() by supplying bool value array, 'flag' value is defualt --
|
-- Testing asort() by supplying bool value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[2]=>
|
[2]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : basic functionality
|
||||||
/*
|
/*
|
||||||
* Testing krsort() by providing array of integer/string values to check the basic functionality
|
* Testing krsort() by providing array of integer/string values to check the basic functionality
|
||||||
* with following flag values :
|
* with following flag values :
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
* 4.SORT_STRING - compare items as strings
|
* 4.SORT_STRING - compare items as strings
|
||||||
|
@ -28,12 +28,12 @@ $unsorted_strings = array(
|
||||||
// an array containing unsorted numeric values with indices
|
// an array containing unsorted numeric values with indices
|
||||||
$unsorted_numerics = array( 100 => 4, 33 => 3, 555 => 2, 22 => 1 );
|
$unsorted_numerics = array( 100 => 4, 33 => 3, 555 => 2, 22 => 1 );
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying string array, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying string array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_strings;
|
$temp_array = $unsorted_strings;
|
||||||
var_dump( krsort($temp_array) ); // expecting : bool(true)
|
var_dump( krsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying numeric array, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying numeric array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_numerics;
|
$temp_array = $unsorted_numerics;
|
||||||
var_dump( krsort($temp_array) ); // expecting : bool(true)
|
var_dump( krsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
@ -78,7 +78,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing krsort() : basic functionality ***
|
*** Testing krsort() : basic functionality ***
|
||||||
|
|
||||||
-- Testing krsort() by supplying string array, 'flag' value is defualt --
|
-- Testing krsort() by supplying string array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(8) {
|
array(8) {
|
||||||
["o20"]=>
|
["o20"]=>
|
||||||
|
@ -99,7 +99,7 @@ array(8) {
|
||||||
string(6) "Orange"
|
string(6) "Orange"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Testing krsort() by supplying numeric array, 'flag' value is defualt --
|
-- Testing krsort() by supplying numeric array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[555]=>
|
[555]=>
|
||||||
|
|
|
@ -8,7 +8,7 @@ Test krsort() function : object functionality - sort objects
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing array of integer/string objects with following flag values:
|
* testing krsort() by providing array of integer/string objects with following flag values:
|
||||||
* 1.Defualt flag value
|
* 1.Default flag value
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -56,14 +56,14 @@ $unsorted_str_obj = array (
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying various object arrays, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying various object arrays, 'flag' value is default --\n";
|
||||||
|
|
||||||
// testing krsort() function by supplying integer object array, flag value is defualt
|
// testing krsort() function by supplying integer object array, flag value is default
|
||||||
$temp_array = $unsorted_int_obj;
|
$temp_array = $unsorted_int_obj;
|
||||||
var_dump(krsort($temp_array) );
|
var_dump(krsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
||||||
// testing krsort() function by supplying string object array, flag value is defualt
|
// testing krsort() function by supplying string object array, flag value is default
|
||||||
$temp_array = $unsorted_str_obj;
|
$temp_array = $unsorted_str_obj;
|
||||||
var_dump(krsort($temp_array) );
|
var_dump(krsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -84,7 +84,7 @@ echo "Done\n";
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
*** Testing krsort() : object functionality ***
|
*** Testing krsort() : object functionality ***
|
||||||
|
|
||||||
-- Testing krsort() by supplying various object arrays, 'flag' value is defualt --
|
-- Testing krsort() by supplying various object arrays, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[50]=>
|
[50]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort heredoc strings
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing array of heredoc strings for $array argument with
|
* testing krsort() by providing array of heredoc strings for $array argument with
|
||||||
* following flag values:
|
* following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_STRING - compare items as strings
|
* 3.SORT_STRING - compare items as strings
|
||||||
*/
|
*/
|
||||||
|
@ -37,7 +37,7 @@ $array = array (
|
||||||
$multiline_heredoc => "heredoc string\twith!@# and 123\nTest this!!!"
|
$multiline_heredoc => "heredoc string\twith!@# and 123\nTest this!!!"
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying heredoc string array, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying heredoc string array, 'flag' value is default --\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(krsort($temp_array) ); // expecting : bool(true)
|
var_dump(krsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -57,7 +57,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing krsort() : usage variations ***
|
*** Testing krsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing krsort() by supplying heredoc string array, 'flag' value is defualt --
|
-- Testing krsort() by supplying heredoc string array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
["heredoc string with!@# and 123
|
["heredoc string with!@# and 123
|
||||||
|
|
|
@ -9,7 +9,7 @@ Test krsort() function : usage variations - sort bool values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing array of boolean values for $array argument with following flag values:
|
* testing krsort() by providing array of boolean values for $array argument with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ echo "*** Testing krsort() : usage variations ***\n";
|
||||||
// bool value array
|
// bool value array
|
||||||
$bool_values = array (true => true, false => false, TRUE => TRUE, FALSE => FALSE);
|
$bool_values = array (true => true, false => false, TRUE => TRUE, FALSE => FALSE);
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying boolean value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying boolean value array, 'flag' value is default --\n";
|
||||||
$temp_array = $bool_values;
|
$temp_array = $bool_values;
|
||||||
var_dump(krsort($temp_array) );
|
var_dump(krsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing krsort() : usage variations ***
|
*** Testing krsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing krsort() by supplying boolean value array, 'flag' value is defualt --
|
-- Testing krsort() by supplying boolean value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(2) {
|
array(2) {
|
||||||
[1]=>
|
[1]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort integer/float values
|
||||||
/*
|
/*
|
||||||
* Testing krsort() by providing array of integer/float/mixed values for $array argument
|
* Testing krsort() by providing array of integer/float/mixed values for $array argument
|
||||||
* with following flag values:
|
* with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,7 @@ echo "\n-- Testing krsort() by supplying various integer/float arrays --\n";
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(krsort($temp_array) );
|
var_dump(krsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -63,7 +63,7 @@ echo "Done\n";
|
||||||
-- Testing krsort() by supplying various integer/float arrays --
|
-- Testing krsort() by supplying various integer/float arrays --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[8]=>
|
[8]=>
|
||||||
|
@ -131,7 +131,7 @@ array(9) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[6]=>
|
[6]=>
|
||||||
|
@ -181,7 +181,7 @@ array(6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
[11]=>
|
[11]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort octal values
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing array of octal values for $array argument
|
* testing krsort() by providing array of octal values for $array argument
|
||||||
* with following flag values:
|
* with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_oct_array = array (
|
||||||
077 => 06, -066 => -01, -0345 => -02, 0 => 0
|
077 => 06, -066 => -01, -0345 => -02, 0 => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying octal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying octal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_oct_array;
|
$temp_array = $unsorted_oct_array;
|
||||||
var_dump( krsort($temp_array) ); // expecting : bool(true)
|
var_dump( krsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing krsort() : usage variations ***
|
*** Testing krsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing krsort() by supplying octal value array, 'flag' value is defualt --
|
-- Testing krsort() by supplying octal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[669]=>
|
[669]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort strings
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing array of string values for $array argument with
|
* testing krsort() by providing array of string values for $array argument with
|
||||||
* following flag values:
|
* following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_STRING - compare items as strings
|
* 3.SORT_STRING - compare items as strings
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,7 @@ echo "\n-- Testing krsort() by supplying various string arrays --\n";
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(krsort($temp_array) ); // expecting : bool(true)
|
var_dump(krsort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -63,7 +63,7 @@ echo "Done\n";
|
||||||
-- Testing krsort() by supplying various string arrays --
|
-- Testing krsort() by supplying various string arrays --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
["\xhh"]=>
|
["\xhh"]=>
|
||||||
|
@ -149,7 +149,7 @@ array(11) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
["x"]=>
|
["x"]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort hexadecimal values
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing array of hexa-decimal values for $array argument
|
* testing krsort() by providing array of hexa-decimal values for $array argument
|
||||||
* with following flag values:
|
* with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_hex_array = array (
|
||||||
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing krsort() by supplying hexadecimal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing krsort() by supplying hexadecimal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_hex_array;
|
$temp_array = $unsorted_hex_array;
|
||||||
var_dump(krsort( $temp_array) ); // expecting : bool(true)
|
var_dump(krsort( $temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing krsort() : usage variations ***
|
*** Testing krsort() : usage variations ***
|
||||||
|
|
||||||
-- Testing krsort() by supplying hexadecimal value array, 'flag' value is defualt --
|
-- Testing krsort() by supplying hexadecimal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[4095]=>
|
[4095]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort array with diff. sub arrays
|
||||||
/*
|
/*
|
||||||
* testing krsort() by providing arrays contains sub arrays for $array argument
|
* testing krsort() by providing arrays contains sub arrays for $array argument
|
||||||
* with flowing flag values
|
* with flowing flag values
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ echo "\n-- Testing krsort() by supplying various arrays containing sub arrays --
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
|
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump( krsort($temp_array) );
|
var_dump( krsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -60,7 +60,7 @@ echo "Done\n";
|
||||||
-- Testing krsort() by supplying various arrays containing sub arrays --
|
-- Testing krsort() by supplying various arrays containing sub arrays --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(0) {
|
array(0) {
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ array(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(1) {
|
array(1) {
|
||||||
[1]=>
|
[1]=>
|
||||||
|
@ -86,7 +86,7 @@ array(1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[4]=>
|
[4]=>
|
||||||
|
@ -118,7 +118,7 @@ array(3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 4 --
|
-- Iteration 4 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[3]=>
|
[3]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test krsort() function : usage variations - sort array with/without key values
|
||||||
/*
|
/*
|
||||||
* Testing krsort() by providing arrays with/without key values for $array argument
|
* Testing krsort() by providing arrays with/without key values for $array argument
|
||||||
* with following flag values:
|
* with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ echo "\n-- Testing krsort() by supplying various arrays with/without key values
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump( krsort($temp_array) );
|
var_dump( krsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -54,7 +54,7 @@ echo "Done\n";
|
||||||
-- Testing krsort() by supplying various arrays with/without key values --
|
-- Testing krsort() by supplying various arrays with/without key values --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(5) {
|
array(5) {
|
||||||
[9]=>
|
[9]=>
|
||||||
|
@ -84,7 +84,7 @@ array(5) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
["a"]=>
|
["a"]=>
|
||||||
|
@ -106,7 +106,7 @@ array(3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[5]=>
|
[5]=>
|
||||||
|
@ -140,7 +140,7 @@ array(6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 4 --
|
-- Iteration 4 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[5]=>
|
[5]=>
|
||||||
|
@ -162,7 +162,7 @@ array(3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 5 --
|
-- Iteration 5 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[9]=>
|
[9]=>
|
||||||
|
@ -196,7 +196,7 @@ array(6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 6 --
|
-- Iteration 6 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(2) {
|
array(2) {
|
||||||
["foo"]=>
|
["foo"]=>
|
||||||
|
@ -214,7 +214,7 @@ array(2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 7 --
|
-- Iteration 7 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
["d"]=>
|
["d"]=>
|
||||||
|
|
|
@ -9,7 +9,7 @@ Test ksort() function : basic functionality
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing ksort() by providing array of integer/string values to check the basic functionality with following flag values :
|
* Testing ksort() by providing array of integer/string values to check the basic functionality with following flag values :
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
* 4.SORT_STRING - compare items as strings
|
* 4.SORT_STRING - compare items as strings
|
||||||
|
@ -26,12 +26,12 @@ $unsorted_strings = array(
|
||||||
// an array containing unsorted numeric values with indices
|
// an array containing unsorted numeric values with indices
|
||||||
$unsorted_numerics = array( 100 => 4, 33 => 3, 555 => 2, 22 => 1 );
|
$unsorted_numerics = array( 100 => 4, 33 => 3, 555 => 2, 22 => 1 );
|
||||||
|
|
||||||
echo "\n-- Testing ksort() by supplying string array, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying string array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_strings;
|
$temp_array = $unsorted_strings;
|
||||||
var_dump( ksort($temp_array) ); // expecting : bool(true)
|
var_dump( ksort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
|
||||||
echo "\n-- Testing ksort() by supplying numeric array, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying numeric array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_numerics;
|
$temp_array = $unsorted_numerics;
|
||||||
var_dump( ksort($temp_array) ); // expecting : bool(true)
|
var_dump( ksort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
@ -76,7 +76,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing ksort() : basic functionality ***
|
*** Testing ksort() : basic functionality ***
|
||||||
|
|
||||||
-- Testing ksort() by supplying string array, 'flag' value is defualt --
|
-- Testing ksort() by supplying string array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(8) {
|
array(8) {
|
||||||
["O"]=>
|
["O"]=>
|
||||||
|
@ -97,7 +97,7 @@ array(8) {
|
||||||
string(8) "orange20"
|
string(8) "orange20"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Testing ksort() by supplying numeric array, 'flag' value is defualt --
|
-- Testing ksort() by supplying numeric array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[22]=>
|
[22]=>
|
||||||
|
|
|
@ -55,14 +55,14 @@ $unsorted_str_obj = array (
|
||||||
"apple" => new StringObject("apple"), "Orange" => new StringObject("Orange"),
|
"apple" => new StringObject("apple"), "Orange" => new StringObject("Orange"),
|
||||||
"Lemon" => new StringObject("Lemon"), "aPPle" => new StringObject("aPPle")
|
"Lemon" => new StringObject("Lemon"), "aPPle" => new StringObject("aPPle")
|
||||||
);
|
);
|
||||||
echo "\n-- Testing ksort() by supplying various object arrays, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying various object arrays, 'flag' value is default --\n";
|
||||||
|
|
||||||
// testing ksort() function by supplying integer object array, flag value is defualt
|
// testing ksort() function by supplying integer object array, flag value is default
|
||||||
$temp_array = $unsorted_int_obj;
|
$temp_array = $unsorted_int_obj;
|
||||||
var_dump(ksort($temp_array) );
|
var_dump(ksort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
||||||
// testing ksort() function by supplying string object array, flag value is defualt
|
// testing ksort() function by supplying string object array, flag value is default
|
||||||
$temp_array = $unsorted_str_obj;
|
$temp_array = $unsorted_str_obj;
|
||||||
var_dump(ksort($temp_array) );
|
var_dump(ksort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -83,7 +83,7 @@ echo "Done\n";
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
*** Testing ksort() : object functionality ***
|
*** Testing ksort() : object functionality ***
|
||||||
|
|
||||||
-- Testing ksort() by supplying various object arrays, 'flag' value is defualt --
|
-- Testing ksort() by supplying various object arrays, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[-5]=>
|
[-5]=>
|
||||||
|
|
|
@ -9,7 +9,7 @@ Test ksort() function : usage variations - sort octal values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing ksort() by providing array of octal values for $array argument with following flag values:
|
* testing ksort() by providing array of octal values for $array argument with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +22,7 @@ $unsorted_oct_array = array (
|
||||||
077 => 06, -066 => -01, -0345 => -02, 0 => 0
|
077 => 06, -066 => -01, -0345 => -02, 0 => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing ksort() by supplying octal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying octal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_oct_array;
|
$temp_array = $unsorted_oct_array;
|
||||||
var_dump( ksort($temp_array) ); // expecting : bool(true)
|
var_dump( ksort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -42,7 +42,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing ksort() : usage variations ***
|
*** Testing ksort() : usage variations ***
|
||||||
|
|
||||||
-- Testing ksort() by supplying octal value array, 'flag' value is defualt --
|
-- Testing ksort() by supplying octal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[-229]=>
|
[-229]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test ksort() function : usage variations - sort heredoc strings
|
||||||
/*
|
/*
|
||||||
* testing ksort() by providing array of heredoc strings for $array argument with
|
* testing ksort() by providing array of heredoc strings for $array argument with
|
||||||
* following flag values:
|
* following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_STRING - compare items as strings
|
* 3.SORT_STRING - compare items as strings
|
||||||
*/
|
*/
|
||||||
|
@ -37,7 +37,7 @@ $array = array (
|
||||||
$multiline_heredoc => "heredoc string\twith!@# and 123\nTest this!!!"
|
$multiline_heredoc => "heredoc string\twith!@# and 123\nTest this!!!"
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing ksort() by supplying heredoc string array, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying heredoc string array, 'flag' value is default --\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(ksort($temp_array) ); // expecting : bool(true)
|
var_dump(ksort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -57,7 +57,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing ksort() : usage variations ***
|
*** Testing ksort() : usage variations ***
|
||||||
|
|
||||||
-- Testing ksort() by supplying heredoc string array, 'flag' value is defualt --
|
-- Testing ksort() by supplying heredoc string array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
["HEREDOC"]=>
|
["HEREDOC"]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test ksort() function : usage variations - sort integer/float values
|
||||||
/*
|
/*
|
||||||
* Testing ksort() by providing array of integer/float/mixed values for $array argument
|
* Testing ksort() by providing array of integer/float/mixed values for $array argument
|
||||||
* with following flag values:
|
* with following flag values:
|
||||||
* 1. flag value as defualt
|
* 1. flag value as default
|
||||||
* 2. SORT_REGULAR - compare items normally
|
* 2. SORT_REGULAR - compare items normally
|
||||||
* 3. SORT_NUMERIC - compare items numerically
|
* 3. SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,7 @@ echo "\n-- Testing ksort() by supplying various integer/float arrays --\n";
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(ksort($temp_array) );
|
var_dump(ksort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -63,7 +63,7 @@ echo "Done\n";
|
||||||
-- Testing ksort() by supplying various integer/float arrays --
|
-- Testing ksort() by supplying various integer/float arrays --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[-10]=>
|
[-10]=>
|
||||||
|
@ -131,7 +131,7 @@ array(9) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[-7]=>
|
[-7]=>
|
||||||
|
@ -181,7 +181,7 @@ array(6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
[-10]=>
|
[-10]=>
|
||||||
|
|
|
@ -9,7 +9,7 @@ Test ksort() function : usage variations - sort bool values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing ksort() by providing array of boolean values for $array argument with following flag values:
|
* testing ksort() by providing array of boolean values for $array argument with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ echo "*** Testing ksort() : usage variations ***\n";
|
||||||
// bool value array
|
// bool value array
|
||||||
$bool_values = array (true => true, false => false, TRUE => TRUE, FALSE => FALSE);
|
$bool_values = array (true => true, false => false, TRUE => TRUE, FALSE => FALSE);
|
||||||
|
|
||||||
echo "\n-- Testing ksort() by supplying boolean value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying boolean value array, 'flag' value is default --\n";
|
||||||
$temp_array = $bool_values;
|
$temp_array = $bool_values;
|
||||||
var_dump(ksort($temp_array) );
|
var_dump(ksort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing ksort() : usage variations ***
|
*** Testing ksort() : usage variations ***
|
||||||
|
|
||||||
-- Testing ksort() by supplying boolean value array, 'flag' value is defualt --
|
-- Testing ksort() by supplying boolean value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(2) {
|
array(2) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test ksort() function : usage variations - sort strings
|
||||||
/*
|
/*
|
||||||
* testing ksort() by providing array of string values for $array argument with
|
* testing ksort() by providing array of string values for $array argument with
|
||||||
* following flag values:
|
* following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_STRING - compare items as strings
|
* 3.SORT_STRING - compare items as strings
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,7 @@ echo "\n-- Testing ksort() by supplying various string arrays --\n";
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(ksort($temp_array) ); // expecting : bool(true)
|
var_dump(ksort($temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -63,7 +63,7 @@ echo "Done\n";
|
||||||
-- Testing ksort() by supplying various string arrays --
|
-- Testing ksort() by supplying various string arrays --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
[""]=>
|
[""]=>
|
||||||
|
@ -149,7 +149,7 @@ array(11) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
["Apple"]=>
|
["Apple"]=>
|
||||||
|
|
|
@ -9,7 +9,7 @@ Test ksort() function : usage variations - sort hexadecimal values
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* testing ksort() by providing array of hexa-decimal values for $array argument with following flag values:
|
* testing ksort() by providing array of hexa-decimal values for $array argument with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
* 3.SORT_NUMERIC - compare items numerically
|
* 3.SORT_NUMERIC - compare items numerically
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ $unsorted_hex_array = array (
|
||||||
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
0x1ab => 0x1ab, 0xff => 0xff, -0xff => -0xFF, 0 => 0, -0x2aa => -0x2aa
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "\n-- Testing ksort() by supplying hexadecimal value array, 'flag' value is defualt --\n";
|
echo "\n-- Testing ksort() by supplying hexadecimal value array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_hex_array;
|
$temp_array = $unsorted_hex_array;
|
||||||
var_dump(ksort( $temp_array) ); // expecting : bool(true)
|
var_dump(ksort( $temp_array) ); // expecting : bool(true)
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -43,7 +43,7 @@ echo "Done\n";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing ksort() : usage variations ***
|
*** Testing ksort() : usage variations ***
|
||||||
|
|
||||||
-- Testing ksort() by supplying hexadecimal value array, 'flag' value is defualt --
|
-- Testing ksort() by supplying hexadecimal value array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[-682]=>
|
[-682]=>
|
||||||
|
|
|
@ -10,7 +10,7 @@ Test ksort() function : usage variations - sort array with diff. sub arrays
|
||||||
/*
|
/*
|
||||||
* testing ksort() by providing arrays containing sub arrays for $array argument
|
* testing ksort() by providing arrays containing sub arrays for $array argument
|
||||||
* with flowing flag values:
|
* with flowing flag values:
|
||||||
* 1. flag value as defualt
|
* 1. flag value as default
|
||||||
* 2. SORT_REGULAR - compare items normally
|
* 2. SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ echo "\n-- Testing ksort() by supplying various arrays containing sub arrays --\
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
|
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump( ksort($temp_array) );
|
var_dump( ksort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -60,7 +60,7 @@ echo "Done\n";
|
||||||
-- Testing ksort() by supplying various arrays containing sub arrays --
|
-- Testing ksort() by supplying various arrays containing sub arrays --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(0) {
|
array(0) {
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ array(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(1) {
|
array(1) {
|
||||||
[1]=>
|
[1]=>
|
||||||
|
@ -86,7 +86,7 @@ array(1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[1]=>
|
[1]=>
|
||||||
|
@ -118,7 +118,7 @@ array(3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 4 --
|
-- Iteration 4 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
|
@ -9,7 +9,7 @@ Test ksort() function : usage variations - sorting arrays with/without keys
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing ksort() by providing arrays with/without key values for $array argument with following flag values:
|
* Testing ksort() by providing arrays with/without key values for $array argument with following flag values:
|
||||||
* 1.flag value as defualt
|
* 1.flag value as default
|
||||||
* 2.SORT_REGULAR - compare items normally
|
* 2.SORT_REGULAR - compare items normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ echo "\n-- Testing ksort() by supplying various arrays with/without key values -
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With defualt sort flag -\n";
|
echo "- With default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump( ksort($temp_array) );
|
var_dump( ksort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -53,7 +53,7 @@ echo "Done\n";
|
||||||
-- Testing ksort() by supplying various arrays with/without key values --
|
-- Testing ksort() by supplying various arrays with/without key values --
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(5) {
|
array(5) {
|
||||||
[5]=>
|
[5]=>
|
||||||
|
@ -83,7 +83,7 @@ array(5) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
["a"]=>
|
["a"]=>
|
||||||
|
@ -105,7 +105,7 @@ array(3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -139,7 +139,7 @@ array(6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 4 --
|
-- Iteration 4 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -161,7 +161,7 @@ array(3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 5 --
|
-- Iteration 5 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(6) {
|
array(6) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -195,7 +195,7 @@ array(6) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 6 --
|
-- Iteration 6 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(2) {
|
array(2) {
|
||||||
["bar"]=>
|
["bar"]=>
|
||||||
|
@ -213,7 +213,7 @@ array(2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 7 --
|
-- Iteration 7 --
|
||||||
- With defualt sort flag -
|
- With default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
["a"]=>
|
["a"]=>
|
||||||
|
|
|
@ -23,12 +23,12 @@ $unsorted_strings = array(
|
||||||
// array with default keys containing unsorted numeric values
|
// array with default keys containing unsorted numeric values
|
||||||
$unsorted_numerics = array( 100, 33, 555, 22 );
|
$unsorted_numerics = array( 100, 33, 555, 22 );
|
||||||
|
|
||||||
echo "\n-- Testing rsort() by supplying string array, 'flag' value is defualt --\n";
|
echo "\n-- Testing rsort() by supplying string array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_strings;
|
$temp_array = $unsorted_strings;
|
||||||
var_dump( rsort($temp_array) );
|
var_dump( rsort($temp_array) );
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
|
||||||
echo "\n-- Testing rsort() by supplying numeric array, 'flag' value is defualt --\n";
|
echo "\n-- Testing rsort() by supplying numeric array, 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_numerics;
|
$temp_array = $unsorted_numerics;
|
||||||
var_dump( rsort($temp_array) );
|
var_dump( rsort($temp_array) );
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
@ -73,7 +73,7 @@ echo "Done";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing rsort() : basic functionality ***
|
*** Testing rsort() : basic functionality ***
|
||||||
|
|
||||||
-- Testing rsort() by supplying string array, 'flag' value is defualt --
|
-- Testing rsort() by supplying string array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(8) {
|
array(8) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -94,7 +94,7 @@ array(8) {
|
||||||
string(6) "Orange"
|
string(6) "Orange"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Testing rsort() by supplying numeric array, 'flag' value is defualt --
|
-- Testing rsort() by supplying numeric array, 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(4) {
|
array(4) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
|
@ -58,12 +58,12 @@ $unsorted_str_obj = array (
|
||||||
|
|
||||||
echo "\n-- Sort flag = default --\n";
|
echo "\n-- Sort flag = default --\n";
|
||||||
|
|
||||||
// testing rsort() function by supplying integer object array, flag value is defualt
|
// testing rsort() function by supplying integer object array, flag value is default
|
||||||
$temp_array = $unsorted_int_obj;
|
$temp_array = $unsorted_int_obj;
|
||||||
var_dump(rsort($temp_array) );
|
var_dump(rsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
||||||
// testing rsort() function by supplying string object array, flag value is defualt
|
// testing rsort() function by supplying string object array, flag value is default
|
||||||
$temp_array = $unsorted_str_obj;
|
$temp_array = $unsorted_str_obj;
|
||||||
var_dump(rsort($temp_array) );
|
var_dump(rsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
|
@ -69,12 +69,12 @@ $unsorted_str_obj = array (
|
||||||
|
|
||||||
echo "\n-- Sort flag = default --\n";
|
echo "\n-- Sort flag = default --\n";
|
||||||
|
|
||||||
// testing rsort() function by supplying integer object array, flag value is defualt
|
// testing rsort() function by supplying integer object array, flag value is default
|
||||||
$temp_array = $unsorted_int_obj;
|
$temp_array = $unsorted_int_obj;
|
||||||
var_dump(rsort($temp_array) );
|
var_dump(rsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
||||||
// testing rsort() function by supplying string object array, flag value is defualt
|
// testing rsort() function by supplying string object array, flag value is default
|
||||||
$temp_array = $unsorted_str_obj;
|
$temp_array = $unsorted_str_obj;
|
||||||
var_dump(rsort($temp_array) );
|
var_dump(rsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
|
|
@ -42,7 +42,7 @@ $count = 1;
|
||||||
foreach ($various_arrays as $array) {
|
foreach ($various_arrays as $array) {
|
||||||
echo "\n-- Iteration $count --\n";
|
echo "\n-- Iteration $count --\n";
|
||||||
|
|
||||||
echo "- With Defualt sort flag -\n";
|
echo "- With Default sort flag -\n";
|
||||||
$temp_array = $array;
|
$temp_array = $array;
|
||||||
var_dump(rsort($temp_array) );
|
var_dump(rsort($temp_array) );
|
||||||
var_dump($temp_array);
|
var_dump($temp_array);
|
||||||
|
@ -63,7 +63,7 @@ echo "Done";
|
||||||
*** Testing rsort() : variation ***
|
*** Testing rsort() : variation ***
|
||||||
|
|
||||||
-- Iteration 1 --
|
-- Iteration 1 --
|
||||||
- With Defualt sort flag -
|
- With Default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(9) {
|
array(9) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -131,7 +131,7 @@ array(9) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 2 --
|
-- Iteration 2 --
|
||||||
- With Defualt sort flag -
|
- With Default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(7) {
|
array(7) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -187,7 +187,7 @@ array(7) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 3 --
|
-- Iteration 3 --
|
||||||
- With Defualt sort flag -
|
- With Default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(11) {
|
array(11) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
@ -267,7 +267,7 @@ array(11) {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Iteration 4 --
|
-- Iteration 4 --
|
||||||
- With Defualt sort flag -
|
- With Default sort flag -
|
||||||
bool(true)
|
bool(true)
|
||||||
array(7) {
|
array(7) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
|
@ -23,7 +23,7 @@ $value3 = 555;
|
||||||
// an array containing integer references
|
// an array containing integer references
|
||||||
$unsorted_numerics = array( &$value1 , &$value2, &$value3);
|
$unsorted_numerics = array( &$value1 , &$value2, &$value3);
|
||||||
|
|
||||||
echo "\n-- 'flag' value is defualt --\n";
|
echo "\n-- 'flag' value is default --\n";
|
||||||
$temp_array = $unsorted_numerics;
|
$temp_array = $unsorted_numerics;
|
||||||
var_dump( rsort($temp_array) );
|
var_dump( rsort($temp_array) );
|
||||||
var_dump( $temp_array);
|
var_dump( $temp_array);
|
||||||
|
@ -38,7 +38,7 @@ echo "Done";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
*** Testing rsort() : variation ***
|
*** Testing rsort() : variation ***
|
||||||
|
|
||||||
-- 'flag' value is defualt --
|
-- 'flag' value is default --
|
||||||
bool(true)
|
bool(true)
|
||||||
array(3) {
|
array(3) {
|
||||||
[0]=>
|
[0]=>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue