3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "\n** warning about bad pattern AND bad parameter: **\n"; var_dump(preg_match('bad pattern', null)); echo "\n** warning about bad pattern only: **\n"; var_dump(preg_match('bad pattern', '')); echo "\n** suppressed warnings: **\n"; var_dump(@preg_match('bad pattern', ''));
Output for 8.4.1 - 8.4.14, 8.5.0
** warning about bad pattern AND bad parameter: ** Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/5YI6t on line 4 Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL byte in /in/5YI6t on line 4 bool(false) ** warning about bad pattern only: ** Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL byte in /in/5YI6t on line 7 bool(false) ** suppressed warnings: ** bool(false)
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28
** warning about bad pattern AND bad parameter: ** Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/5YI6t on line 4 Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /in/5YI6t on line 4 bool(false) ** warning about bad pattern only: ** Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /in/5YI6t on line 7 bool(false) ** suppressed warnings: ** bool(false)
Output for 8.1.0 - 8.1.33
** warning about bad pattern AND bad parameter: ** Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/5YI6t on line 4 Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/5YI6t on line 4 bool(false) ** warning about bad pattern only: ** Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/5YI6t on line 7 bool(false) ** suppressed warnings: ** bool(false)

preferences:
115.85 ms | 412 KiB | 5 Q