xref: /PHP-7.1/sapi/cli/tests/006.phpt (revision 7af945e2)
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 [15] {
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_SPLIT_NO_EMPTY ] { 1 }
47    Constant [ integer PREG_SPLIT_DELIM_CAPTURE ] { 2 }
48    Constant [ integer PREG_SPLIT_OFFSET_CAPTURE ] { 4 }
49    Constant [ integer PREG_GREP_INVERT ] { 1 }
50    Constant [ integer PREG_NO_ERROR ] { 0 }
51    Constant [ integer PREG_INTERNAL_ERROR ] { 1 }
52    Constant [ integer PREG_BACKTRACK_LIMIT_ERROR ] { 2 }
53    Constant [ integer PREG_RECURSION_LIMIT_ERROR ] { 3 }
54    Constant [ integer PREG_BAD_UTF8_ERROR ] { 4 }
55    Constant [ integer PREG_BAD_UTF8_OFFSET_ERROR ] { 5 }
56    Constant [ integer PREG_JIT_STACKLIMIT_ERROR ] { 6 }
57    Constant [ string PCRE_VERSION ] { %s }
58  }
59
60  - Functions {
61    Function [ <internal:pcre> function preg_match ] {
62
63      - Parameters [5] {
64        Parameter #0 [ <required> $pattern ]
65        Parameter #1 [ <required> $subject ]
66        Parameter #2 [ <optional> &$subpatterns ]
67        Parameter #3 [ <optional> $flags ]
68        Parameter #4 [ <optional> $offset ]
69      }
70    }
71    Function [ <internal:pcre> function preg_match_all ] {
72
73      - Parameters [5] {
74        Parameter #0 [ <required> $pattern ]
75        Parameter #1 [ <required> $subject ]
76        Parameter #2 [ <optional> &$subpatterns ]
77        Parameter #3 [ <optional> $flags ]
78        Parameter #4 [ <optional> $offset ]
79      }
80    }
81    Function [ <internal:pcre> function preg_replace ] {
82
83      - Parameters [5] {
84        Parameter #0 [ <required> $regex ]
85        Parameter #1 [ <required> $replace ]
86        Parameter #2 [ <required> $subject ]
87        Parameter #3 [ <optional> $limit ]
88        Parameter #4 [ <optional> &$count ]
89      }
90    }
91    Function [ <internal:pcre> function preg_replace_callback ] {
92
93      - Parameters [5] {
94        Parameter #0 [ <required> $regex ]
95        Parameter #1 [ <required> $callback ]
96        Parameter #2 [ <required> $subject ]
97        Parameter #3 [ <optional> $limit ]
98        Parameter #4 [ <optional> &$count ]
99      }
100    }
101    Function [ <internal:pcre> function preg_replace_callback_array ] {
102
103      - Parameters [4] {
104        Parameter #0 [ <required> $pattern ]
105        Parameter #1 [ <required> $subject ]
106        Parameter #2 [ <optional> $limit ]
107        Parameter #3 [ <optional> &$count ]
108      }
109    }
110    Function [ <internal:pcre> function preg_filter ] {
111
112      - Parameters [5] {
113        Parameter #0 [ <required> $regex ]
114        Parameter #1 [ <required> $replace ]
115        Parameter #2 [ <required> $subject ]
116        Parameter #3 [ <optional> $limit ]
117        Parameter #4 [ <optional> &$count ]
118      }
119    }
120    Function [ <internal:pcre> function preg_split ] {
121
122      - Parameters [4] {
123        Parameter #0 [ <required> $pattern ]
124        Parameter #1 [ <required> $subject ]
125        Parameter #2 [ <optional> $limit ]
126        Parameter #3 [ <optional> $flags ]
127      }
128    }
129    Function [ <internal:pcre> function preg_quote ] {
130
131      - Parameters [2] {
132        Parameter #0 [ <required> $str ]
133        Parameter #1 [ <optional> $delim_char ]
134      }
135    }
136    Function [ <internal:pcre> function preg_grep ] {
137
138      - Parameters [3] {
139        Parameter #0 [ <required> $regex ]
140        Parameter #1 [ <required> $input ]
141        Parameter #2 [ <optional> $flags ]
142      }
143    }
144    Function [ <internal:pcre> function preg_last_error ] {
145
146      - Parameters [0] {
147      }
148    }
149  }
150}
151
152"
153Done
154