xref: /PHP-7.0/ext/gmp/tests/clone.phpt (revision 7713b8c2)
1--TEST--
2Cloning GMP instances
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7
8$a = gmp_init(3);
9$b = clone $a;
10gmp_clrbit($a, 0);
11var_dump($a, $b); // $b should be unaffected
12
13?>
14--EXPECTF--
15object(GMP)#1 (1) {
16  ["num"]=>
17  string(1) "2"
18}
19object(GMP)#2 (1) {
20  ["num"]=>
21  string(1) "3"
22}
23