File: yaml_emit_005.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 (24 lines) | stat: -rw-r--r-- 345 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
--TEST--
yaml_emit - serializable
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
?>
--FILE--
<?php
class A {
  public $one = 1;

  public function show_one() {
    echo $this->one;
  }
}
$a = new A;

var_dump(yaml_emit(array('a' => $a)));
?>
--EXPECT--
string(56) "---
a: !php/object "O:1:\"A\":1:{s:3:\"one\";i:1;}"
...
"