-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
51 lines (46 loc) · 1.11 KB
/
test.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
<?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;
// 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(__FILE__,__LINE__,"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");
function hello($you) {
printf("hello %s!\n",$you);
goodbye($you);
}
function goodbye($you) {
printf("goodbye %s!\n",$you);
t\traceback("saying goodbye");
}
?>