spyc.yaml loaded into PHP:
Array
(
[String] => Anyone's name, really.
[Int] => 13
[True] => 1
[False] =>
[Zero] => 0
[Null] =>
[NotNull] => null
[NotTrue] => y
[NotBoolTrue] => true
[NotInt] => 5
[Float] => 5.34
[Negative] => -90
[SmallFloat] => 0.7
[NewLine] =>
[0] => PHP Class
[1] => Basic YAML Loader
[2] => Very Basic YAML Dumper
[3] => Array
(
[0] => YAML is so easy to learn.
[1] => Your config files will never be the same.
)
[4] => Array
(
[cpu] => 1.5ghz
[ram] => 1 gig
[os] => os x 10.4.1
)
[domains] => Array
(
[0] => yaml.org
[1] => php.net
)
[5] => Array
(
[program] => Adium
[platform] => OS X
[type] => Chat Client
)
[no time] => There isn't any time for your tricks!
Do you understand?
[some time] => There is nothing but time
for your tricks.
[databases] => Array
(
[0] => Array
(
[name] => spartan
[notes] => Array
(
[0] => Needs to be backed up
[1] => Needs to be normalized
)
[type] => mysql
)
)
[if: you'd] => like
[6] => Array
(
[0] => One
[1] => Two
[2] => Three
[3] => Four
)
[7] => Array
(
[0] => One
[1] => Array
(
[0] => Two
[1] => And
[2] => Three
)
[2] => Four
[3] => Five
)
[8] => Array
(
[0] => This
[1] => Array
(
[0] => Is
[1] => Getting
[2] => Array
(
[0] => Ridiculous
[1] => Guys
)
)
[2] => Seriously
[3] => Array
(
[0] => Show
[1] => Mercy
)
)
[9] => Array
(
[name] => chris
[age] => young
[brand] => lucky strike
)
[10] => Array
(
[name] => mark
[age] => older than chris
[brand] => Array
(
[0] => marlboro
[1] => lucky strike
)
)
[dynamic languages] => Array
(
[0] => Perl
[1] => Python
[2] => PHP
[3] => Ruby
)
[compiled languages] => Array
(
[0] => C/C++
[1] => Java
)
[all languages] => Array
(
[0] => Array
(
[0] => Perl
[1] => Python
[2] => PHP
[3] => Ruby
)
[1] => Array
(
[0] => C/C++
[1] => Java
)
)
[11] => you know, this shouldn't work. but it does.
[12] => that's my value.
[13] => again, that's my value.
[14] => here's to "quotes", boss.
[15] => Array
(
[name] => Foo, Bar's
[age] => 20
)
[16] => Array
(
[0] => a
[1] => Array
(
[0] => 1
[1] => 2
)
[2] => b
)
[17] => Array
(
[javascripts] => Array
(
[0] => dom1.js
[1] => dom.js
)
)
[1040] => Ooo, a numeric key!
[hash_1] => Hash
[hash_2] => Hash #and a comment
[hash#3] => Hash (#) can appear in key too
[float_test] => 1.0
[float_test_with_quotes] => 1.0
[float_inverse_test] => 1
[a_really_large_number] => 115792089237316195423570985008687907853269984665640564039457584007913129639936
[int array] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
[array on several lines] => Array
(
[0] => 0
[1] => 1
[2] => 2
[3] => 3
[4] => 4
[5] => 5
[6] => 6
[7] => 7
[8] => 8
[9] => 9
[10] => 10
[11] => 11
[12] => 12
[13] => 13
[14] => 14
[15] => 15
[16] => 16
[17] => 17
[18] => 18
[19] => 19
)
[morelesskey] =>
[array_of_zero] => Array
(
[0] => 0
)
[sophisticated_array_of_zero] => Array
(
[rx] => Array
(
[tx] => Array
(
[0] => 0
)
)
)
[switches] => Array
(
[0] => Array
(
[row] => 0
[col] => 0
[func] => Array
(
[tx] => Array
(
[0] => 0
[1] => 1
)
)
)
)
[empty_sequence] => Array
(
)
[empty_hash] => Array
(
)
[special_characters] => [{]]{{]]
[asterisks] => *
[empty_key] => Array
(
[] => Array
(
[key] => value
)
)
[trailing_colon] => foo:
[multiline_items] => Array
(
[0] => Array
(
[type] => SomeItem
[values] => Array
(
[0] => blah
[1] => blah
[2] => blah
[3] => blah
)
[ints] => Array
(
[0] => 2
[1] => 54
[2] => 12
[3] => 2143
)
)
)
[many_lines] => A quick
fox
jumped
over
a lazy
dog
[werte] => Array
(
[1] => nummer 1
[0] => Stunde 0
)
[noindent_records] =>
[1041] => Array
(
[record1] => value1
)
[1042] => Array
(
[record2] => value2
)
[a:1] => Array
(
[0] => 1000
)
[a:2] => Array
(
[0] => 2000
)
[endloop] => Does this line in the end indeed make Spyc go to an infinite loop?
)
YAML Data dumped back:
---
String: "Anyone's name, really."
Int: 13
True: true
False: false
Zero: 0
Null: null
NotNull: 'null'
NotTrue: 'y'
NotBoolTrue: 'true'
NotInt: 5
Float: 5.34
Negative: -90
SmallFloat: 0.7
NewLine: \n
0: PHP Class
1: Basic YAML Loader
2: Very Basic YAML Dumper
3:
- YAML is so easy to learn.
- >
Your config files will never be the
same.
4:
cpu: 1.5ghz
ram: 1 gig
os: os x 10.4.1
domains:
- yaml.org
- php.net
5:
program: Adium
platform: OS X
type: Chat Client
no time: |
There isn't any time for your tricks!
Do you understand?
some time: |
There is nothing but time
for your tricks.
databases:
-
name: spartan
notes:
- Needs to be backed up
- Needs to be normalized
type: mysql
"if: you'd": like
6:
- One
- Two
- Three
- Four
7:
- One
-
- Two
- And
- Three
- Four
- Five
8:
- This
-
- Is
- Getting
-
- Ridiculous
- Guys
- Seriously
-
- Show
- Mercy
9:
name: chris
age: young
brand: lucky strike
10:
name: mark
age: older than chris
brand:
- marlboro
- lucky strike
dynamic languages:
- Perl
- Python
- PHP
- Ruby
compiled languages:
- C/C++
- Java
all languages:
-
- Perl
- Python
- PHP
- Ruby
-
- C/C++
- Java
11: "you know, this shouldn't work. but it does."
12: "that's my value."
13: "again, that's my value."
14: |
here's to "quotes", boss.
15:
name: "Foo, Bar's"
age: 20
16:
- a
-
- 1
- 2
- b
17:
javascripts:
- dom1.js
- dom.js
1040: Ooo, a numeric key!
hash_1: Hash
hash_2: 'Hash #and a comment'
"hash#3": 'Hash (#) can appear in key too'
float_test: 1.0
float_test_with_quotes: 1.0
float_inverse_test: 1
a_really_large_number: >
115792089237316195423570985008687907853269984665640564039457584007913129639936
int array:
- 1
- 2
- 3
array on several lines:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
morelesskey: ''
array_of_zero:
- 0
sophisticated_array_of_zero:
rx:
tx:
- 0
switches:
-
row: 0
col: 0
func:
tx:
- 0
- 1
empty_sequence: [ ]
empty_hash: [ ]
special_characters: '[{]]{{]]'
asterisks: '*'
empty_key:
:
key: value
trailing_colon: 'foo:'
multiline_items:
-
type: SomeItem
values:
- blah
- blah
- blah
- blah
ints:
- 2
- 54
- 12
- 2143
many_lines: |
A quick
fox
jumped
over
a lazy
dog
werte:
1: nummer 1
0: Stunde 0
noindent_records:
1041:
record1: value1
1042:
record2: value2
"a:1":
- 1000
"a:2":
- 2000
endloop: >
Does this line in the end indeed make
Spyc go to an infinite loop?