<?php
$pattern = '/(\/.*)?\/img\/.*/i'
$s = [
'/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/665/0c2795fc83d114a5ab9840120a4249e4/4/xxl.jpg',
'/var/www/vb/admin/web/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/665/0c2795fc83d114a5ab9840120a4249e4/4/xxl.jpg',
'/var/www/vb/frontend/web/img/up/bf9b12de5ea78cecacd3dde69f2a72f8/665/0c2795fc83d114a5ab9840120a4249e4/4/xxl.jpg',
];
var_dump([
preg_match($pattern, $s[0]),
preg_match($pattern, $s[1]),
preg_match($pattern, $s[2]),
]);
- Output for 5.4.0 - 5.4.30
- Parse error: syntax error, unexpected '$s' (T_VARIABLE) in /in/pPBt7 on line 5
Process exited with code 255. - Output for 5.3.0 - 5.3.28
- Parse error: syntax error, unexpected T_VARIABLE in /in/pPBt7 on line 5
Process exited with code 255.
preferences:
227.52 ms | 1395 KiB | 67 Q