| Current File : /home/mmdealscpanel/yummmdeals.com/alt-php84-pecl-yaml_2.2.3-1.el8.zip |
PK ;��ZM%�dS S tests/yaml_parse_spec_bool.phptnu �[��� --TEST--
Yaml 1.1 Spec - bool
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
canonical: y
answer: NO
logical: True
option: on
'));
?>
--EXPECT--
array(4) {
["canonical"]=>
bool(true)
["answer"]=>
bool(false)
["logical"]=>
bool(true)
["option"]=>
bool(true)
}
PK ;��Z�SS� � , tests/yaml_parse_wiki_YtsBasicTests_006.phptnu �[��� --TEST--
Yaml YtsBasicTests - Sequence in a Mapping
--DESCRIPTION--
A value in a mapping can be a sequence.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('foo: whatever
bar:
- uno
- dos
'));
?>
--EXPECT--
array(2) {
["foo"]=>
string(8) "whatever"
["bar"]=>
array(2) {
[0]=>
string(3) "uno"
[1]=>
string(3) "dos"
}
}
PK ;��Z���� � tests/bug_75029.phptnu �[��� --TEST--
Test PECL bug #75029
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse(''));
var_dump(yaml_parse('# Empty', -1));
$doc = <<<EOD
doc
---
---
doc
EOD;
var_dump(yaml_parse($doc, -1));
var_dump(yaml_parse($doc, 1));
?>
--EXPECT--
NULL
array(1) {
[0]=>
NULL
}
array(3) {
[0]=>
string(3) "doc"
[1]=>
NULL
[2]=>
string(3) "doc"
}
NULL
PK ;��ZJ�n0" " tests/bug_69465.phptnu �[��� --TEST--
Test PECL bug #69465
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_timestamp=1
date.timezone=UTC
--FILE--
<?php
$yaml_code = <<<YAML
date1: 2015-05-15
date2: "2015-05-15"
date3: ! 2015-05-15
bool1: true
bool2: "true"
bool3: ! true
int1: 1
int2: "1"
int3: ! 1
float1: 1.5
float2: "1.5"
float3: ! 1.5
YAML;
var_dump(yaml_parse($yaml_code));
?>
--EXPECT--
array(12) {
["date1"]=>
int(1431648000)
["date2"]=>
string(10) "2015-05-15"
["date3"]=>
string(10) "2015-05-15"
["bool1"]=>
bool(true)
["bool2"]=>
string(4) "true"
["bool3"]=>
string(4) "true"
["int1"]=>
int(1)
["int2"]=>
string(1) "1"
["int3"]=>
string(1) "1"
["float1"]=>
float(1.5)
["float2"]=>
string(3) "1.5"
["float3"]=>
string(3) "1.5"
}
PK ;��Z$�$7 7 , tests/yaml_parse_wiki_YtsBasicTests_007.phptnu �[��� --TEST--
Yaml YtsBasicTests - Nested Mappings
--DESCRIPTION--
A value in a mapping can be another mapping.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('foo: whatever
bar:
fruit: apple
name: steve
sport: baseball
'));
?>
--EXPECT--
array(2) {
["foo"]=>
string(8) "whatever"
["bar"]=>
array(3) {
["fruit"]=>
string(5) "apple"
["name"]=>
string(5) "steve"
["sport"]=>
string(8) "baseball"
}
}
PK ;��ZE�B� � - tests/yaml_parse_wiki_YtsStrangeKeys_001.phptnu �[��� --TEST--
Yaml YtsStrangeKeys - Quoted line noise key
--DESCRIPTION--
Check that quoted line noise parses as key.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
"!@#%" : bar baz
'));
?>
--EXPECT--
array(1) {
["!@#%"]=>
string(7) "bar baz"
}
PK ;��Z���V V tests/yaml_parse_spec_seq.phptnu �[��� --TEST--
Yaml 1.1 Spec - seq
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
# Ordered sequence of nodes
Block style: !!seq
- Mercury # Rotates - no light/dark sides.
- Venus # Deadliest. Aptly named.
- Earth # Mostly dirt.
- Mars # Seems empty.
- Jupiter # The king.
- Saturn # Pretty.
- Uranus # Where the sun hardly shines.
- Neptune # Boring. No rings.
- Pluto # You call this a planet?
Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks
Jupiter, Saturn, Uranus, Neptune, # Gas
Pluto ] # Overrated
'));
?>
--EXPECT--
array(2) {
["Block style"]=>
array(9) {
[0]=>
string(7) "Mercury"
[1]=>
string(5) "Venus"
[2]=>
string(5) "Earth"
[3]=>
string(4) "Mars"
[4]=>
string(7) "Jupiter"
[5]=>
string(6) "Saturn"
[6]=>
string(6) "Uranus"
[7]=>
string(7) "Neptune"
[8]=>
string(5) "Pluto"
}
["Flow style"]=>
array(9) {
[0]=>
string(7) "Mercury"
[1]=>
string(5) "Venus"
[2]=>
string(5) "Earth"
[3]=>
string(4) "Mars"
[4]=>
string(7) "Jupiter"
[5]=>
string(6) "Saturn"
[6]=>
string(6) "Uranus"
[7]=>
string(7) "Neptune"
[8]=>
string(5) "Pluto"
}
}
PK ;��Z�~��P P tests/yaml_emit_004.phptnu �[��� --TEST--
yaml_emit - datetime
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
if(!class_exists('DateTime')) die('skip DateTime n/a');
?>
--INI--
date.timezone=GMT
--FILE--
<?php
$d = new DateTime('2008-08-03T14:52:10Z');
var_dump(yaml_emit($d));
?>
--EXPECT--
string(41) "--- 2008-08-03T14:52:10.000000+00:00
...
"
PK ;��Z�ͫh , tests/yaml_parse_wiki_YtsBasicTests_004.phptnu �[��� --TEST--
Yaml YtsBasicTests - Deeply Nested Sequences
--DESCRIPTION--
Sequences can be nested even deeper, with each
level of indentation representing a level of
depth.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('-
-
- uno
- dos
'));
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
[0]=>
array(2) {
[0]=>
string(3) "uno"
[1]=>
string(3) "dos"
}
}
}
PK ;��Z-E+ tests/yaml_parse_spec_float.phptnu �[��� --TEST--
Yaml 1.1 Spec - float
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
canonical: 6.8523015e+5
exponentioal: 685.230_15e+03
fixed: 685_230.15
sexagesimal: 190:20:30.15
negative infinity: -.inf
not a number: .NaN
'));
?>
--EXPECT--
array(6) {
["canonical"]=>
float(685230.15)
["exponentioal"]=>
float(685230.15)
["fixed"]=>
float(685230.15)
["sexagesimal"]=>
float(685230.15)
["negative infinity"]=>
float(-INF)
["not a number"]=>
float(NAN)
}
PK ;��Z|�I;- - , tests/yaml_parse_wiki_YtsBasicTests_009.phptnu �[��� --TEST--
Yaml YtsBasicTests - Sequence-Mapping Shortcut
--DESCRIPTION--
If you are adding a mapping to a sequence, you
can place the mapping on the same line as the
dash as a shortcut.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('- work on YAML.py:
- work on Store
'));
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
["work on YAML.py"]=>
array(1) {
[0]=>
string(13) "work on Store"
}
}
}
PK ;��Z�� . tests/yaml_parse_wiki_YtsBlockMapping_003.phptnu �[��� --TEST--
Yaml YtsBlockMapping - Values aligned
--DESCRIPTION--
Often times human editors of documents will align the values even
though YAML emitters generally don't.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
red: baron
white: walls
blue: berries
'));
?>
--EXPECT--
array(3) {
["red"]=>
string(5) "baron"
["white"]=>
string(5) "walls"
["blue"]=>
string(7) "berries"
}
PK ;��Z]A�� � * tests/yaml_parse_wiki_YtsMapInSeq_002.phptnu �[��� --TEST--
Yaml YtsMapInSeq - Multiple keys
--DESCRIPTION--
Test a map with multiple keys.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
- foo: bar
baz: bug
'));
?>
--EXPECT--
array(1) {
[0]=>
array(2) {
["foo"]=>
string(3) "bar"
["baz"]=>
string(3) "bug"
}
}
PK ;��Z(�#m� � tests/bug_60628.phptnu �[��� --TEST--
Test PECL bug #260628
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$data = <<<YAML
#yaml
---
data: !mytag
- look upper
...
YAML;
function tag_callback ($value, $tag, $flags) {
echo "-- callback value --\n";
var_dump($value);
var_dump($tag);
var_dump($flags);
echo "-- end callback value --\n";
return array(
'data' => $value,
'another' => 'test',
);
}
/* baseline. do like operation in native php. */
$native = array(
"data" => array("look upper"),
);
$native["data"] = tag_callback($native["data"], "!mytag", 0);
echo "-- native value --\n";
var_dump($native);
echo "-- end native value --\n";
$cnt = null;
$array = yaml_parse($data, 0, $cnt, array(
'!mytag' => 'tag_callback',
));
echo "-- parsed value --\n";
var_dump($array);
echo "-- end parsed value --\n";
?>
--EXPECT--
-- callback value --
array(1) {
[0]=>
string(10) "look upper"
}
string(6) "!mytag"
int(0)
-- end callback value --
-- native value --
array(1) {
["data"]=>
array(2) {
["data"]=>
array(1) {
[0]=>
string(10) "look upper"
}
["another"]=>
string(4) "test"
}
}
-- end native value --
-- callback value --
array(1) {
[0]=>
string(10) "look upper"
}
string(6) "!mytag"
int(0)
-- end callback value --
-- parsed value --
array(1) {
["data"]=>
array(2) {
["data"]=>
array(1) {
[0]=>
string(10) "look upper"
}
["another"]=>
string(4) "test"
}
}
-- end parsed value --
PK ;��Z�� tests/yaml_parse_spec_omap.phptnu �[��� --TEST--
Yaml 1.1 Spec - omap
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
# Explicitly typed ordered map (dictionary).
Bestiary: !!omap
- aardvark: African pig-like ant eater. Ugly.
- anteater: South-American ant eater. Two species.
- anaconda: South-American constrictor snake. Scaly.
# Etc.
# Flow style
Numbers: !!omap [ one: 1, two: 2, three : 3 ]
'));
?>
--EXPECT--
array(2) {
["Bestiary"]=>
array(3) {
[0]=>
array(1) {
["aardvark"]=>
string(33) "African pig-like ant eater. Ugly."
}
[1]=>
array(1) {
["anteater"]=>
string(38) "South-American ant eater. Two species."
}
[2]=>
array(1) {
["anaconda"]=>
string(40) "South-American constrictor snake. Scaly."
}
}
["Numbers"]=>
array(3) {
[0]=>
array(1) {
["one"]=>
int(1)
}
[1]=>
array(1) {
["two"]=>
int(2)
}
[2]=>
array(1) {
["three"]=>
int(3)
}
}
}
PK ;��Z��� � tests/yaml_parse_005.phptnu �[��� --TEST--
yaml_parse - syck bug #12656
--CREDITS--
From syck bug #12656
http://pecl.php.net/bugs/bug.php?id=12656
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
models : [ /usr/home/enovodk/data/core/easyworks/current/models/ ]
behaviors : [
/usr/home/enovodk/data/core/easyworks/current/models/behaviors/ ]
controllers : [
/usr/home/enovodk/data/core/easyworks/current/controllers/ ]
components : [
/usr/home/enovodk/data/core/easyworks/current/controllers/components/ ]
apis : [ /usr/home/enovodk/data/core/easyworks/current/controllers/api/
]
views : [ /usr/home/enovodk/data/core/easyworks/current/views/ ]
helpers : [ /usr/home/enovodk/data/core/easyworks/current/views/helpers/
]
libs : [ /usr/home/enovodk/data/core/easyworks/current/libs/ ]
plugins : [ /usr/home/enovodk/data/core/easyworks/current/plugins/ ]
'));
?>
--EXPECT--
array(9) {
["models"]=>
array(1) {
[0]=>
string(53) "/usr/home/enovodk/data/core/easyworks/current/models/"
}
["behaviors"]=>
array(1) {
[0]=>
string(63) "/usr/home/enovodk/data/core/easyworks/current/models/behaviors/"
}
["controllers"]=>
array(1) {
[0]=>
string(58) "/usr/home/enovodk/data/core/easyworks/current/controllers/"
}
["components"]=>
array(1) {
[0]=>
string(69) "/usr/home/enovodk/data/core/easyworks/current/controllers/components/"
}
["apis"]=>
array(1) {
[0]=>
string(62) "/usr/home/enovodk/data/core/easyworks/current/controllers/api/"
}
["views"]=>
array(1) {
[0]=>
string(52) "/usr/home/enovodk/data/core/easyworks/current/views/"
}
["helpers"]=>
array(1) {
[0]=>
string(60) "/usr/home/enovodk/data/core/easyworks/current/views/helpers/"
}
["libs"]=>
array(1) {
[0]=>
string(51) "/usr/home/enovodk/data/core/easyworks/current/libs/"
}
["plugins"]=>
array(1) {
[0]=>
string(54) "/usr/home/enovodk/data/core/easyworks/current/plugins/"
}
}
PK ;��Z^ 4K� � tests/yaml_parse_002.phptnu �[��� --TEST--
yaml_parse - multiple documents
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
---
time: !!str 20:03:20
player: Sammy Sosa
action: strike (miss)
...
%YAML 1.1
---
time: "20:03:47"
player: Sammy Sosa
action: grand slam
...
', -1));
?>
--EXPECT--
array(2) {
[0]=>
array(3) {
["time"]=>
string(8) "20:03:20"
["player"]=>
string(10) "Sammy Sosa"
["action"]=>
string(13) "strike (miss)"
}
[1]=>
array(3) {
["time"]=>
string(8) "20:03:47"
["player"]=>
string(10) "Sammy Sosa"
["action"]=>
string(10) "grand slam"
}
}
PK ;��Z�k&� � ! tests/yaml_parse_spec_binary.phptnu �[��� --TEST--
Yaml 1.1 Spec - binary
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
if(!function_exists('md5')) die('skip md5 unavailable');
?>
--INI--
yaml.decode_binary=1
--FILE--
<?php
$y = yaml_parse('
canonical: !!binary "\
R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
generic: !!binary |
R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
description:
The binary value above is a tiny arrow encoded as a gif image.
');
var_dump($y['canonical'] === $y['generic']);
var_dump(md5($y['canonical']));
?>
--EXPECT--
bool(true)
string(32) "a8363b3d0e4e39d9e77e244e216c7840"
PK ;��Z�Vc�Y Y tests/yaml_emit_005.phptnu �[��� --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;}"
...
"
PK ;��Zc�m�� � tests/bug_64019.phptnu �[��� --TEST--
Test PECL bug #64019
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$yaml_code = <<<YAML
configAnchors:
- &wrongAnchor: # This last colon (:) makes the script die
configKey: configValue
config:
<<: *wrongAnchor
YAML;
var_dump(yaml_parse($yaml_code));
$yaml_code = <<<YAML
config:
<<:
YAML;
var_dump(yaml_parse($yaml_code));
?>
--EXPECT--
array(2) {
["configAnchors"]=>
array(1) {
[0]=>
array(2) {
[""]=>
NULL
["configKey"]=>
string(11) "configValue"
}
}
["config"]=>
array(1) {
["<<"]=>
NULL
}
}
array(1) {
["config"]=>
array(1) {
["<<"]=>
NULL
}
}
PK ;��Z`�F� � * tests/yaml_parse_wiki_YtsMapInSeq_001.phptnu �[��� --TEST--
Yaml YtsMapInSeq - Single key
--DESCRIPTION--
Test maps with just one key.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
- foo: bar
- baz: bug
'));
?>
--EXPECT--
array(2) {
[0]=>
array(1) {
["foo"]=>
string(3) "bar"
}
[1]=>
array(1) {
["baz"]=>
string(3) "bug"
}
}
PK ;��Ze��M� � tests/bug_72204.phptnu �[��� --TEST--
Test PECL bug #72204
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$yaml_code = <<<YAML
foo: &ref
bar: true
baz: &ref2
<<: *ref
bar: false
YAML;
$yaml = yaml_parse($yaml_code);
var_dump($yaml);
?>
--EXPECT--
array(2) {
["foo"]=>
array(1) {
["bar"]=>
bool(true)
}
["baz"]=>
array(1) {
["bar"]=>
bool(false)
}
}
PK ;��Z�!�z z tests/yaml_parse_spec_set.phptnu �[��� --TEST--
Yaml 1.1 Spec - set
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('baseball players: !!set
? Mark McGwire
? Sammy Sosa
? Ken Griffey
'));
?>
--EXPECT--
array(1) {
["baseball players"]=>
array(3) {
["Mark McGwire"]=>
NULL
["Sammy Sosa"]=>
NULL
["Ken Griffey"]=>
NULL
}
}
PK ;��Z�� � tests/yaml_emit_006.phptnu �[��� --TEST--
yaml_emit - ini settings
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
?>
--INI--
yaml.output_canonical=0
yaml.output_indent=2
yaml.output_width=80
serialize_precision=-1
--FILE--
<?php
$addr = array(
"given" => "Chris",
"family"=> "Dumars",
"address"=> array(
"lines"=> "458 Walkman Dr.
Suite #292",
"city"=> "Royal Oak",
"state"=> "MI",
"postal"=> 48046,
),
);
$invoice = array (
"invoice"=> 34843,
"date"=> 980208000,
"bill-to"=> $addr,
"ship-to"=> $addr,
"product"=> array(
array(
"sku"=> "BL394D",
"quantity"=> 4,
"description"=> "Basketball",
"price"=> 450,
),
array(
"sku"=> "BL4438H",
"quantity"=> 1,
"description"=> "Super Hoop",
"price"=> 2392,
),
),
"tax"=> 251.42,
"total"=> 4443.52,
"comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.",
);
var_dump(yaml_emit($invoice));
ini_set("yaml.output_canonical", "1");
ini_set("yaml.output_indent", "4");
ini_set("yaml.output_width", "40");
echo "== CANONICAL ==\n";
var_dump(yaml_emit($invoice));
?>
--EXPECT--
string(620) "---
invoice: 34843
date: 980208000
bill-to:
given: Chris
family: Dumars
address:
lines: |-
458 Walkman Dr.
Suite #292
city: Royal Oak
state: MI
postal: 48046
ship-to:
given: Chris
family: Dumars
address:
lines: |-
458 Walkman Dr.
Suite #292
city: Royal Oak
state: MI
postal: 48046
product:
- sku: BL394D
quantity: 4
description: Basketball
price: 450
- sku: BL4438H
quantity: 1
description: Super Hoop
price: 2392
tax: 251.42
total: 4443.52
comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.
...
"
== CANONICAL ==
string(1822) "---
!!map {
? !!str "invoice"
: !!int "34843",
? !!str "date"
: !!int "980208000",
? !!str "bill-to"
: !!map {
? !!str "given"
: !!str "Chris",
? !!str "family"
: !!str "Dumars",
? !!str "address"
: !!map {
? !!str "lines"
: !!str "458 Walkman Dr.\n Suite
#292",
? !!str "city"
: !!str "Royal Oak",
? !!str "state"
: !!str "MI",
? !!str "postal"
: !!int "48046",
},
},
? !!str "ship-to"
: !!map {
? !!str "given"
: !!str "Chris",
? !!str "family"
: !!str "Dumars",
? !!str "address"
: !!map {
? !!str "lines"
: !!str "458 Walkman Dr.\n Suite
#292",
? !!str "city"
: !!str "Royal Oak",
? !!str "state"
: !!str "MI",
? !!str "postal"
: !!int "48046",
},
},
? !!str "product"
: !!seq [
!!map {
? !!str "sku"
: !!str "BL394D",
? !!str "quantity"
: !!int "4",
? !!str "description"
: !!str "Basketball",
? !!str "price"
: !!int "450",
},
!!map {
? !!str "sku"
: !!str "BL4438H",
? !!str "quantity"
: !!int "1",
? !!str "description"
: !!str "Super Hoop",
? !!str "price"
: !!int "2392",
},
],
? !!str "tax"
: !!float "251.42",
? !!str "total"
: !!float "4443.52",
? !!str "comments"
: !!str "Late afternoon is best. Backup
contact is Nancy Billsmer @ 338-4338.",
}
...
"
PK ;��Z��Ҟ � tests/yaml_parse_spec_pairs.phptnu �[��� --TEST--
Yaml 1.1 Spec - pairs
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
# Explicitly typed pairs.
Block tasks: !!pairs
- meeting: with team.
- meeting: with boss.
- break: lunch.
- meeting: with client.
Flow tasks: !!pairs [ meeting: with team, meeting: with boss ]
'));
?>
--EXPECT--
array(2) {
["Block tasks"]=>
array(4) {
[0]=>
array(1) {
["meeting"]=>
string(10) "with team."
}
[1]=>
array(1) {
["meeting"]=>
string(10) "with boss."
}
[2]=>
array(1) {
["break"]=>
string(6) "lunch."
}
[3]=>
array(1) {
["meeting"]=>
string(12) "with client."
}
}
["Flow tasks"]=>
array(2) {
[0]=>
array(1) {
["meeting"]=>
string(9) "with team"
}
[1]=>
array(1) {
["meeting"]=>
string(9) "with boss"
}
}
}
PK ;��Z��&Q Q tests/yaml_001.phptnu �[��� --TEST--
yaml - emit -> parse roundtrip
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$addr = array(
"given" => "Chris",
"family"=> "Dumars",
"address"=> array(
"lines"=> "458 Walkman Dr.
Suite #292",
"city"=> "Royal Oak",
"state"=> "MI",
"postal"=> 48046,
),
);
$invoice = array (
"invoice"=> 34843,
"date"=> 980208000,
"bill-to"=> $addr,
"ship-to"=> $addr,
"product"=> array(
array(
"sku"=> "BL394D",
"quantity"=> 4,
"description"=> "Basketball",
"price"=> 450,
),
array(
"sku"=> "BL4438H",
"quantity"=> 1,
"description"=> "Super Hoop",
"price"=> 2392,
),
),
"tax"=> 251.42,
"total"=> 4443.52,
"comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.",
"tags" => array("a","b","c"),
);
$yaml = yaml_emit($invoice);
$parsed = yaml_parse($yaml);
var_dump($parsed == $invoice);
?>
--EXPECT--
bool(true)
PK ;��Z�|� � tests/yaml_parse_spec_map.phptnu �[��� --TEST--
Yaml 1.1 Spec - map
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
# Unordered set of key: value pairs.
Block style: !!map
Clark : Evans
Brian : Ingerson
Oren : Ben-Kiki
Flow style: !!map { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki }
'));
?>
--EXPECT--
array(2) {
["Block style"]=>
array(3) {
["Clark"]=>
string(5) "Evans"
["Brian"]=>
string(8) "Ingerson"
["Oren"]=>
string(8) "Ben-Kiki"
}
["Flow style"]=>
array(3) {
["Clark"]=>
string(5) "Evans"
["Brian"]=>
string(8) "Ingerson"
["Oren"]=>
string(8) "Ben-Kiki"
}
}
PK ;��Z�t�a a tests/bug_79494.phptnu �[��� --TEST--
Test PECL bug #74949
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
$data = array (
'audio' =>
array (
'audioEnabled' =>
array (
0 => 132317787432502136,
1 => 0,
),
'eveampGain' =>
array (
0 => 132316833510704299,
1 => 0.25,
),
),
);
print yaml_emit($data);
?>
--EXPECTF--
---
audio:
audioEnabled:
- %r(132317787432502136|1\.3231778743250214E\+17)%r
- 0
eveampGain:
- %r(132316833510704299|1\.323168335107043E\+17)%r
- 0.25
...
PK ;��Z�L�+K K tests/bug_79567.phptnu �[��� --TEST--
Test PECL bug #79567
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$data = [
'audioEnabled' => [
0 => 132317787432502136,
1 => 0,
],
];
$yaml = yaml_emit($data);
$result = yaml_parse($yaml);
print $result == $data ? "Yes!\n" : "No...\n";
?>
--EXPECT--
Yes!
PK ;��Z?i��t t tests/bug_59860.phptnu �[��� --TEST--
Test PECL bug #59860
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
/**
* Parsing callback for yaml tag.
* @param mixed $value Data from yaml file
* @param string $tag Tag that triggered callback
* @param int $flags Scalar entity style (see YAML_*_SCALAR_STYLE)
* @return mixed Value that YAML parser should emit for the given value
*/
function tag_callback ($value, $tag, $flags) {
var_dump(func_get_args());
return $tag;
}
$yaml = <<<YAML
implicit_map:
a: b
explicit_map: !!map
c: d
implicit_seq: [e, f]
explicit_seq: !!seq [g, h]
YAML;
yaml_parse($yaml, 0, $ndocs, array(
YAML_MAP_TAG => 'tag_callback',
YAML_SEQ_TAG => 'tag_callback',
));
?>
--EXPECT--
array(3) {
[0]=>
array(1) {
["a"]=>
string(1) "b"
}
[1]=>
string(21) "tag:yaml.org,2002:map"
[2]=>
int(0)
}
array(3) {
[0]=>
array(1) {
["c"]=>
string(1) "d"
}
[1]=>
string(21) "tag:yaml.org,2002:map"
[2]=>
int(0)
}
array(3) {
[0]=>
array(2) {
[0]=>
string(1) "e"
[1]=>
string(1) "f"
}
[1]=>
string(21) "tag:yaml.org,2002:seq"
[2]=>
int(0)
}
array(3) {
[0]=>
array(2) {
[0]=>
string(1) "g"
[1]=>
string(1) "h"
}
[1]=>
string(21) "tag:yaml.org,2002:seq"
[2]=>
int(0)
}
array(3) {
[0]=>
array(4) {
["implicit_map"]=>
string(21) "tag:yaml.org,2002:map"
["explicit_map"]=>
string(21) "tag:yaml.org,2002:map"
["implicit_seq"]=>
string(21) "tag:yaml.org,2002:seq"
["explicit_seq"]=>
string(21) "tag:yaml.org,2002:seq"
}
[1]=>
string(21) "tag:yaml.org,2002:map"
[2]=>
int(0)
}
PK ;��ZJ��� tests/bug_61770.phptnu �[��� --TEST--
Test PECL bug #61770
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_emit("\xc2"));
?>
--EXPECTF--
Warning: yaml_emit(): Invalid UTF-8 sequence in argument in %sbug_61770.php on line 2
bool(false)
PK ;��Z6K��7 7 tests/yaml_parse_url_001.phptnu �[��� --TEST--
yaml_parse_url - general
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_timestamp=1
date.timezone=GMT
--FILE--
<?php
var_dump(yaml_parse_url('file://' . __DIR__ . '/yaml_parse_file_001.yaml'));
?>
--EXPECT--
array(8) {
["invoice"]=>
int(34843)
["date"]=>
int(980208000)
["bill-to"]=>
&array(3) {
["given"]=>
string(5) "Chris"
["family"]=>
string(6) "Dumars"
["address"]=>
array(4) {
["lines"]=>
string(27) "458 Walkman Dr.
Suite #292
"
["city"]=>
string(9) "Royal Oak"
["state"]=>
string(2) "MI"
["postal"]=>
int(48046)
}
}
["ship-to"]=>
&array(3) {
["given"]=>
string(5) "Chris"
["family"]=>
string(6) "Dumars"
["address"]=>
array(4) {
["lines"]=>
string(27) "458 Walkman Dr.
Suite #292
"
["city"]=>
string(9) "Royal Oak"
["state"]=>
string(2) "MI"
["postal"]=>
int(48046)
}
}
["product"]=>
array(2) {
[0]=>
array(4) {
["sku"]=>
string(6) "BL394D"
["quantity"]=>
int(4)
["description"]=>
string(10) "Basketball"
["price"]=>
float(450)
}
[1]=>
array(4) {
["sku"]=>
string(7) "BL4438H"
["quantity"]=>
int(1)
["description"]=>
string(10) "Super Hoop"
["price"]=>
float(2392)
}
}
["tax"]=>
float(251.42)
["total"]=>
float(4443.52)
["comments"]=>
string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
}
PK ;��Z1M�� � tests/bug_80324.phptnu �[��� --TEST--
Bug #80324 (Segfault in YAML with anonymous functions)
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$yaml = <<<YAML
- !env ENV
- !path PATH
YAML;
$result = yaml_parse($yaml, 0, $ndocs, array(
'!env' => function ($str) {return $str;},
'!path' => function ($str) {return $str;},
));
var_dump($result);
?>
--EXPECT--
array(2) {
[0]=>
string(3) "ENV"
[1]=>
string(4) "PATH"
}
PK ;��Z-0� � tests/bug_61923.phptnu �[��� --TEST--
Test PECL bug #61923
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
$yaml_code = <<<YAML
---
strings:
- '1:0'
- '0:1'
- '1:0:0'
- '+1:0:0'
- '-1:0:0'
- ':01'
- ':1'
- '18:53:17.00037'
numbers:
- 1:0
- 0:1
- 1:0:0
- +1:0:0
- -1:0:0
- :01
- :1
- 18:53:17.00037
YAML;
$parsed = yaml_parse($yaml_code);
var_dump($parsed);
var_dump(yaml_emit($parsed));
?>
--EXPECT--
array(2) {
["strings"]=>
array(8) {
[0]=>
string(3) "1:0"
[1]=>
string(3) "0:1"
[2]=>
string(5) "1:0:0"
[3]=>
string(6) "+1:0:0"
[4]=>
string(6) "-1:0:0"
[5]=>
string(3) ":01"
[6]=>
string(2) ":1"
[7]=>
string(14) "18:53:17.00037"
}
["numbers"]=>
array(8) {
[0]=>
int(60)
[1]=>
int(1)
[2]=>
int(3600)
[3]=>
int(3600)
[4]=>
int(-3600)
[5]=>
int(1)
[6]=>
int(1)
[7]=>
float(67997.00037)
}
}
string(161) "---
strings:
- "1:0"
- "0:1"
- "1:0:0"
- "+1:0:0"
- "-1:0:0"
- ":01"
- ":1"
- "18:53:17.00037"
numbers:
- 60
- 1
- 3600
- 3600
- -3600
- 1
- 1
- 67997.00037
...
"
PK ;��ZuT�� � tests/bug_64694.phptnu �[��� --TEST--
Test PECL bug #64694
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$yaml_code = <<<YAML
"[a]": 1
YAML;
var_dump(yaml_parse($yaml_code));
$yaml_code = <<<YAML
[a]: 1
YAML;
var_dump(yaml_parse($yaml_code));
?>
--EXPECTF--
array(1) {
["[a]"]=>
int(1)
}
Warning: yaml_parse(): Illegal offset type array (line 1, column 7) in %sbug_64694.php on line 12
array(0) {
}
PK ;��Z�: : tests/bug_69617.phptnu �[��� --TEST--
Test PECL bug #69617
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$yaml_code = <<<YAML
---
a: !php/object "O:1:\"A\":1:{s:3:\"one\";i:1;}"
...
YAML;
var_dump(yaml_parse($yaml_code));
?>
--EXPECT--
array(1) {
["a"]=>
string(26) "O:1:"A":1:{s:3:"one";i:1;}"
}
PK ;��Z�9V� � $ tests/yaml_parse_spec_timestamp.phptnu �[��� --TEST--
Yaml 1.1 Spec - timestamp
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_timestamp=1
date.timezone=GMT
--FILE--
<?php
var_dump(yaml_parse('
canonical: 2001-12-15T02:59:43.1Z
valid iso8601: 2001-12-14t21:59:43.10-05:00
alternate iso8601: 2001-12-14T21:59:43.10-0500
space separated: 2001-12-14 21:59:43.10 -5
no time zone (Z): 2001-12-15 2:59:43.10
date (00:00:00Z): 2002-12-14
'));
?>
--EXPECT--
array(6) {
["canonical"]=>
int(1008385183)
["valid iso8601"]=>
int(1008385183)
["alternate iso8601"]=>
int(1008385183)
["space separated"]=>
int(1008385183)
["no time zone (Z)"]=>
int(1008385183)
["date (00:00:00Z)"]=>
int(1039824000)
}
PK ;��Z3iM_� � tests/bug_21995.phptnu �[��� --TEST--
Test PECL bug #21995
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
function yaml_cbk ($a) {
var_dump($a);
return $a;
}
$yaml_code = <<<YAML
boo: doo
a: [1,2,3,4]
d: []
YAML;
$yaml = yaml_parse($yaml_code, 0, $ndocs, array(
YAML_STR_TAG => "yaml_cbk",
));
?>
--EXPECT--
string(3) "boo"
string(3) "doo"
string(1) "a"
string(1) "d"
PK ;��Z1_R�* * tests/yaml_parse_file_001.phptnu �[��� --TEST--
yaml_parse_file - general
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_timestamp=1
date.timezone=GMT
--FILE--
<?php
var_dump(yaml_parse_file(__DIR__ . '/yaml_parse_file_001.yaml'));
--EXPECT--
array(8) {
["invoice"]=>
int(34843)
["date"]=>
int(980208000)
["bill-to"]=>
&array(3) {
["given"]=>
string(5) "Chris"
["family"]=>
string(6) "Dumars"
["address"]=>
array(4) {
["lines"]=>
string(27) "458 Walkman Dr.
Suite #292
"
["city"]=>
string(9) "Royal Oak"
["state"]=>
string(2) "MI"
["postal"]=>
int(48046)
}
}
["ship-to"]=>
&array(3) {
["given"]=>
string(5) "Chris"
["family"]=>
string(6) "Dumars"
["address"]=>
array(4) {
["lines"]=>
string(27) "458 Walkman Dr.
Suite #292
"
["city"]=>
string(9) "Royal Oak"
["state"]=>
string(2) "MI"
["postal"]=>
int(48046)
}
}
["product"]=>
array(2) {
[0]=>
array(4) {
["sku"]=>
string(6) "BL394D"
["quantity"]=>
int(4)
["description"]=>
string(10) "Basketball"
["price"]=>
float(450)
}
[1]=>
array(4) {
["sku"]=>
string(7) "BL4438H"
["quantity"]=>
int(1)
["description"]=>
string(10) "Super Hoop"
["price"]=>
float(2392)
}
}
["tax"]=>
float(251.42)
["total"]=>
float(4443.52)
["comments"]=>
string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
}
PK ;��Zq<>�
�
tests/yaml_parse_001.phptnu �[��� --TEST--
yaml_parse - general
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_timestamp=1
date.timezone=GMT
--FILE--
<?php
var_dump(yaml_parse('
--- !<tag:clarkevans.com,2002:invoice>
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292
city : Royal Oak
state : MI
postal : 48046
ship-to: *id001
product:
- sku : BL394D
quantity : 4
description : Basketball
price : 450.00
- sku : BL4438H
quantity : 1
description : Super Hoop
price : 2392.00
tax : 251.42
total: 4443.52
comments:
Late afternoon is best.
Backup contact is Nancy
Billsmer @ 338-4338.
'));
var_dump(yaml_parse('
---
Time: 2001-11-23 15:01:42 -5
User: ed
Warning:
This is an error message
for the log file
---
Time: 2001-11-23 15:02:31 -5
User: ed
Warning:
A slightly different error
message.
---
Date: 2001-11-23 15:03:17 -5
User: ed
Fatal:
Unknown variable "bar"
Stack:
- file: TopClass.py
line: 23
code: |
x = MoreObject("345\n")
- file: MoreClass.py
line: 58
code: |-
foo = bar
', -1));
?>
--EXPECT--
array(8) {
["invoice"]=>
int(34843)
["date"]=>
int(980208000)
["bill-to"]=>
&array(3) {
["given"]=>
string(5) "Chris"
["family"]=>
string(6) "Dumars"
["address"]=>
array(4) {
["lines"]=>
string(27) "458 Walkman Dr.
Suite #292
"
["city"]=>
string(9) "Royal Oak"
["state"]=>
string(2) "MI"
["postal"]=>
int(48046)
}
}
["ship-to"]=>
&array(3) {
["given"]=>
string(5) "Chris"
["family"]=>
string(6) "Dumars"
["address"]=>
array(4) {
["lines"]=>
string(27) "458 Walkman Dr.
Suite #292
"
["city"]=>
string(9) "Royal Oak"
["state"]=>
string(2) "MI"
["postal"]=>
int(48046)
}
}
["product"]=>
array(2) {
[0]=>
array(4) {
["sku"]=>
string(6) "BL394D"
["quantity"]=>
int(4)
["description"]=>
string(10) "Basketball"
["price"]=>
float(450)
}
[1]=>
array(4) {
["sku"]=>
string(7) "BL4438H"
["quantity"]=>
int(1)
["description"]=>
string(10) "Super Hoop"
["price"]=>
float(2392)
}
}
["tax"]=>
float(251.42)
["total"]=>
float(4443.52)
["comments"]=>
string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
}
array(3) {
[0]=>
array(3) {
["Time"]=>
int(1006545702)
["User"]=>
string(2) "ed"
["Warning"]=>
string(41) "This is an error message for the log file"
}
[1]=>
array(3) {
["Time"]=>
int(1006545751)
["User"]=>
string(2) "ed"
["Warning"]=>
string(35) "A slightly different error message."
}
[2]=>
array(4) {
["Date"]=>
int(1006545797)
["User"]=>
string(2) "ed"
["Fatal"]=>
string(22) "Unknown variable "bar""
["Stack"]=>
array(2) {
[0]=>
array(3) {
["file"]=>
string(11) "TopClass.py"
["line"]=>
int(23)
["code"]=>
string(24) "x = MoreObject("345\n")
"
}
[1]=>
array(3) {
["file"]=>
string(12) "MoreClass.py"
["line"]=>
int(58)
["code"]=>
string(9) "foo = bar"
}
}
}
}
PK ;��ZE�#
tests/bug_74799.yamlnu �[��� ---
key:
!value
...PK ;��Z��. . tests/yaml_parse_file_002.phptnu �[��� --TEST--
yaml_parse_file - error cases
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_timestamp=1
date.timezone=GMT
; E_ALL - E_DEPRECATED to hide Deprecated: yaml_parse_file(): Passing null to parameter #1...
error_reporting=24575
--FILE--
<?php
try {
// PHP7 emits a Warning here
yaml_parse_file(NULL);
} catch (ValueError $e) {
// PHP8 raises this exception
echo "\nWarning: yaml_parse_file(): {$e->getMessage()} in " . __FILE__ . " on line 4\n";
}
try {
// PHP7 emits a Warning here
yaml_parse_file('');
} catch (ValueError $e) {
// PHP8 raises this exception
echo "\nWarning: yaml_parse_file(): {$e->getMessage()} in " . __FILE__ . " on line 11\n";
}
yaml_parse_file('invalid');
try {
// PHP7 emits a Warning here
yaml_parse_file();
} catch (ArgumentCountError $e) {
// PHP8 raises this exception
echo "\nWarning: {$e->getMessage()} in " . __FILE__ . " on line 19\n";
}
--EXPECTF--
Warning: yaml_parse_file(): %r(Filename|Path)%r cannot be empty in %s on line %d
Warning: yaml_parse_file(): %r(Filename|Path)%r cannot be empty in %s on line %d
Warning: yaml_parse_file(invalid): %r[Ff]%railed to open stream: No such file or directory in %s on line %d
Warning: yaml_parse_file() expects at least 1 %r(argument|parameter)%r, 0 given in %s on line %d
PK ;��Z��� , tests/yaml_parse_wiki_YtsBasicTests_001.phptnu �[��� --TEST--
Yaml YtsBasicTests - Simple Sequence
--DESCRIPTION--
You can specify a list in YAML by placing each
member of the list on a new line with an opening
dash. These lists are called sequences.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('- apple
- banana
- carrot
'));
?>
--EXPECT--
array(3) {
[0]=>
string(5) "apple"
[1]=>
string(6) "banana"
[2]=>
string(6) "carrot"
}
PK ;��Z�M 5� � tests/yaml_parse_007.phptnu �[��� --TEST--
yaml_parse - serializable
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
?>
--INI--
yaml.decode_php=1
--FILE--
<?php
class A {
public $one = 1;
public function show_one() {
echo $this->one;
}
}
var_dump(yaml_parse('
---
a: !php/object "O:1:\"A\":1:{s:3:\"one\";i:1;}"
...
'));
?>
--EXPECTF--
array(1) {
["a"]=>
object(A)#%d (1) {
["one"]=>
int(1)
}
}
PK ;��Z�:��| | tests/yaml_emit_file_basic.phptnu �[��� --TEST--
Test Github pull request #1
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
$addr = array(
"given" => "Chris",
"family"=> "Dumars",
"address"=> array(
"lines"=> "458 Walkman Dr.
Suite #292",
"city"=> "Royal Oak",
"state"=> "MI",
"postal"=> 48046,
),
);
$invoice = array (
"invoice"=> 34843,
"date"=> 980208000,
"bill-to"=> $addr,
"ship-to"=> $addr,
"product"=> array(
array(
"sku"=> "BL394D",
"quantity"=> 4,
"description"=> "Basketball",
"price"=> 450,
),
array(
"sku"=> "BL4438H",
"quantity"=> 1,
"description"=> "Super Hoop",
"price"=> 2392,
),
),
"tax"=> 251.42,
"total"=> 4443.52,
"comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.",
);
$temp_filename = dirname(__FILE__) . 'yaml_emit_file_basic.tmp';
var_dump(yaml_emit_file($temp_filename, $invoice));
var_dump(file_get_contents($temp_filename));
?>
--CLEAN--
<?php
$temp_filename = dirname(__FILE__) . 'yaml_emit_file_basic.tmp';
unlink($temp_filename);
?>
--EXPECT--
bool(true)
string(620) "---
invoice: 34843
date: 980208000
bill-to:
given: Chris
family: Dumars
address:
lines: |-
458 Walkman Dr.
Suite #292
city: Royal Oak
state: MI
postal: 48046
ship-to:
given: Chris
family: Dumars
address:
lines: |-
458 Walkman Dr.
Suite #292
city: Royal Oak
state: MI
postal: 48046
product:
- sku: BL394D
quantity: 4
description: Basketball
price: 450
- sku: BL4438H
quantity: 1
description: Super Hoop
price: 2392
tax: 251.42
total: 4443.52
comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.
...
"
PK ;��Zw7j j . tests/yaml_parse_wiki_YtsBlockMapping_001.phptnu �[��� --TEST--
Yaml YtsBlockMapping - One Element Mapping
--DESCRIPTION--
A mapping with one key/value pair
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
foo: bar
'));
?>
--EXPECT--
array(1) {
["foo"]=>
string(3) "bar"
}
PK ;��Z#��� � tests/yaml_emit_009.phptnu �[��� --TEST--
yaml_emit - custom tags with closures
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
if (version_compare(PHP_VERSION, '5.3.0', '<')) die('skip Closure unsupported');
?>
--FILE--
<?php
$emit_callbacks = array(
'Emit009Example' => function ($o) {
return array(
'tag' => '!emit009',
'data' => $o->data,
);
},
);
class Emit009Example {
public $data; // data may be in any pecl/yaml suitable type
}
$t = new Emit009Example();
$t->data = array ('a','b','c');
$yaml = yaml_emit(
array(
'callback' => $t,
),
YAML_ANY_ENCODING,
YAML_ANY_BREAK,
$emit_callbacks
);
var_dump($yaml);
/* make sure you can undo the custome serialization */
function parse_009 ($value, $tag, $flags) {
$ret = new Emit009Example();
$ret->data = $value;
return $ret;
}
$parse_callbacks = array(
'!emit009' => 'parse_009',
);
$array = yaml_parse($yaml, 0, $cnt, $parse_callbacks);
var_dump($array['callback'] == $t);
/* roundtrip with raw object */
var_dump($t == yaml_parse(
yaml_emit($t, YAML_ANY_ENCODING, YAML_ANY_BREAK, $emit_callbacks),
0, $cnt, $parse_callbacks));
?>
--EXPECT--
string(39) "---
callback: !emit009
- a
- b
- c
...
"
bool(true)
bool(true)
PK ;��Z���� � tests/bug_79866.phptnu �[��� --TEST--
Test PECL bug #79866
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
precision=14
serialize_precision=-1
--FILE--
<?php
$floats = [
"0" => 0,
"1" => 1,
"-1" => -1,
"2." => 2.,
"2.0" => 2.0,
"2.00" => 2.00,
"2.000" => 2.000,
"0.123456789" => 0.123456789,
"-0.123456789" => -0.123456789,
"2.3e6" => 2.3e6,
"-2.3e6" => -2.3e6,
"2.3e-6" => 2.3e-6,
"-2.3e-6" => -2.3e-6,
"INF" => INF,
"NAN" => NAN,
"0.000021" => 0.000021,
];
foreach( $floats as $idx => $float ) {
$float = floatval($float);
ob_start();
echo $float;
$native = ob_get_clean();
$expect = "--- {$native}\n...\n";
$got = yaml_emit($float);
if ( $got !== $expect ) {
echo "== FAIL! {$idx} ==\n";
echo "expected:\n{$expect}\n";
echo "got:{$got}\n";
}
}
?>
--EXPECT--
PK ;��Zw�b� , tests/yaml_parse_wiki_YtsBasicTests_002.phptnu �[��� --TEST--
Yaml YtsBasicTests - Nested Sequences
--DESCRIPTION--
You can include a sequence within another
sequence by giving the sequence an empty
dash, followed by an indented list.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('-
- foo
- bar
- baz
'));
?>
--EXPECT--
array(1) {
[0]=>
array(3) {
[0]=>
string(3) "foo"
[1]=>
string(3) "bar"
[2]=>
string(3) "baz"
}
}
PK ;��Z�[#d� � , tests/yaml_parse_wiki_YtsBasicTests_008.phptnu �[��� --TEST--
Yaml YtsBasicTests - Mixed Mapping
--DESCRIPTION--
A mapping can contain any assortment
of mappings and sequences as values.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('foo: whatever
bar:
-
fruit: apple
name: steve
sport: baseball
- more
-
python: rocks
perl: papers
ruby: scissorses
'));
?>
--EXPECT--
array(2) {
["foo"]=>
string(8) "whatever"
["bar"]=>
array(3) {
[0]=>
array(3) {
["fruit"]=>
string(5) "apple"
["name"]=>
string(5) "steve"
["sport"]=>
string(8) "baseball"
}
[1]=>
string(4) "more"
[2]=>
array(3) {
["python"]=>
string(5) "rocks"
["perl"]=>
string(6) "papers"
["ruby"]=>
string(10) "scissorses"
}
}
}
PK ;��Z���.� � * tests/yaml_parse_wiki_YtsMapInSeq_003.phptnu �[��� --TEST--
Yaml YtsMapInSeq - Strange keys
--DESCRIPTION--
Test a map with "line noise" keys.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
- "!@#$" : foo
-+!@ : bar
'));
?>
--EXPECT--
array(1) {
[0]=>
array(2) {
["!@#$"]=>
string(3) "foo"
["-+!@"]=>
string(3) "bar"
}
}
PK ;��Z�43� � tests/yaml_emit_007.phptnu �[��� --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
...
"
PK ;��Z�X�z z tests/yaml_parse_006.phptnu �[��� --TEST--
yaml_parse - syck bug #14384
--CREDITS--
From syck bug #14384
http://pecl.php.net/bugs/bug.php?id=14384
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
"leading tab"
...
'));
var_dump(yaml_parse('---
"space and tab"
...
'));
var_dump(yaml_parse('---
"key": "tab before value"
...
'));
var_dump(yaml_parse('---
"key": "space and tab before value"
...
'));
var_dump(yaml_parse('---
- "tab before value"
...
'));
var_dump(yaml_parse('---
- "space and tab before value"
...
'));
?>
--EXPECTF--
Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 1), context while scanning for the next token (line 2, column 1) in %syaml_parse_006.php on line %d
bool(false)
Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 3), context while scanning for the next token (line 2, column 3) in %syaml_parse_006.php on line %d
bool(false)
array(1) {
["key"]=>
string(16) "tab before value"
}
array(1) {
["key"]=>
string(26) "space and tab before value"
}
Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 2), context while scanning for the next token (line 2, column 2) in %syaml_parse_006.php on line %d
bool(false)
Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 4), context while scanning for the next token (line 2, column 4) in %syaml_parse_006.php on line %d
bool(false)
PK ;��Z^
� tests/bug_72540.phptnu �[��� --TEST--
Test PECL bug #72540
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$tmpfname = tempnam(sys_get_temp_dir(), 'bug_72540.yaml');
var_dump(yaml_parse_url($tmpfname));
unlink($tmpfname);
?>
--EXPECT--
bool(false)
PK ;��ZR��G� � tests/yaml_parse_003.phptnu �[��� --TEST--
yaml_parse - parse errors
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
commercial-at: @text
'));
var_dump(yaml_parse('---
grave-accent: `text
'));
?>
--EXPECTF--
Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 16), context while scanning for the next token (line 2, column 16) in %syaml_parse_003.php on line %d
bool(false)
Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 15), context while scanning for the next token (line 2, column 15) in %syaml_parse_003.php on line %d
bool(false)
PK ;��Z$�]� tests/yaml_parse_spec_null.phptnu �[��� --TEST--
Yaml 1.1 Spec - null
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
# A document may be null.
---
---
# This mapping has four keys,
# one has a value.
empty:
canonical: ~
english: null
~: null key
---
# This sequence has five
# entries, two have values.
sparse:
- ~
- 2nd entry
-
- 4th entry
- Null
', -1));
?>
--EXPECT--
array(3) {
[0]=>
NULL
[1]=>
array(4) {
["empty"]=>
NULL
["canonical"]=>
NULL
["english"]=>
NULL
[""]=>
string(8) "null key"
}
[2]=>
array(1) {
["sparse"]=>
array(5) {
[0]=>
NULL
[1]=>
string(9) "2nd entry"
[2]=>
NULL
[3]=>
string(9) "4th entry"
[4]=>
NULL
}
}
}
PK ;��Z� o� � tests/bug_parsing_alias.phptnu �[��� --TEST--
Test PECL strange alias bug
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$yaml_code = <<<YAML
basic:
- &external {value: 22 }
keylevel0:
keylevel1:
value: 1
keylevel1.1:
keylevel2: &strange
value: 2
<<: *external
YAML;
var_dump(yaml_parse($yaml_code));
?>
--EXPECT--
array(2) {
["basic"]=>
array(1) {
[0]=>
array(1) {
["value"]=>
int(22)
}
}
["keylevel0"]=>
array(2) {
["keylevel1"]=>
array(1) {
["value"]=>
int(1)
}
["keylevel1.1"]=>
array(1) {
["keylevel2"]=>
array(1) {
["value"]=>
int(2)
}
}
}
}
PK ;��Z�9�� � tests/yaml_parse_spec_str.phptnu �[��� --TEST--
Yaml 1.1 Spec - str
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
string: abcd
'));
?>
--EXPECT--
array(1) {
["string"]=>
string(4) "abcd"
}
PK ;��Z �H-R R tests/yaml_parse_spec_merge.phptnu �[��� --TEST--
Yaml 1.1 Spec - merge
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
---
- &CENTER { x: 1, "y": 2 }
- &LEFT { x: 0, "y": 2 }
- &BIG { r: 10 }
- &SMALL { r: 1 }
# All the following maps are equal:
- # Explicit keys
x: 1
"y": 2
r: 10
label: center/big
- # Merge one map
<< : *CENTER
r: 10
label: center/big
- # Merge multiple maps
<< : [ *CENTER, *BIG ]
label: center/big
- # Override
<< : [ *BIG, *LEFT, *SMALL ]
x: 1
label: center/big
'));
?>
--EXPECT--
array(8) {
[0]=>
array(2) {
["x"]=>
int(1)
["y"]=>
int(2)
}
[1]=>
array(2) {
["x"]=>
int(0)
["y"]=>
int(2)
}
[2]=>
array(1) {
["r"]=>
int(10)
}
[3]=>
array(1) {
["r"]=>
int(1)
}
[4]=>
array(4) {
["x"]=>
int(1)
["y"]=>
int(2)
["r"]=>
int(10)
["label"]=>
string(10) "center/big"
}
[5]=>
array(4) {
["x"]=>
int(1)
["y"]=>
int(2)
["r"]=>
int(10)
["label"]=>
string(10) "center/big"
}
[6]=>
array(4) {
["x"]=>
int(1)
["y"]=>
int(2)
["r"]=>
int(10)
["label"]=>
string(10) "center/big"
}
[7]=>
array(4) {
["r"]=>
int(10)
["x"]=>
int(1)
["y"]=>
int(2)
["label"]=>
string(10) "center/big"
}
}
PK ;��Z5�jh� � tests/yaml_parse_file_001.yamlnu �[��� --- !<tag:clarkevans.com,2002:invoice>
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292
city : Royal Oak
state : MI
postal : 48046
ship-to: *id001
product:
- sku : BL394D
quantity : 4
description : Basketball
price : 450.00
- sku : BL4438H
quantity : 1
description : Super Hoop
price : 2392.00
tax : 251.42
total: 4443.52
comments:
Late afternoon is best.
Backup contact is Nancy
Billsmer @ 338-4338.
PK ;��Z��"(K1 K1 tests/bug_77720.phptnu �[��� --TEST--
Test PECL bug #77720
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
$key_laughs = <<<YAML
- &a ["lol","lol","lol","lol","lol","lol","lol","lol","lol"]
- ? &b [{*a:1},{*a:1},{*a:1},{*a:1},{*a:1},{*a:1},{*a:1},{*a:1},{*a:}] : "foo"
- ? &c [{*b:1},{*b:1},{*b:1},{*b:1},{*b:1},{*b:1},{*b:1},{*b:1},{*b:}] : "foo"
- ? &d [{*c:1},{*c:1},{*c:1},{*c:1},{*c:1},{*c:1},{*c:1},{*c:1},{*c:}] : "foo"
- ? &e [{*d:1},{*d:1},{*d:1},{*d:1},{*d:1},{*d:1},{*d:1},{*d:1},{*d:}] : "foo"
- ? &f [{*e:1},{*e:1},{*e:1},{*e:1},{*e:1},{*e:1},{*e:1},{*e:1},{*e:}] : "foo"
- ? &g [{*f:1},{*f:1},{*f:1},{*f:1},{*f:1},{*f:1},{*f:1},{*f:1},{*f:}] : "foo"
- ? &h [{*g:1},{*g:1},{*g:1},{*g:1},{*g:1},{*g:1},{*g:1},{*g:1},{*g:}] : "foo"
- ? &i [{*h:1},{*h:1},{*h:1},{*h:1},{*h:1},{*h:1},{*h:1},{*h:1},{*h:}] : "foo"
- ? &j [{*i:1},{*i:1},{*i:1},{*i:1},{*i:1},{*i:1},{*i:1},{*i:1},{*i:}] : "foo"
- ? &k [{*j:1},{*j:1},{*j:1},{*j:1},{*j:1},{*j:1},{*j:1},{*j:1},{*j:}] : "foo"
YAML;
var_dump(yaml_parse($key_laughs));
?>
--EXPECTF--
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 2, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 3, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 4, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 5, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 6, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 7, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 8, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 9, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 10, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 2) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 11, column 79) in %sbug_77720.php on line 15
Warning: yaml_parse(): Illegal offset type array (line 12, column 1) in %sbug_77720.php on line 15
array(11) {
[0]=>
array(9) {
[0]=>
string(3) "lol"
[1]=>
string(3) "lol"
[2]=>
string(3) "lol"
[3]=>
string(3) "lol"
[4]=>
string(3) "lol"
[5]=>
string(3) "lol"
[6]=>
string(3) "lol"
[7]=>
string(3) "lol"
[8]=>
string(3) "lol"
}
[1]=>
array(0) {
}
[2]=>
array(0) {
}
[3]=>
array(0) {
}
[4]=>
array(0) {
}
[5]=>
array(0) {
}
[6]=>
array(0) {
}
[7]=>
array(0) {
}
[8]=>
array(0) {
}
[9]=>
array(0) {
}
[10]=>
array(0) {
}
}
PK ;��Z"�#�N N tests/bug_76309.phptnu �[��� --TEST--
Test PECL bug #76309
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
echo yaml_emit([
'a' => '1.0',
'b' => '2.',
'c' => '3',
'd' => '.',
'e' => 1.0,
'f' => 2.,
'g' => 3,
] );
?>
--EXPECT--
---
a: "1.0"
b: "2."
c: "3"
d: .
e: 1
f: 2
g: 3
...
PK ;��Z'�բ � tests/bug_69616.phptnu �[��� --TEST--
Test PECL bug #69616
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
yaml.decode_php=1
--FILE--
<?php
$yaml_code = <<<YAML
a: !php/object O:0:1
b: !php/object
YAML;
$yaml = yaml_parse($yaml_code);
?>
--EXPECTF--
Notice: yaml_parse(): Failed to unserialize class in %sbug_69616.php on line 10
Notice: yaml_parse(): Failed to unserialize class in %sbug_69616.php on line 10
PK ;��ZQ6��+ + tests/yaml_parse_008.phptnu �[��� --TEST--
yaml_parse - callbacks
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
?>
--FILE--
<?php
/**
* Parsing callback for yaml tag.
* @param mixed $value Data from yaml file
* @param string $tag Tag that triggered callback
* @param int $flags Scalar entity style (see YAML_*_SCALAR_STYLE)
* @return mixed Value that YAML parser should emit for the given value
*/
function tag_callback ($value, $tag, $flags) {
if (is_array($value)) {
$new_value = '';
foreach ($value as $k => $v) {
$new_value .= "'{$k}' => '{$v}', ";
}
$value = trim($new_value, ', ');
}
return "<value=[{$value}], tag=[{$tag}], flags=[{$flags}]>";
}
// yaml with some custom tags
$yaml_str = <<<YAML
%TAG ! test-
%TAG !! test2-
---
key_a : !tag_a value_a
key_b : !!tag_b 'value_b'
key_c : !<tag:example.com,2011:test/tag_c> "value_c"
key_d : !tag_d |
some
text
key_e : !tag_e >
some
text
key_f : !tag_f [ one, two ]
key_g : !tag_g { sky: blue, sea: green }
key_h : !tag_h
- one
- two
key_i : !tag_i
sky: blue
sea: green
...
YAML;
$yaml = yaml_parse($yaml_str, 0, $ndocs, array(
"test-tag_a" => "tag_callback",
"test2-tag_b" => "tag_callback",
"tag:example.com,2011:test/tag_c" => "tag_callback",
"test-tag_d" => "tag_callback",
"test-tag_e" => "tag_callback",
"test-tag_f" => "tag_callback",
"test-tag_g" => "tag_callback",
"test-tag_h" => "tag_callback",
"test-tag_i" => "tag_callback",
));
var_dump($yaml);
var_dump($ndocs);
?>
--EXPECT--
array(9) {
["key_a"]=>
string(46) "<value=[value_a], tag=[test-tag_a], flags=[1]>"
["key_b"]=>
string(47) "<value=[value_b], tag=[test2-tag_b], flags=[2]>"
["key_c"]=>
string(67) "<value=[value_c], tag=[tag:example.com,2011:test/tag_c], flags=[3]>"
["key_d"]=>
string(49) "<value=[some
text
], tag=[test-tag_d], flags=[4]>"
["key_e"]=>
string(49) "<value=[some text
], tag=[test-tag_e], flags=[5]>"
["key_f"]=>
string(65) "<value=['0' => 'one', '1' => 'two'], tag=[test-tag_f], flags=[0]>"
["key_g"]=>
string(72) "<value=['sky' => 'blue', 'sea' => 'green'], tag=[test-tag_g], flags=[0]>"
["key_h"]=>
string(65) "<value=['0' => 'one', '1' => 'two'], tag=[test-tag_h], flags=[0]>"
["key_i"]=>
string(72) "<value=['sky' => 'blue', 'sea' => 'green'], tag=[test-tag_i], flags=[0]>"
}
int(1)
PK ;��Z��G G tests/yaml_002.phptnu �[��� --TEST--
yaml - emit -> parse roundtrip with datetime
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
if(!class_exists('DateTime')) die('skip DateTime n/a');
?>
--INI--
date.timezone=GMT
yaml.decode_timestamp=2
--FILE--
<?php
$original = array(
"canonical" => new DateTime("2001-12-15T02:59:43.1Z"),
"valid iso8601" => new DateTime("2001-12-14t21:59:43.10-05:00"),
"alternate iso8601" => new DateTime("2001-12-14T21:59:43.10-0500"),
"space separated" => new DateTime("2001-12-14 21:59:43.10 -5"),
"no time zone (Z)" => new DateTime("2001-12-15 2:59:43.10"),
"date (0000:00Z)" => new DateTime("2002-12-14"),
);
$yaml = yaml_emit($original);
var_dump($yaml);
$parsed = yaml_parse($yaml);
var_dump($parsed == $original);
?>
--EXPECT--
string(303) "---
canonical: 2001-12-15T02:59:43.100000+00:00
valid iso8601: 2001-12-14T21:59:43.100000-05:00
alternate iso8601: 2001-12-14T21:59:43.100000-05:00
space separated: 2001-12-14T21:59:43.100000-05:00
no time zone (Z): 2001-12-15T02:59:43.100000+00:00
date (0000:00Z): 2002-12-14T00:00:00.000000+00:00
...
"
bool(true)
PK ;��Z(~̛A A tests/bug_74799.phptnu �[��� --TEST--
Memory leak check
--CREDITS--
Gleb Svitelskiy <gleb.svitelskiy@gmail.com>
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
function tag_callback($value, $tag, $flags) {
return 'callback value';
}
$base_memory = memory_get_usage();
$yamlString ="---\nkey: !value\n...\n";
$ndocs = null;
yaml_parse($yamlString, 0, $ndocs, ['!value' => 'tag_callback']);
unset($yamlString, $ndocs);
$ndocs = null;
yaml_parse_file(__DIR__.'/bug_74799.yaml', 0, $ndocs, ['!value' => 'tag_callback']);
unset($ndocs);
$array = ['key' => 'value'];
yaml_emit($array);
unset($array);
$array = ['key' => 'value'];
yaml_emit_file(__DIR__.'/bug_74799.tmp', $array);
unset($array);
var_dump($base_memory == memory_get_usage());
?>
--CLEAN--
<?php
unlink(__DIR__.'/bug_74799.tmp');
?>
--EXPECT--
bool(true)
PK ;��ZJ�Ba� � . tests/yaml_parse_wiki_YtsBlockMapping_002.phptnu �[��� --TEST--
Yaml YtsBlockMapping - Multi Element Mapping
--DESCRIPTION--
More than one key/value pair
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
red: baron
white: walls
blue: berries
'));
?>
--EXPECT--
array(3) {
["red"]=>
string(5) "baron"
["white"]=>
string(5) "walls"
["blue"]=>
string(7) "berries"
}
PK ;��Z���� � - tests/yaml_parse_wiki_YtsStrangeKeys_002.phptnu �[��� --TEST--
Yaml YtsStrangeKeys - Unquoted line noise key
--DESCRIPTION--
Check that unquoted line noise parses as key.
This requires the line noise be tame enough
to pass as an implicit plain key.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
-+!@#% : bar baz
'));
?>
--EXPECT--
array(1) {
["-+!@#%"]=>
string(7) "bar baz"
}
PK ;��Z�;�� � . tests/yaml_parse_wiki_YtsBlockMapping_004.phptnu �[��� --TEST--
Yaml YtsBlockMapping - Colons aligned
--DESCRIPTION--
Spaces can come before the ': ' key/value separator.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
red : baron
white : walls
blue : berries
'));
?>
--EXPECT--
array(3) {
["red"]=>
string(5) "baron"
["white"]=>
string(5) "walls"
["blue"]=>
string(7) "berries"
}
PK ;��Z���� � tests/yaml_parse_spec_int.phptnu �[��� --TEST--
Yaml 1.1 Spec - int
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('
canonical: 685230
decimal: +685_230
octal: 02472256
hexadecimal: 0x_0A_74_AE
binary: 0b1010_0111_0100_1010_1110
sexagesimal: 190:20:30
'));
?>
--EXPECT--
array(6) {
["canonical"]=>
int(685230)
["decimal"]=>
int(685230)
["octal"]=>
int(685230)
["hexadecimal"]=>
int(685230)
["binary"]=>
int(685230)
["sexagesimal"]=>
int(685230)
}
PK ;��Z�5|T� � tests/yaml_emit_008.phptnu �[��� --TEST--
yaml_emit - custom tags
--SKIPIF--
<?php
if(!extension_loaded('yaml')) die('skip yaml n/a');
?>
--FILE--
<?php
class Emit008Example {
public $data; // data may be in any pecl/yaml suitable type
/**
* Yaml emit callback function, referred on yaml_emit call by class name.
*
* Expected to return an array with 2 values:
* - 'tag': custom tag for this serialization
* - 'data': value to convert to yaml (array, string, bool, number)
*
* @return array
*/
public static function yamlEmit (Emit008Example $obj) {
return array(
'tag' => '!emit008',
'data' => $obj->data,
);
}
}
$emit_callbacks = array(
'Emit008Example' => array('Emit008Example', 'yamlEmit')
);
$t = new Emit008Example();
$t->data = array ('a','b','c');
$yaml = yaml_emit(
array(
'callback' => $t,
),
YAML_ANY_ENCODING,
YAML_ANY_BREAK,
$emit_callbacks
);
var_dump($yaml);
/* make sure you can undo the custome serialization */
function parse_008 ($value, $tag, $flags) {
$ret = new Emit008Example();
$ret->data = $value;
return $ret;
}
$parse_callbacks = array(
'!emit008' => 'parse_008',
);
$array = yaml_parse($yaml, 0, $cnt, $parse_callbacks);
var_dump($array['callback'] == $t);
/* roundtrip with raw object */
var_dump($t == yaml_parse(
yaml_emit($t, YAML_ANY_ENCODING, YAML_ANY_BREAK, $emit_callbacks),
0, $cnt, $parse_callbacks));
?>
--EXPECT--
string(39) "---
callback: !emit008
- a
- b
- c
...
"
bool(true)
bool(true)
PK ;��Z�[_z z tests/yaml_emit_003.phptnu �[��� --TEST--
yaml_emit - mappings
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
$addr = array(
"given" => "Chris",
"family"=> "Dumars",
"address"=> array(
"lines"=> "458 Walkman Dr.
Suite #292",
"city"=> "Royal Oak",
"state"=> "MI",
"postal"=> 48046,
),
);
$invoice = array (
"invoice"=> 34843,
"date"=> 980208000,
"bill-to"=> $addr,
"ship-to"=> $addr,
"product"=> array(
array(
"sku"=> "BL394D",
"quantity"=> 4,
"description"=> "Basketball",
"price"=> 450,
),
array(
"sku"=> "BL4438H",
"quantity"=> 1,
"description"=> "Super Hoop",
"price"=> 2392,
),
),
"tax"=> 251.42,
"total"=> 4443.52,
"comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.",
);
var_dump(yaml_emit($invoice));
?>
--EXPECT--
string(620) "---
invoice: 34843
date: 980208000
bill-to:
given: Chris
family: Dumars
address:
lines: |-
458 Walkman Dr.
Suite #292
city: Royal Oak
state: MI
postal: 48046
ship-to:
given: Chris
family: Dumars
address:
lines: |-
458 Walkman Dr.
Suite #292
city: Royal Oak
state: MI
postal: 48046
product:
- sku: BL394D
quantity: 4
description: Basketball
price: 450
- sku: BL4438H
quantity: 1
description: Super Hoop
price: 2392
tax: 251.42
total: 4443.52
comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.
...
"
PK ;��Z3�=S� � tests/yaml_emit_001.phptnu �[��� --TEST--
yaml_emit - scalars
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
var_dump(yaml_emit(null));
var_dump(yaml_emit(true));
var_dump(yaml_emit(false));
var_dump(yaml_emit(10));
var_dump(yaml_emit(-10));
var_dump(yaml_emit(123.456));
var_dump(yaml_emit(-123.456));
var_dump(yaml_emit("yes"));
var_dump(yaml_emit("no"));
var_dump(yaml_emit("~"));
var_dump(yaml_emit("-"));
var_dump(yaml_emit("'"));
var_dump(yaml_emit('"'));
var_dump(yaml_emit("I\\xF1t\\xEBrn\\xE2ti\\xF4n\\xE0liz\\xE6ti\\xF8n"));
var_dump(yaml_emit("# looks like a comment"));
var_dump(yaml_emit("@looks_like_a_ref"));
var_dump(yaml_emit("&looks_like_a_alias"));
var_dump(yaml_emit("!!str"));
var_dump(yaml_emit("%TAG ! tag:looks.like.one,999:"));
var_dump(yaml_emit("!something"));
var_dump(yaml_emit("Hello world!"));
var_dump(yaml_emit("This is a string with\nan embedded newline."));
$str = <<<EOD
This string was made with a here doc.
It contains embedded newlines.
It also has some embedded tabs.
Here are some symbols:
`~!@#$%^&*()_-+={}[]|\:";'<>,.?/
These are extended characters: Iñtërnâtiônàlizætiøn
EOD;
var_dump(yaml_emit($str));
?>
--EXPECT--
string(10) "--- ~
...
"
string(13) "--- true
...
"
string(14) "--- false
...
"
string(11) "--- 10
...
"
string(12) "--- -10
...
"
string(16) "--- 123.456
...
"
string(17) "--- -123.456
...
"
string(14) "--- "yes"
...
"
string(13) "--- "no"
...
"
string(12) "--- "~"
...
"
string(12) "--- '-'
...
"
string(13) "--- ''''
...
"
string(12) "--- '"'
...
"
string(50) "--- I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n
...
"
string(33) "--- '# looks like a comment'
...
"
string(28) "--- '@looks_like_a_ref'
...
"
string(30) "--- '&looks_like_a_alias'
...
"
string(16) "--- '!!str'
...
"
string(41) "--- '%TAG ! tag:looks.like.one,999:'
...
"
string(21) "--- '!something'
...
"
string(21) "--- Hello world!
...
"
string(58) "--- |-
This is a string with
an embedded newline.
...
"
string(267) "--- "This string was made with a here doc.\n\nIt contains embedded newlines.\n \t\tIt
also has some embedded tabs.\n\nHere are some symbols:\n`~!@#$%^&*()_-+={}[]|\\:\";'<>,.?/\n\nThese
are extended characters: I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\n\n"
...
"
PK ;��Zc���T T , tests/yaml_parse_wiki_YtsBasicTests_005.phptnu �[��� --TEST--
Yaml YtsBasicTests - Simple Mapping
--DESCRIPTION--
You can add a keyed list "also known as a dictionary or
hash" to your document by placing each member of the
list on a new line, with a colon seperating the key
from its value. In YAML, this type of list is called
a mapping.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('foo: whatever
bar: stuff
'));
?>
--EXPECT--
array(2) {
["foo"]=>
string(8) "whatever"
["bar"]=>
string(5) "stuff"
}
PK <��ZO��� � tests/yaml_parse_004.phptnu �[��� --TEST--
yaml_parse - syck bug #11585
--CREDITS--
From syck bug #11585
http://pecl.php.net/bugs/bug.php?id=11585
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('---
define: &pointer_to_define
- 1
- 2
- 3
reference: *broken_pointer_to_define
'));
?>
--EXPECTF--
Warning: yaml_parse(): alias broken_pointer_to_define is not registered (line 6, column 37) in %syaml_parse_004.php on line %d
bool(false)
PK <��Zû��_ _ , tests/yaml_parse_wiki_YtsBasicTests_003.phptnu �[��� --TEST--
Yaml YtsBasicTests - Mixed Sequences
--DESCRIPTION--
Sequences can contain any YAML data,
including strings and other sequences.
--CREDITS--
Bryan Davis bd808@bd808.com
# yaml.kwiki.org import/conversion
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
var_dump(yaml_parse('- apple
-
- foo
- bar
- x123
- banana
- carrot
'));
?>
--EXPECT--
array(4) {
[0]=>
string(5) "apple"
[1]=>
array(3) {
[0]=>
string(3) "foo"
[1]=>
string(3) "bar"
[2]=>
string(4) "x123"
}
[2]=>
string(6) "banana"
[3]=>
string(6) "carrot"
}
PK <��Z�6Ƥ � tests/yaml_emit_002.phptnu �[��� --TEST--
yaml_emit - sequences
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--INI--
serialize_precision=-1
--FILE--
<?php
$str = <<<EOD
This string was made with a here doc.
It contains embedded newlines.
It also has some embedded tabs.
Here are some symbols:
`~!@#$%^&*()_-+={}[]|\:";'<>,.?/
These are extended characters: Iñtërnâtiônàlizætiøn
EOD;
$doc = array(
null,
true,
false,
10,
-10,
123.456,
-123.456,
"yes",
"no",
"~",
"-",
"'",
'"',
"I\\xF1t\\xEBrn\\xE2ti\\xF4n\\xE0liz\\xE6ti\\xF8n",
"# looks like a comment",
"@looks_like_a_ref",
"&looks_like_a_alias",
"!!str",
"%TAG ! tag:looks.like.one,999:",
"!something",
"Hello world!",
"This is a string with\nan embedded newline.",
$str,
);
echo "=== Array of scalars ===\n";
var_dump(yaml_emit($doc));
echo "=== Nested ===\n";
var_dump(yaml_emit(array(
"top level",
array(
"in array",
),
array(
"in array",
array(
"in array",
),
),
)));
echo "=== Degenerate ===\n";
var_dump(yaml_emit(array()));
?>
--EXPECT--
=== Array of scalars ===
string(604) "---
- ~
- true
- false
- 10
- -10
- 123.456
- -123.456
- "yes"
- "no"
- "~"
- '-'
- ''''
- '"'
- I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n
- '# looks like a comment'
- '@looks_like_a_ref'
- '&looks_like_a_alias'
- '!!str'
- '%TAG ! tag:looks.like.one,999:'
- '!something'
- Hello world!
- |-
This is a string with
an embedded newline.
- "This string was made with a here doc.\n\nIt contains embedded newlines.\n \t\tIt
also has some embedded tabs.\n\nHere are some symbols:\n`~!@#$%^&*()_-+={}[]|\\:\";'<>,.?/\n\nThese
are extended characters: I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\n\n"
...
"
=== Nested ===
string(61) "---
- top level
- - in array
- - in array
- - in array
...
"
=== Degenerate ===
string(11) "--- []
...
"
PK ;��ZM%�dS S tests/yaml_parse_spec_bool.phptnu �[��� PK ;��Z�SS� � , � tests/yaml_parse_wiki_YtsBasicTests_006.phptnu �[��� PK ;��Z���� � � tests/bug_75029.phptnu �[��� PK ;��ZJ�n0" " � tests/bug_69465.phptnu �[��� PK ;��Z$�$7 7 , $ tests/yaml_parse_wiki_YtsBasicTests_007.phptnu �[��� PK ;��ZE�B� � - � tests/yaml_parse_wiki_YtsStrangeKeys_001.phptnu �[��� PK ;��Z���V V �
tests/yaml_parse_spec_seq.phptnu �[��� PK ;��Z�~��P P : tests/yaml_emit_004.phptnu �[��� PK ;��Z�ͫh , � tests/yaml_parse_wiki_YtsBasicTests_004.phptnu �[��� PK ;��Z-E+ A tests/yaml_parse_spec_float.phptnu �[��� PK ;��Z|�I;- - , � tests/yaml_parse_wiki_YtsBasicTests_009.phptnu �[��� PK ;��Z�� . 4 tests/yaml_parse_wiki_YtsBlockMapping_003.phptnu �[��� PK ;��Z]A�� � * � tests/yaml_parse_wiki_YtsMapInSeq_002.phptnu �[��� PK ;��Z(�#m� � � tests/bug_60628.phptnu �[��� PK ;��Z�� �&