File: yaml_emit_007.phpt

package info (click to toggle)
php-yaml 2.0.2%2B1.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 904 kB
  • sloc: ansic: 4,832; xml: 751; makefile: 1
file content (28 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (13)
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
--TEST--
yaml_emit - recursive structures
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
?>
--FILE--
<?php
$recursive = array(
  "a" => "a",
  "b" => "b",
  "c" => &$recursive,
);
var_dump(yaml_emit($recursive));

// clean up a little or we may see false memory leak reports
unset($recursive['c']);
?>
--EXPECT--
string(56) "---
a: a
b: b
c: &refid1
  a: a
  b: b
  c: *refid1
...
"