File: igbinary_069.phpt

package info (click to toggle)
php-igbinary 3.2.16-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,024 kB
  • sloc: ansic: 3,373; xml: 1,106; pascal: 10; makefile: 2; php: 2; sh: 1
file content (20 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
Test serializing and unserializing many duplicate strings
--FILE--
<?php

function main() {
	$arr = array();
	// Just more than 2 ** 16
	$n = (2 ** 16) + 100;
	for ($i = 0; $i < $n; $i++) {
		$s = "$i";
		$arr[] = $s;
		$arr[] = $s;
	}
	$unser = igbinary_unserialize(igbinary_serialize($arr));
	var_export($arr === $unser);
}
main();
--EXPECT--
true