xref: /PHP-8.4/sapi/cli/tests/006.phpt (revision e23440e5)
1--TEST--
2show information about extension
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php
7include "skipif.inc";
8
9if (PCRE_JIT_SUPPORT == false) {
10    die ("skip not pcre jit support builtin");
11}
12?>
13--INI--
14date.timezone=UTC
15--FILE--
16<?php
17
18$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
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(46) "Exception: Extension "unknown" does not exist
28"
29string(39) "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 [ <persistent> int PREG_PATTERN_ORDER ] { 1 }
47    Constant [ <persistent> int PREG_SET_ORDER ] { 2 }
48    Constant [ <persistent> int PREG_OFFSET_CAPTURE ] { 256 }
49    Constant [ <persistent> int PREG_UNMATCHED_AS_NULL ] { 512 }
50    Constant [ <persistent> int PREG_SPLIT_NO_EMPTY ] { 1 }
51    Constant [ <persistent> int PREG_SPLIT_DELIM_CAPTURE ] { 2 }
52    Constant [ <persistent> int PREG_SPLIT_OFFSET_CAPTURE ] { 4 }
53    Constant [ <persistent> int PREG_GREP_INVERT ] { 1 }
54    Constant [ <persistent> int PREG_NO_ERROR ] { 0 }
55    Constant [ <persistent> int PREG_INTERNAL_ERROR ] { 1 }
56    Constant [ <persistent> int PREG_BACKTRACK_LIMIT_ERROR ] { 2 }
57    Constant [ <persistent> int PREG_RECURSION_LIMIT_ERROR ] { 3 }
58    Constant [ <persistent> int PREG_BAD_UTF8_ERROR ] { 4 }
59    Constant [ <persistent> int PREG_BAD_UTF8_OFFSET_ERROR ] { 5 }
60    Constant [ <persistent> int PREG_JIT_STACKLIMIT_ERROR ] { 6 }
61    Constant [ <persistent> string PCRE_VERSION ] { %s }
62    Constant [ <persistent> int PCRE_VERSION_MAJOR ] { %d }
63    Constant [ <persistent> int PCRE_VERSION_MINOR ] { %d }
64    Constant [ <persistent> bool PCRE_JIT_SUPPORT ] { %d }
65  }
66
67  - Functions {
68    Function [ <internal:pcre> function preg_match ] {
69
70      - Parameters [5] {
71        Parameter #0 [ <required> string $pattern ]
72        Parameter #1 [ <required> string $subject ]
73        Parameter #2 [ <optional> &$matches = null ]
74        Parameter #3 [ <optional> int $flags = 0 ]
75        Parameter #4 [ <optional> int $offset = 0 ]
76      }
77      - Return [ int|false ]
78    }
79    Function [ <internal:pcre> function preg_match_all ] {
80
81      - Parameters [5] {
82        Parameter #0 [ <required> string $pattern ]
83        Parameter #1 [ <required> string $subject ]
84        Parameter #2 [ <optional> &$matches = null ]
85        Parameter #3 [ <optional> int $flags = 0 ]
86        Parameter #4 [ <optional> int $offset = 0 ]
87      }
88      - Return [ int|false ]
89    }
90    Function [ <internal:pcre> function preg_replace ] {
91
92      - Parameters [5] {
93        Parameter #0 [ <required> array|string $pattern ]
94        Parameter #1 [ <required> array|string $replacement ]
95        Parameter #2 [ <required> array|string $subject ]
96        Parameter #3 [ <optional> int $limit = -1 ]
97        Parameter #4 [ <optional> &$count = null ]
98      }
99      - Return [ array|string|null ]
100    }
101    Function [ <internal:pcre> function preg_filter ] {
102
103      - Parameters [5] {
104        Parameter #0 [ <required> array|string $pattern ]
105        Parameter #1 [ <required> array|string $replacement ]
106        Parameter #2 [ <required> array|string $subject ]
107        Parameter #3 [ <optional> int $limit = -1 ]
108        Parameter #4 [ <optional> &$count = null ]
109      }
110      - Return [ array|string|null ]
111    }
112    Function [ <internal:pcre> function preg_replace_callback ] {
113
114      - Parameters [6] {
115        Parameter #0 [ <required> array|string $pattern ]
116        Parameter #1 [ <required> callable $callback ]
117        Parameter #2 [ <required> array|string $subject ]
118        Parameter #3 [ <optional> int $limit = -1 ]
119        Parameter #4 [ <optional> &$count = null ]
120        Parameter #5 [ <optional> int $flags = 0 ]
121      }
122      - Return [ array|string|null ]
123    }
124    Function [ <internal:pcre> function preg_replace_callback_array ] {
125
126      - Parameters [5] {
127        Parameter #0 [ <required> array $pattern ]
128        Parameter #1 [ <required> array|string $subject ]
129        Parameter #2 [ <optional> int $limit = -1 ]
130        Parameter #3 [ <optional> &$count = null ]
131        Parameter #4 [ <optional> int $flags = 0 ]
132      }
133      - Return [ array|string|null ]
134    }
135    Function [ <internal:pcre> function preg_split ] {
136
137      - Parameters [4] {
138        Parameter #0 [ <required> string $pattern ]
139        Parameter #1 [ <required> string $subject ]
140        Parameter #2 [ <optional> int $limit = -1 ]
141        Parameter #3 [ <optional> int $flags = 0 ]
142      }
143      - Return [ array|false ]
144    }
145    Function [ <internal:pcre> function preg_quote ] {
146
147      - Parameters [2] {
148        Parameter #0 [ <required> string $str ]
149        Parameter #1 [ <optional> ?string $delimiter = null ]
150      }
151      - Return [ string ]
152    }
153    Function [ <internal:pcre> function preg_grep ] {
154
155      - Parameters [3] {
156        Parameter #0 [ <required> string $pattern ]
157        Parameter #1 [ <required> array $array ]
158        Parameter #2 [ <optional> int $flags = 0 ]
159      }
160      - Return [ array|false ]
161    }
162    Function [ <internal:pcre> function preg_last_error ] {
163
164      - Parameters [0] {
165      }
166      - Return [ int ]
167    }
168    Function [ <internal:pcre> function preg_last_error_msg ] {
169
170      - Parameters [0] {
171      }
172      - Return [ string ]
173    }
174  }
175}
176
177"
178Done
179