-
Notifications
You must be signed in to change notification settings - Fork 0
/
test1.php
57 lines (52 loc) · 1.26 KB
/
test1.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
<?php
/**
* test.php
*
* test php debug harness
* @author Jeff Hendrickson JKH <[email protected]>
* @version 1.0
* @package tracetofile
*/
require_once "tracetofile.php";
// define namespace
use tracetofile as t;
$runCount = 100;
while(--$runCount > 0) {
// wait for 5ms seconds 1000000 = 1 second
usleep(5000);
// test array
$test = array("Jeff", "Hendrickson");
// test trace to file ...
// e.g. namespace\trace(string or filename,number,string message);
// will create entry in log.txt ...
// this is a test... test.php ln[19]
t\trace("this is a test...");
// test trace object
// e.g. namespace\traceobjects($object);
// will create an object list ...
// Array
// (
// [0] => Jeff
// [1] => Hendrickson
// )
t\traceobject($test);
// test trace back (in function below)
// e.g. traceback("some cool message");
// will create a traceback list ...
// PID CNT Microtime MESSAGE
// [4762 - 1 - 1572614665.413] : saying goodbye
// [test.php 40] hello()
// --> [test.php 44] goodbye()
// call test functions...
hello("Jeff [" . $runCount . "]");
}
function hello($you) {
printf("hello %s!\n",$you);
goodbye($you);
}
function goodbye($you) {
printf("goodbye %s!\n",$you);
// test trace back
t\traceback("saying goodbye");
}
?>