File: igbinary_096.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 (29 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Test unserialization creates valid current()
--INI--
display_errors=stderr
error_reporting=E_ALL
--FILE--
<?php
$arr = [
	'one' => [
		'two' => [
			'three' => [
				'four'
			],
		],
	],
];
$test = current(current(current(current($arr))));

var_dump($test);

// Note: after unserialization the current is the last array element.
$arr2 = igbinary_unserialize(igbinary_serialize($arr));
$test2 = current(current(current(current($arr2))));

var_dump($test2);
?>
--EXPECT--
string(4) "four"
string(4) "four"