<?php
$pattern = '/-/';
if (rand(0,1)) {
$pattern = 'foo';
}
var_dump(preg_split($pattern, '', '-1', PREG_SPLIT_NO_EMPTY));
- Output for 8.4.2 - 8.4.4
- Warning: preg_split(): Delimiter must not be alphanumeric, backslash, or NUL byte in /in/495b1 on line 7
bool(false)
- Output for 8.2.0 - 8.2.4, 8.2.9, 8.2.13, 8.2.17, 8.2.19, 8.2.22, 8.2.25, 8.2.27, 8.3.2, 8.3.4, 8.3.6 - 8.3.9, 8.3.11 - 8.3.12, 8.3.14, 8.3.16 - 8.3.17, 8.4.1
- array(0) {
}
- Output for 8.2.5 - 8.2.8, 8.2.10 - 8.2.12, 8.2.14 - 8.2.16, 8.2.18, 8.2.20 - 8.2.21, 8.2.23 - 8.2.24, 8.2.26, 8.3.0 - 8.3.1, 8.3.3, 8.3.5, 8.3.10, 8.3.13, 8.3.15
- Warning: preg_split(): Delimiter must not be alphanumeric, backslash, or NUL in /in/495b1 on line 7
bool(false)
preferences:
51.64 ms | 410 KiB | 5 Q