- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.php
More file actions
Latest commit
34 lines (30 loc) · 1.01 KB
/
Copy pathsample.php
File metadata and controls
34 lines (30 loc) · 1.01 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
<?php
require'LazyEvalutableObject.php';
class Test extends LazyEvalutableObject {
public$omase = 'san';
public$tokyo = 'kyoto';
public$one_time;
public$normal_property = 100;
publicfunction__construct() {
$this->addLazyEvalutionObserver('omase', array($this, 'omase'));
$this->addLazyEvalutionObserver('tokyo', array($this, 'tokyo'));
$this->addLazyEvalutionObserver('one_time', array($this, 'one_time'));
}
publicfunctionomase($property) {
echosprintf("hello! property is %s\n", $property);
}
publicfunctiontokyo($property) {
echosprintf("hello! property is %s\n", $property);
return'osaka';
}
publicfunctionone_time($property) {
echosprintf("hello! property is %s\n", $property);
$this->one_time = rand(0, 10);
return$this->one_time;
}
}
$test = newTest();
echosprintf("\$test->omase = %s\n", $test->omase);
echosprintf("\$test->tokyo = %s\n", $test->tokyo);
echosprintf("\$test->one_time = %s\n", $test->one_time);
echosprintf("\$test->one_time = %s\n", $test->one_time);