-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.php
More file actions
30 lines (27 loc) · 739 Bytes
/
test.php
File metadata and controls
30 lines (27 loc) · 739 Bytes
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
29
30
<?php
/**
*
* testing various cases
*
*
*/
require 'pg_parse.php';
$samples = array(
// '{"meeting","lunch"}',
// '{"meeting with boss",dinner,party}',
// '{{"meeting","lunch"},{"meeting with boss"},{dinner,party}}',
// '{{"meeting","lunch"},"meeting with boss",{dinner,party}}',
// '{{{{{{{{{{{"meeting","lunch"},{"meeting with boss"},{dinner,party}}}}}}}}}}}',
// '[0:0]={"meeting"}',
// '[2:4]={{"meeting","lunch"},{"meeting with boss"},{dinner}}',
// 'invalid not an array',
'{xyz,"abc}def"}',
'{xyz,"abc}d\\"ef"}',
'{xyz,"ab{\"meeting\",\"lunch\"}"}',
'{xyz,\{hello\},"a{b},{c}"}',
'{xyz,"foo\\\\"}'
);
foreach ($samples as $x) {
echo "\n\n $x\n";
var_dump(pg_parse($x));
}