File: bug002.phpt

package info (click to toggle)
php-msgpack 1%3A3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,224 kB
  • sloc: ansic: 3,925; xml: 458; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Bug #2 (Deserializing a large array of nested objects gives "zend_mm_heap corrupted")
--SKIPIF--
<?php
if (!extension_loaded("msgpack")) {
   echo "skip";
}
?>
--FILE--
<?php

$data = array();

$tmp = &$data;
for ($i = 0; $i < 1023; $i++) {
    $tmp[] = array();
    $tmp = &$tmp[0];
}

$newdata = msgpack_unserialize(msgpack_serialize($data));
var_dump($newdata == $data);
?>
--EXPECTF--
bool(true)