php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79594 Uncaught TypeError: preg_split() expects parameter 3 to be int, null given
Submitted: 2020-05-13 15:06 UTC Modified: 2020-05-13 15:21 UTC
From: vedad at kajtaz dot net Assigned: cmb (profile)
Status: Closed Package: PCRE related
PHP Version: 7.4.5 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 28 = ?
Subscribe to this entry?

 
 [2020-05-13 15:06 UTC] vedad at kajtaz dot net
Description:
------------
The preg_split documentation:

https://www.php.net/manual/en/function.preg-split.php

states:

> A limit of -1 or 0 means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter.

However, passing null with strict_type throws a \TypeError:

Uncaught TypeError: preg_split() expects parameter 3 to be int, null given


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-13 15:13 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: PCRE related
 [2020-05-13 15:21 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-05-13 15:21 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-05-13 15:22 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=b7ca52647b4b9e55079959d9202f58faaf3aea0b
Log: Fix #79594: Uncaught TypeError: preg_split() expects parameter 3 to be int, null given
 [2020-05-13 18:00 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=a0a6e555d2848727822bcc3dea2b29b077eb42ea
Log: Fix #79594: Uncaught TypeError: preg_split() expects parameter 3 to be int, null given
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=ad9d415f55340338a601e70e07041fabf60b7e98
Log: Fix #79594: Uncaught TypeError: preg_split() expects parameter 3 to be int, null given
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC