diff options
author | Marcus Boerger <helly@php.net> | 2004-02-03 21:52:46 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-02-03 21:52:46 +0000 |
commit | 38e5a2a3749b4a785a0c1de4072cca74581d2b61 (patch) | |
tree | ebf8b85986d25214aaaca1f910004770afa2ed2c /tests | |
parent | 363c58787175c8f8429fc9bd9298d1c5f706a3c6 (diff) | |
download | php-git-38e5a2a3749b4a785a0c1de4072cca74581d2b61.tar.gz |
Update tests
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/classes/clone_001.phpt | 2 | ||||
-rwxr-xr-x | tests/classes/clone_002.phpt | 4 | ||||
-rwxr-xr-x | tests/classes/clone_003.phpt | 4 | ||||
-rwxr-xr-x | tests/classes/clone_004.phpt | 16 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/classes/clone_006.phpt (renamed from tests/classes/__clone_001.phpt) | 5 |
5 files changed, 20 insertions, 11 deletions
diff --git a/tests/classes/clone_001.phpt b/tests/classes/clone_001.phpt index c116f73973..eb06c1f520 100755 --- a/tests/classes/clone_001.phpt +++ b/tests/classes/clone_001.phpt @@ -13,7 +13,7 @@ class test { $obj = new test; $obj->p2 = 'A'; $obj->p3 = 'B'; -$copy = $obj->__clone(); +$copy = clone $obj; $copy->p3 = 'C'; echo "Object\n"; var_dump($obj); diff --git a/tests/classes/clone_002.phpt b/tests/classes/clone_002.phpt index 5773b5f273..4430a2cab4 100755 --- a/tests/classes/clone_002.phpt +++ b/tests/classes/clone_002.phpt @@ -15,7 +15,7 @@ class test { $obj = new test; $obj->p2 = 'A'; $obj->p3 = 'B'; -$copy = $obj->__clone(); +$copy = clone $obj; $copy->p3 = 'C'; echo "Object\n"; var_dump($obj); @@ -38,7 +38,7 @@ object(test)#2 (3) { ["p1"]=> int(1) ["p2"]=> - int(2) + string(1) "A" ["p3"]=> string(1) "C" } diff --git a/tests/classes/clone_003.phpt b/tests/classes/clone_003.phpt index 148204c04d..658810825c 100755 --- a/tests/classes/clone_003.phpt +++ b/tests/classes/clone_003.phpt @@ -27,7 +27,7 @@ class test extends base { $obj = new test; $obj->p4 = 'A'; -$copy = $obj->__clone(); +$copy = clone $obj; echo "Object\n"; print_r($obj); echo "Clown\n"; @@ -50,7 +50,7 @@ test Object ( [p1] => test:1 [p3] => test:3 - [p4] => test:4 + [p4] => A [p5] => clone:5 [p2] => base:2 [p6:private] => base:6 diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt index ca1a9fc272..2059103bc5 100755 --- a/tests/classes/clone_004.phpt +++ b/tests/classes/clone_004.phpt @@ -27,7 +27,7 @@ $o1->b = array(3,4); $o1->show(); echo "Clone\n"; -$o2 = $o1->__clone(); +$o2 = clone $o1; $o2->show(); echo "Modify\n"; @@ -58,9 +58,19 @@ object(test)#1 (2) { Clone object(test)#2 (2) { ["b"]=> - string(4) "test" + array(2) { + [0]=> + int(3) + [1]=> + int(4) + } ["a"]=> - string(4) "base" + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } } Modify object(test)#2 (2) { diff --git a/tests/classes/__clone_001.phpt b/tests/classes/clone_006.phpt index fe320df468..346911ad0d 100644..100755 --- a/tests/classes/__clone_001.phpt +++ b/tests/classes/clone_006.phpt @@ -1,5 +1,5 @@ --TEST-- -ZE2 __clone() +ZE2 object cloning, 6 --SKIPIF-- <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> --FILE-- @@ -13,7 +13,6 @@ class MyCloneable { } function __clone() { - $this->name = $that->name; $this->address = "New York"; $this->id = self::$id++; } @@ -26,7 +25,7 @@ $original->address = "Tel-Aviv"; echo $original->id . "\n"; -$clone = $original->__clone(); +$clone = clone $original; echo $clone->id . "\n"; echo $clone->name . "\n"; |