summaryrefslogtreecommitdiff
path: root/Examples/simple/simple.php
blob: 3abaa77789a134cdac8d0fa4c4efedd166f0086c (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php

//class XXX
//{
//    public function __toString()
//    {
//        return "MyClass";
//    }
//}
//
//$myvar = "hoi";
//
//class MyClass {
//
//    public function __toString()
//    {
//        return "aksjdfhsdfkj";
//    }
//}
//
//$g1 = 123;
//$g2 = "abc";
//
//$result = my_plus(new MyClass(), array(), new MyClass(), $myvar, "blabla", new XXX());
//
//echo("myvar = $myvar\n");
//
//echo("resultaat: $result\n");
//
//echo("g1: $g1\n");
//echo("g2: $g2\n");
//echo("g3: $g3\n");

function slowsort($input)
{
    $size = count($input);
    for ($i=0; $i<$size; $i++)
    {
        $left = $input[$i];
        for ($j=$i+1; $j<$size; $j++)
        {
            $right = $input[$j];
            
            if ($left < $right) continue;
            
            // swap values
            $input[$i] = $right;
            $input[$j] = $left;
            $left = $right;
        }
    }
    return $input;
}

//if (class_exists("my_class")) echo("Warempel, de class bestaat\n");
//
//class my_extended_class extends my_class
//{
//    public function myMethod($val)
//    {
//        echo($this->a."\n");
//        echo($this->b."\n");
//        echo("hoi\n");
//        
//        parent::myMethod($val);
//    }
//    
//}
//
//$x = new my_extended_class();
//$x->myMethod(123);

$x = new my_class();
$x->myMethod();


//echo(my_plus(1,2,3,4)."\n");

$array = array();
for ($i=0; $i<10000; $i++) $array[] = rand();

//$array = array(1,2,3);

//print_r($array);
//bubblesort($array);

//print_r($array);


//echo("my_class::a = ".$x->a."\n");
//echo("my_class::b = ".$x->b."\n");
//
//unset($x);
//
//echo("done\n");

//$x->my_method();