PATH:
opt
/
alt
/
tests
/
alt-php80-pecl-msgpack_2.2.0-1.el8
/
tests
--TEST-- Cyclic array test --INI-- --SKIPIF-- <?php if (version_compare(PHP_VERSION, "8.0.0dev", "<")) { die("skip PHP < 8.0"); } ?> --FILE-- <?php if(!extension_loaded('msgpack')) { dl('msgpack.' . PHP_SHLIB_SUFFIX); } function test($type, $variable, $test) { $serialized = msgpack_serialize($variable); $unserialized = msgpack_unserialize($serialized); echo $type, PHP_EOL; echo bin2hex($serialized), PHP_EOL; var_dump($unserialized); echo $test || $unserialized == $variable ? 'OK' : 'ERROR', PHP_EOL; } $a = array( 'a' => array( 'b' => 'c', 'd' => 'e' ), ); $a['f'] = &$a; test('array', $a, true); $a = array("foo" => &$b); $b = array(1, 2, $a); var_dump($a); var_dump($k = msgpack_unserialize(msgpack_serialize($a))); $k["foo"][1] = "b"; var_dump($k); ?> --EXPECT-- array 82a16182a162a163a164a165a16683c001a16182a162a163a164a165a16682c0020003 array(2) { ["a"]=> array(2) { ["b"]=> string(1) "c" ["d"]=> string(1) "e" } ["f"]=> &array(2) { ["a"]=> array(2) { ["b"]=> string(1) "c" ["d"]=> string(1) "e" } ["f"]=> *RECURSION* } } OK array(1) { ["foo"]=> &array(3) { [0]=> int(1) [1]=> int(2) [2]=> *RECURSION* } } array(1) { ["foo"]=> &array(3) { [0]=> int(1) [1]=> int(2) [2]=> array(1) { ["foo"]=> *RECURSION* } } } array(1) { ["foo"]=> &array(3) { [0]=> int(1) [1]=> string(1) "b" [2]=> array(1) { ["foo"]=> *RECURSION* } } }
[-] 003.phpt
[edit]
[-] 129.phpt
[edit]
[-] 035.phpt
[edit]
[-] 040d.phpt
[edit]
[-] 112.phpt
[edit]
[-] bug002.phpt
[edit]
[-] 019.phpt
[edit]
[-] 067.phpt
[edit]
[-] 023.phpt
[edit]
[-] 095.phpt
[edit]
[-] 094.phpt
[edit]
[-] 134.phpt
[edit]
[-] issue080.phpt
[edit]
[-] 033.phpt
[edit]
[-] 008.phpt
[edit]
[-] 063.phpt
[edit]
[-] 032.phpt
[edit]
[-] 127.phpt
[edit]
[-] 114.phpt
[edit]
[-] 005.phpt
[edit]
[-] 015.phpt
[edit]
[-] 024.phpt
[edit]
[-] 084.phpt
[edit]
[-] 061.phpt
[edit]
[-] 093.phpt
[edit]
[-] 062.phpt
[edit]
[-] 119.phpt
[edit]
[-] 123.phpt
[edit]
[-] 040.phpt
[edit]
[-] 101.phpt
[edit]
[-] issue149.ser.txt
[edit]
[-] 106.phpt
[edit]
[-] 120.phpt
[edit]
[-] 065.phpt
[edit]
[-] 115.phpt
[edit]
[-] 088.phpt
[edit]
[-] 073.phpt
[edit]
[-] 108.phpt
[edit]
[-] 087.phpt
[edit]
[-] 012.phpt
[edit]
[-] 137.phpt
[edit]
[-] 025.phpt
[edit]
[-] 041.phpt
[edit]
[-] 104.phpt
[edit]
[-] 111.phpt
[edit]
[-] 132.phpt
[edit]
[-] 135.phpt
[edit]
[-] 050.phpt
[edit]
[-] 139.phpt
[edit]
[-] 026.phpt
[edit]
[-] 016.phpt
[edit]
[-] 030.phpt
[edit]
[-] 014.phpt
[edit]
[-] 070.phpt
[edit]
[-] issue094.phpt
[edit]
[-] 071.phpt
[edit]
[-] 017.phpt
[edit]
[+]
..
[-] 140.phpt
[edit]
[-] 098.phpt
[edit]
[-] 125.phpt
[edit]
[-] 080.phpt
[edit]
[-] 116.phpt
[edit]
[-] 028.phpt
[edit]
[-] 131.phpt
[edit]
[-] 113.phpt
[edit]
[-] 126.phpt
[edit]
[-] 085.phpt
[edit]
[-] 096.phpt
[edit]
[-] 015e.phpt
[edit]
[-] 128.phpt
[edit]
[-] 122.phpt
[edit]
[-] 040b.phpt
[edit]
[-] bug012.phpt
[edit]
[-] 026a.phpt
[edit]
[-] issue067_32bit.phpt
[edit]
[-] 092.phpt
[edit]
[-] issue091.phpt
[edit]
[-] 066.phpt
[edit]
[-] 007.phpt
[edit]
[-] 031.phpt
[edit]
[-] 081.phpt
[edit]
[-] 034.phpt
[edit]
[-] bug006.phpt
[edit]
[-] 021.phpt
[edit]
[-] 002.phpt
[edit]
[-] 060.phpt
[edit]
[-] 100.phpt
[edit]
[-] 103.phpt
[edit]
[-] issue137.phpt
[edit]
[-] 117.phpt
[edit]
[-] 133.phpt
[edit]
[-] issue083.phpt
[edit]
[-] 089.phpt
[edit]
[-] 102.phpt
[edit]
[-] 029.phpt
[edit]
[-] 124.phpt
[edit]
[-] 121.phpt
[edit]
[-] 105.phpt
[edit]
[-] 107.phpt
[edit]
[-] 091.phpt
[edit]
[-] issue149.phpt
[edit]
[-] 009.phpt
[edit]
[-] 027.phpt
[edit]
[-] 018.phpt
[edit]
[-] 006.phpt
[edit]
[-] 118.phpt
[edit]
[-] 022.phpt
[edit]
[-] 010.phpt
[edit]
[-] 020.phpt
[edit]
[-] 072.phpt
[edit]
[-] 110.phpt
[edit]
[-] 086.phpt
[edit]
[-] 136.phpt
[edit]
[-] 013.phpt
[edit]
[-] 109.phpt
[edit]
[-] 083.phpt
[edit]
[-] 082.phpt
[edit]
[-] 042.phpt
[edit]
[-] bug011.phpt
[edit]
[-] 064.phpt
[edit]
[-] 130.phpt
[edit]
[-] 099.phpt
[edit]
[-] 009a.phpt
[edit]
[-] 004.phpt
[edit]
[-] 021a.phpt
[edit]
[-] 001.phpt
[edit]
[-] 097.phpt
[edit]
[-] 090.phpt
[edit]
[-] 040c.phpt
[edit]
[-] 138.phpt
[edit]
[-] issue081.phpt
[edit]
[-] 015b.phpt
[edit]