mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-01 21:27:06 +00:00
Use nullable type declaration as supported in versions >= PHP 7.1 (#882)
This commit is contained in:
@@ -42,12 +42,7 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator
|
||||
* @param mixed[] $initial (optional) Existing array to convert.
|
||||
* @return CaseInsensitiveArray
|
||||
*/
|
||||
// TODO: Use a nullable type declaration when supported versions >= PHP 7.1.
|
||||
// Trying to use the nullable type declaration on PHP 7.0:
|
||||
// public function __construct(?array $initial = null)
|
||||
// results in:
|
||||
// ParseError: syntax error, unexpected '?', expecting variable (T_VARIABLE)
|
||||
public function __construct($initial = null)
|
||||
public function __construct(?array $initial = null)
|
||||
{
|
||||
if ($initial !== null) {
|
||||
foreach ($initial as $key => $value) {
|
||||
|
||||
Reference in New Issue
Block a user