12 foreach ( $arr as &$p ) {
13 if ( !isset( $p[2] ) ) {
14 $p[2] = [
'formatversion' => $format ];
16 $p[2][
'formatversion'] = $format;
24 self::addFormatVersion( 1, [
26 [ [
null ],
'[null]' ],
32 [ [ 42.5 ],
'[42.5]' ],
33 [ [ 1e42 ],
'[1.0e+42]' ],
34 [ [
'foo' ],
'["foo"]' ],
35 [ [
'fóo' ],
'["f\u00f3o"]' ],
36 [ [
'fóo' ],
'["fóo"]', [
'utf8' => 1 ] ],
40 [ [ [ 1 ] ],
'[[1]]' ],
41 [ [ [
'x' => 1 ] ],
'[{"x":1}]' ],
42 [ [ [ 2 => 1 ] ],
'[{"2":1}]' ],
43 [ [ (
object)[] ],
'[{}]' ],
53 '[[{"key":"x","*":1}]]'
64 '{"foo":{"*":"foo"}}' ],
67 [ [ 1 ],
'/**/myCallback([1])', [
'callback' =>
'myCallback' ] ],
70 [ [
'< Cross-Domain-Policy >' ],
'["\u003C Cross-Domain-Policy >"]' ],
72 self::addFormatVersion( 2, [
74 [ [
null ],
'[null]' ],
75 [ [
true ],
'[true]' ],
76 [ [
false ],
'[false]' ],
80 [ [ 42.5 ],
'[42.5]' ],
81 [ [ 1e42 ],
'[1.0e+42]' ],
82 [ [
'foo' ],
'["foo"]' ],
83 [ [
'fóo' ],
'["fóo"]' ],
84 [ [
'fóo' ],
'["f\u00f3o"]', [
'ascii' => 1 ] ],
88 [ [ [
'x' => 1 ] ],
'[{"x":1}]' ],
89 [ [ [ 2 => 1 ] ],
'[{"2":1}]' ],
90 [ [ (
object)[] ],
'[{}]' ],
109 '[{"0":"a","1":"b"}]'
114 '{"content":"foo"}' ],
121 [ [ 1 ],
'/**/myCallback([1])', [
'callback' =>
'myCallback' ] ],
124 [ [
'< Cross-Domain-Policy >' ],
'["\u003C Cross-Domain-Policy >"]' ],
const META_TYPE
Key for the 'type' metadata item.
const META_BC_BOOLS
Key for the 'BC bools' metadata item.
const META_CONTENT
Key for the 'content' metadata item.
const META_KVP_KEY_NAME
Key for the metadata item whose value specifies the name used for the kvp key in the alternative outp...
const META_BC_SUBELEMENTS
Key for the 'BC subelements' metadata item.