Revert "make hphpc able to use ini files"
[hiphop-php.git] / hphp / test / zend / bad / ext / standard / tests / serialize / serialization_arrays_004.php
blob222138111adb0cac31050ebc042ae7ce5e0a942e
1 <?php
2 /* Prototype : proto string serialize(mixed variable)
3 * Description: Returns a string representation of variable (which can later be unserialized)
4 * Source code: ext/standard/var.c
5 * Alias to functions:
6 */
7 /* Prototype : proto mixed unserialize(string variable_representation)
8 * Description: Takes a string representation of variable and recreates it
9 * Source code: ext/standard/var.c
10 * Alias to functions:
13 function check(&$a) {
14 var_dump($a);
15 $ser = serialize($a);
16 var_dump($ser);
18 $b = unserialize($ser);
19 var_dump($b);
20 $b[0] = "b0.changed";
21 var_dump($b);
22 $b[1] = "b1.changed";
23 var_dump($b);
24 $b[2] = "b2.changed";
25 var_dump($b);
28 echo "\n\n--- 1 refs container:\n";
29 $a = array();
30 $a[0] = &$a;
31 $a[1] = 1;
32 $a[2] = 1;
33 check($a);
35 echo "\n\n--- 1,2 ref container:\n";
36 $a = array();
37 $a[0] = &$a;
38 $a[1] = &$a;
39 $a[2] = 1;
40 check($a);
42 echo "\n\n--- 1,2,3 ref container:\n";
43 $a = array();
44 $a[0] = &$a;
45 $a[1] = &$a;
46 $a[2] = &$a;
47 check($a);
49 echo "Done";