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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
--TEST--
var_export(): simple test with arrays and objects
--FILE--
<?php
echo "\n\n-- Var export on a simple object --\n";
$o1 = new stdclass;
$o1->p = '22';
$o2 = new stdclass;
$o2->a = 1;
$o2->b = array('k'=>2);
$o2->x = $o1;
var_export($o2);
echo "\n\n-- Var export on an simple array --\n";
$a = array(1,2,3,4);
var_export($a);
echo "\n\n-- Var export on an nested array --\n";
$a = array('one' => 'first');
$b = array('foo' => $a, 'bar' => $o2);
var_export($b);
?>
===DONE===
--EXPECT--
-- Var export on a simple object --
(object) array(
'a' => 1,
'b' =>
array (
'k' => 2,
),
'x' =>
(object) array(
'p' => '22',
),
)
-- Var export on an simple array --
array (
0 => 1,
1 => 2,
2 => 3,
3 => 4,
)
-- Var export on an nested array --
array (
'foo' =>
array (
'one' => 'first',
),
'bar' =>
(object) array(
'a' => 1,
'b' =>
array (
'k' => 2,
),
'x' =>
(object) array(
'p' => '22',
),
),
)===DONE===
|