xref: /PHP-7.3/sapi/cli/tests/006.phpt (revision 17ccbeec)
1--TEST--
2show information about extension
3--SKIPIF--
4<?php
5include "skipif.inc";
6if (!extension_loaded("session")) {
7	die("skip session extension required");
8}
9if (PCRE_JIT_SUPPORT == false) {
10	die ("skip not pcre jit support builtin");
11}
12?>
13--INI--
14date.timezone=
15--FILE--
16<?php
17
18$php = getenv('TEST_PHP_EXECUTABLE');
19
20var_dump(`$php -n --re unknown`);
21var_dump(`$php -n --re ""`);
22var_dump(`$php -n --re pcre`);
23
24echo "Done\n";
25?>
26--EXPECTF--
27string(44) "Exception: Extension unknown does not exist
28"
29string(37) "Exception: Extension  does not exist
30"
31string(%d) "Extension [ <persistent> extension #%d pcre version %s ] {
32
33  - INI {
34    Entry [ pcre.backtrack_limit <ALL> ]
35      Current = '%d'
36    }
37    Entry [ pcre.recursion_limit <ALL> ]
38      Current = '%d'
39    }
40    Entry [ pcre.jit <ALL> ]
41      Current = '%d'
42    }
43  }
44
45  - Constants [19] {
46    Constant [ int PREG_PATTERN_ORDER ] { 1 }
47    Constant [ int PREG_SET_ORDER ] { 2 }
48    Constant [ int PREG_OFFSET_CAPTURE ] { 256 }
49    Constant [ int PREG_UNMATCHED_AS_NULL ] { 512 }
50    Constant [ int PREG_SPLIT_NO_EMPTY ] { 1 }
51    Constant [ int PREG_SPLIT_DELIM_CAPTURE ] { 2 }
52    Constant [ int PREG_SPLIT_OFFSET_CAPTURE ] { 4 }
53    Constant [ int PREG_GREP_INVERT ] { 1 }
54    Constant [ int PREG_NO_ERROR ] { 0 }
55    Constant [ int PREG_INTERNAL_ERROR ] { 1 }
56    Constant [ int PREG_BACKTRACK_LIMIT_ERROR ] { 2 }
57    Constant [ int PREG_RECURSION_LIMIT_ERROR ] { 3 }
58    Constant [ int PREG_BAD_UTF8_ERROR ] { 4 }
59    Constant [ int PREG_BAD_UTF8_OFFSET_ERROR ] { 5 }
60    Constant [ int PREG_JIT_STACKLIMIT_ERROR ] { 6 }
61    Constant [ string PCRE_VERSION ] { %s }
62    Constant [ int PCRE_VERSION_MAJOR ] { %d }
63    Constant [ int PCRE_VERSION_MINOR ] { %d }
64    Constant [ bool PCRE_JIT_SUPPORT ] { %d }
65  }
66
67  - Functions {
68    Function [ <internal:pcre> function preg_match ] {
69
70      - Parameters [5] {
71        Parameter #0 [ <required> $pattern ]
72        Parameter #1 [ <required> $subject ]
73        Parameter #2 [ <optional> &$subpatterns ]
74        Parameter #3 [ <optional> $flags ]
75        Parameter #4 [ <optional> $offset ]
76      }
77    }
78    Function [ <internal:pcre> function preg_match_all ] {
79
80      - Parameters [5] {
81        Parameter #0 [ <required> $pattern ]
82        Parameter #1 [ <required> $subject ]
83        Parameter #2 [ <optional> &$subpatterns ]
84        Parameter #3 [ <optional> $flags ]
85        Parameter #4 [ <optional> $offset ]
86      }
87    }
88    Function [ <internal:pcre> function preg_replace ] {
89
90      - Parameters [5] {
91        Parameter #0 [ <required> $regex ]
92        Parameter #1 [ <required> $replace ]
93        Parameter #2 [ <required> $subject ]
94        Parameter #3 [ <optional> $limit ]
95        Parameter #4 [ <optional> &$count ]
96      }
97    }
98    Function [ <internal:pcre> function preg_replace_callback ] {
99
100      - Parameters [5] {
101        Parameter #0 [ <required> $regex ]
102        Parameter #1 [ <required> $callback ]
103        Parameter #2 [ <required> $subject ]
104        Parameter #3 [ <optional> $limit ]
105        Parameter #4 [ <optional> &$count ]
106      }
107    }
108    Function [ <internal:pcre> function preg_replace_callback_array ] {
109
110      - Parameters [4] {
111        Parameter #0 [ <required> $pattern ]
112        Parameter #1 [ <required> $subject ]
113        Parameter #2 [ <optional> $limit ]
114        Parameter #3 [ <optional> &$count ]
115      }
116    }
117    Function [ <internal:pcre> function preg_filter ] {
118
119      - Parameters [5] {
120        Parameter #0 [ <required> $regex ]
121        Parameter #1 [ <required> $replace ]
122        Parameter #2 [ <required> $subject ]
123        Parameter #3 [ <optional> $limit ]
124        Parameter #4 [ <optional> &$count ]
125      }
126    }
127    Function [ <internal:pcre> function preg_split ] {
128
129      - Parameters [4] {
130        Parameter #0 [ <required> $pattern ]
131        Parameter #1 [ <required> $subject ]
132        Parameter #2 [ <optional> $limit ]
133        Parameter #3 [ <optional> $flags ]
134      }
135    }
136    Function [ <internal:pcre> function preg_quote ] {
137
138      - Parameters [2] {
139        Parameter #0 [ <required> $str ]
140        Parameter #1 [ <optional> $delim_char ]
141      }
142    }
143    Function [ <internal:pcre> function preg_grep ] {
144
145      - Parameters [3] {
146        Parameter #0 [ <required> $regex ]
147        Parameter #1 [ <required> $input ]
148        Parameter #2 [ <optional> $flags ]
149      }
150    }
151    Function [ <internal:pcre> function preg_last_error ] {
152
153      - Parameters [0] {
154      }
155    }
156  }
157}
158
159"
160Done
161