-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmake_strings.php
More file actions
83 lines (71 loc) · 1.46 KB
/
Copy pathmake_strings.php
File metadata and controls
83 lines (71 loc) · 1.46 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
error_reporting(0);
function dump ($o) {
$o = serialize($o);
echo json_encode($o), "\n";
}
class Foo {
public $bar = 1;
protected $baz = 2;
private $xyzzy = array(1,2,3,4,5,6,7,8,9);
protected $self;
public function __construct () {
$this->self = $this;
}
}
$f = new Foo();
dump($f);
class Bar {
}
$f = new Bar();
$f->self = $f;
dump($f);
class Child extends Foo {
public $lorem = 42;
protected $ipsum = 37;
private $dolor = 13;
}
$f = new Child();
dump($f);
$f = new stdClass;
$f->obj1->obj2->obj3->arr = array();
$f->obj1->obj2->obj3->arr[] = 1;
$f->obj1->obj2->obj3->arr[] = 2;
$f->obj1->obj2->obj3->arr[] = 3;
$f->obj1->obj2->obj3->arr['ref1'] = $f->obj1->obj2;
$f->obj1->obj2->obj3->arr['ref2'] = &$f->obj1->obj2->obj3->arr;
dump($f);
$f = array(
'int' => 42,
'str' => "lorem",
'nul' => null,
'obj' => new stdClass(),
);
$f['obj']->lorem = 10;
$f['obj']->ipsum = new stdClass();
$f['obj']->ipsumLink = $f['obj']->ipsum;
$f['obj']->ipsumRef = &$f['obj']->ipsum;
$f['intRef'] = &$f['int'];
$f['strRef'] = &$f['str'];
$f['nulRef'] = &$f['nul'];
$f['objLink'] = $f['obj'];
$f['objRef'] = &$f['obj'];
dump($f);
$f = new SplDoublyLinkedList();
dump($f);
$o = new StdClass();
$a = new StdClass();
$o->a = $a;
$f = new SplObjectStorage();
$f[$o] = 1;
$f[$a] = 2;
dump($f);
$f = 'blåbærsyltetøy';
dump($f);
$f = '$¢€𠜎';
dump($f);
$array = array(
"0b5f7j" => "value1",
"anotherKey" => "value2"
);
dump($array);