Providing an empty string is deprecated

Description

Calling ord() with an empty string is like calling it without an argument: it has nothing to work on.

Example

<?php

    ord('');

?>

Solutions

  • Remove the call ord() on empty string.

  • Check that the length of the string passed to ord() is 1.

  • Ensure that the string is in latin1 encoding: multi-byte strings will also lead to an error.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See emptyStringWithOrd.