File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 12
12
13
13
if (!function_exists ('println ' )) {
14
14
/**
15
+ * print multi vars with newline.
16
+ *
15
17
* @param mixed ...$vars
16
18
*
17
19
* @return void
@@ -39,6 +41,35 @@ function println(...$vars): void
39
41
}
40
42
}
41
43
44
+ if (!function_exists ('printm ' )) {
45
+ /**
46
+ * print multi vars.
47
+ *
48
+ * @param mixed ...$vars
49
+ *
50
+ * @return void
51
+ */
52
+ function printm (...$ vars ): void
53
+ {
54
+ $ eleNum = count ($ vars );
55
+ if ($ eleNum === 1 ) {
56
+ echo DataHelper::toString ($ vars [0 ]);
57
+ return ;
58
+ }
59
+
60
+ if ($ eleNum === 0 ) {
61
+ return ;
62
+ }
63
+
64
+ // eleNum > 1
65
+ $ ss = [];
66
+ foreach ($ vars as $ var ) {
67
+ $ ss [] = DataHelper::toString ($ var );
68
+ }
69
+ echo implode ('' , $ ss );
70
+ }
71
+ }
72
+
42
73
if (!function_exists ('vdump ' )) {
43
74
/**
44
75
* Dump data like var_dump
You can’t perform that action at this time.
0 commit comments