-
Notifications
You must be signed in to change notification settings - Fork 2
/
tests.php
80 lines (75 loc) · 1.37 KB
/
tests.php
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
<?php
/**
* Created by PhpStorm.
* User: zenus
* Date: 15-11-17
* Time: 下午11:26
* @param $arr
* @param $value
*/
//function createGreeter() {
// return function($why) {
// echo "Hello ".$why;
// };
//}
//
//$greeter = createGreeter("World");
////$greeter('hi'); // Hello World
//$arr = array(
// 'safdsfasfdl'
//);
//
////die($arr[0][1]);
//
//class hi {
// private $hi;
//
// public function set_hi($str){
// $this->hi = $str;
// }
// public function eccho (){
// echo $this->hi;
// }
//}
//
//function hi(){
// $hi = new hi();
// $hi->set_hi('wwww');
// return $hi;
//}
//
//$obj = hi();
//$obj->eccho();
//$arr = [1,2,2,3,4,4,4,5,6,7,7];
//function BinarySearch($arr,$val){
// if(empty($arr)){
// return null;
// }
// $start = 0;
// $end = count($arr) - 1 ;
// while($start <= $end){round
// $mid = $start + (($end - $start)/2);
// if($val == $arr[$mid]){
// return $mid;
// }elseif($val < $arr[$mid]){
// $end = $mid - 1;
// }else{
// $start = $mid + 1;
// }
// }
// return null;
//}
//
//$arr = posix_getrlimit();
//var_dump($arr);
$mylist = new SplDoublyLinkedList();
$mylist->push(1);
$mylist->push(2);
$mylist->push(3);
$mylist->push(4);
$mylist->push(5);
var_dump($mylist);
$t = $mylist->bottom();
echo $t."\r\n";
var_dump($mylist);
die;