@@ -26,12 +26,12 @@ public function match($pathinfo)
2626 $ pathinfo = rawurldecode ($ pathinfo );
2727
2828 // foo
29- if (0 === strpos ($ pathinfo , '/foo ' ) && preg_match ('#^/foo/(?<bar>baz|symfony)$#s ' , $ pathinfo , $ matches )) {
29+ if (0 === strpos ($ pathinfo , '/foo ' ) && preg_match ('#^/foo/(?P <bar>baz|symfony)$#s ' , $ pathinfo , $ matches )) {
3030 return array_merge ($ this ->mergeDefaults ($ matches , array ( 'def ' => 'test ' ,)), array ('_route ' => 'foo ' ));
3131 }
3232
3333 // bar
34- if (0 === strpos ($ pathinfo , '/bar ' ) && preg_match ('#^/bar/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
34+ if (0 === strpos ($ pathinfo , '/bar ' ) && preg_match ('#^/bar/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
3535 if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
3636 $ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
3737 goto not_bar;
@@ -44,7 +44,7 @@ public function match($pathinfo)
4444 not_bar:
4545
4646 // barhead
47- if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
47+ if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
4848 if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
4949 $ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
5050 goto not_barhead;
@@ -76,7 +76,7 @@ public function match($pathinfo)
7676 }
7777
7878 // baz4
79- if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?<foo>[^/]+)/?$#s ' , $ pathinfo , $ matches )) {
79+ if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?P <foo>[^/]+)/?$#s ' , $ pathinfo , $ matches )) {
8080 if (substr ($ pathinfo , -1 ) !== '/ ' ) {
8181 return $ this ->redirect ($ pathinfo .'/ ' , 'baz4 ' );
8282 }
@@ -87,7 +87,7 @@ public function match($pathinfo)
8787 }
8888
8989 // baz5
90- if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?<foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
90+ if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?P <foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
9191 if ($ this ->context ->getMethod () != 'POST ' ) {
9292 $ allow [] = 'POST ' ;
9393 goto not_baz5;
@@ -100,7 +100,7 @@ public function match($pathinfo)
100100 not_baz5:
101101
102102 // baz.baz6
103- if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?<foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
103+ if (0 === strpos ($ pathinfo , '/test ' ) && preg_match ('#^/test/(?P <foo>[^/]+)/$#s ' , $ pathinfo , $ matches )) {
104104 if ($ this ->context ->getMethod () != 'PUT ' ) {
105105 $ allow [] = 'PUT ' ;
106106 goto not_bazbaz6;
@@ -118,7 +118,7 @@ public function match($pathinfo)
118118 }
119119
120120 // quoter
121- if (preg_match ('#^/(?<quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
121+ if (preg_match ('#^/(?P <quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
122122 $ matches ['_route ' ] = 'quoter ' ;
123123
124124 return $ matches ;
@@ -132,14 +132,14 @@ public function match($pathinfo)
132132 if (0 === strpos ($ pathinfo , '/a ' )) {
133133 if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
134134 // foo1
135- if (preg_match ('#^/a/b \'b/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
135+ if (preg_match ('#^/a/b \'b/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
136136 $ matches ['_route ' ] = 'foo1 ' ;
137137
138138 return $ matches ;
139139 }
140140
141141 // bar1
142- if (preg_match ('#^/a/b \'b/(?<bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
142+ if (preg_match ('#^/a/b \'b/(?P <bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
143143 $ matches ['_route ' ] = 'bar1 ' ;
144144
145145 return $ matches ;
@@ -148,22 +148,22 @@ public function match($pathinfo)
148148 }
149149
150150 // overridden
151- if (preg_match ('#^/a/(?<var>.*)$#s ' , $ pathinfo , $ matches )) {
151+ if (preg_match ('#^/a/(?P <var>.*)$#s ' , $ pathinfo , $ matches )) {
152152 $ matches ['_route ' ] = 'overridden ' ;
153153
154154 return $ matches ;
155155 }
156156
157157 if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
158158 // foo2
159- if (preg_match ('#^/a/b \'b/(?<foo1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
159+ if (preg_match ('#^/a/b \'b/(?P <foo1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
160160 $ matches ['_route ' ] = 'foo2 ' ;
161161
162162 return $ matches ;
163163 }
164164
165165 // bar2
166- if (preg_match ('#^/a/b \'b/(?<bar1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
166+ if (preg_match ('#^/a/b \'b/(?P <bar1>[^/]+)$#s ' , $ pathinfo , $ matches )) {
167167 $ matches ['_route ' ] = 'bar2 ' ;
168168
169169 return $ matches ;
@@ -175,7 +175,7 @@ public function match($pathinfo)
175175
176176 if (0 === strpos ($ pathinfo , '/multi ' )) {
177177 // helloWorld
178- if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?<who>[^/]+))?$#s ' , $ pathinfo , $ matches )) {
178+ if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P <who>[^/]+))?$#s ' , $ pathinfo , $ matches )) {
179179 return array_merge ($ this ->mergeDefaults ($ matches , array ( 'who ' => 'World! ' ,)), array ('_route ' => 'helloWorld ' ));
180180 }
181181
@@ -196,14 +196,14 @@ public function match($pathinfo)
196196 }
197197
198198 // foo3
199- if (preg_match ('#^/(?<_locale>[^/]+)/b/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
199+ if (preg_match ('#^/(?P <_locale>[^/]+)/b/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
200200 $ matches ['_route ' ] = 'foo3 ' ;
201201
202202 return $ matches ;
203203 }
204204
205205 // bar3
206- if (preg_match ('#^/(?<_locale>[^/]+)/b/(?<bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
206+ if (preg_match ('#^/(?P <_locale>[^/]+)/b/(?P <bar>[^/]+)$#s ' , $ pathinfo , $ matches )) {
207207 $ matches ['_route ' ] = 'bar3 ' ;
208208
209209 return $ matches ;
@@ -215,7 +215,7 @@ public function match($pathinfo)
215215 }
216216
217217 // foo4
218- if (0 === strpos ($ pathinfo , '/aba ' ) && preg_match ('#^/aba/(?<foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
218+ if (0 === strpos ($ pathinfo , '/aba ' ) && preg_match ('#^/aba/(?P <foo>[^/]+)$#s ' , $ pathinfo , $ matches )) {
219219 $ matches ['_route ' ] = 'foo4 ' ;
220220
221221 return $ matches ;
@@ -229,14 +229,14 @@ public function match($pathinfo)
229229
230230 if (0 === strpos ($ pathinfo , '/a/b ' )) {
231231 // b
232- if (preg_match ('#^/a/b/(?<var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
232+ if (preg_match ('#^/a/b/(?P <var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
233233 $ matches ['_route ' ] = 'b ' ;
234234
235235 return $ matches ;
236236 }
237237
238238 // c
239- if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?<var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
239+ if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P <var>[^/]+)$#s ' , $ pathinfo , $ matches )) {
240240 $ matches ['_route ' ] = 'c ' ;
241241
242242 return $ matches ;
0 commit comments