-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread-arguments.php
More file actions
91 lines (81 loc) · 1.88 KB
/
read-arguments.php
File metadata and controls
91 lines (81 loc) · 1.88 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
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
<?php
/*
* This file is part of the awesomite/stack-trace package.
*
* (c) Bartłomiej Krukowski <bartlomiej@krukowski.me>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require \implode(\DIRECTORY_SEPARATOR, array(__DIR__, '..', 'vendor', 'autoload.php'));
require_once __DIR__ . \DIRECTORY_SEPARATOR . 'StackTracePrinter.php';
/**
* @internal
*
* @param $arg1
* @param $arg2
*/
function myFirstFunction($arg1, $arg2)
{
$callable = function () {
mySecondFunction('foo', 'bar');
};
\call_user_func($callable, 'redundant');
}
/**
* @internal
*
* @param $foo
* @param $bar
*/
function mySecondFunction($foo, $bar)
{
myThirdFunction(\tmpfile(), \M_PI);
}
/**
* @internal
*
* @param $argument1
* @param $argument2
*/
function myThirdFunction($argument1, $argument2)
{
$printer = new StackTracePrinter();
$printer->printStackTrace();
}
myFirstFunction('hello', 'world');
/*
Output:
#1 Awesomite\StackTrace\StackTraceFactory->create($stepLimit, $ignoreArgs)
Place in code:
(...)/stack-trace/examples/StackTracePrinter.php:26
Arguments:
undefined (default 0)
undefined (default false)
#2 StackTracePrinter->printStackTrace()
Place in code:
(...)/stack-trace/examples/read-arguments.php:49
#3 myThirdFunction($argument1, $argument2)
Place in code:
(...)/stack-trace/examples/read-arguments.php:37
Arguments:
resource #11 of type stream
M_PI
#4 mySecondFunction($foo, $bar)
Place in code:
(...)/stack-trace/examples/read-arguments.php:24
Arguments:
“foo”
“bar”
#5 {closure}()
Place in code:
(...)/stack-trace/examples/read-arguments.php:26
Arguments:
“redundant”
#6 myFirstFunction($arg1, $arg2)
Place in code:
(...)/stack-trace/examples/read-arguments.php:52
Arguments:
“hello”
“world”
*/