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