Skip to content

ErrorException: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated #1070

@lazysteve2020

Description

@lazysteve2020

Bug description

ErrorException: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated
php-webdriver\webdriver\lib\Remote\HttpCommandExecutor.php:207

How could the issue be reproduced

$command = new WebDriverCommand(
      null,
      DriverCommand::NEW_SESSION,
      array('desiredCapabilities' => $desired_capabilities)
    );


   $command = new WebDriverCommand(
      '',
      DriverCommand::NEW_SESSION,
      array('desiredCapabilities' => $desired_capabilities)
    );

Expected behavior

ErrorException: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated
php-webdriver\webdriver\lib\Remote\HttpCommandExecutor.php:207

Php-webdriver version

115.0.5790.102

PHP version

8.1.21

How do you start the browser driver or Selenium server

driver

Selenium server / Selenium Docker image version

No response

Browser driver (chromedriver/geckodriver...) version

No response

Browser name and version

No response

Operating system

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions