xref: /PHP-7.4/sapi/cli/tests/006.phpt (revision b32b8e91)
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 [6] {
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        Parameter #5 [ <optional> $flags ]
107      }
108    }
109    Function [ <internal:pcre> function preg_replace_callback_array ] {
110
111      - Parameters [5] {
112        Parameter #0 [ <required> $pattern ]
113        Parameter #1 [ <required> $subject ]
114        Parameter #2 [ <optional> $limit ]
115        Parameter #3 [ <optional> &$count ]
116        Parameter #4 [ <optional> $flags ]
117      }
118    }
119    Function [ <internal:pcre> function preg_filter ] {
120
121      - Parameters [5] {
122        Parameter #0 [ <required> $regex ]
123        Parameter #1 [ <required> $replace ]
124        Parameter #2 [ <required> $subject ]
125        Parameter #3 [ <optional> $limit ]
126        Parameter #4 [ <optional> &$count ]
127      }
128    }
129    Function [ <internal:pcre> function preg_split ] {
130
131      - Parameters [4] {
132        Parameter #0 [ <required> $pattern ]
133        Parameter #1 [ <required> $subject ]
134        Parameter #2 [ <optional> $limit ]
135        Parameter #3 [ <optional> $flags ]
136      }
137    }
138    Function [ <internal:pcre> function preg_quote ] {
139
140      - Parameters [2] {
141        Parameter #0 [ <required> $str ]
142        Parameter #1 [ <optional> $delim_char ]
143      }
144    }
145    Function [ <internal:pcre> function preg_grep ] {
146
147      - Parameters [3] {
148        Parameter #0 [ <required> $regex ]
149        Parameter #1 [ <required> $input ]
150        Parameter #2 [ <optional> $flags ]
151      }
152    }
153    Function [ <internal:pcre> function preg_last_error ] {
154
155      - Parameters [0] {
156      }
157    }
158  }
159}
160
161"
162Done
163