must be greater than 0

Description

This error is reported when a parameter is expected to be an integer, strictly positive. This is the case with the second argument of str_split().

Example

<?php
  str_split('abc', 0);
?>

Literal Examples

  • str_split(): Argument #2 ($length) must be greater than 0

Solutions

  • Use a valid value for the parameter: a positive and non zero integer, for example 1, 2, 3…

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See ` <https://php-changed-behaviors.readthedocs.io/en/latest/behavior/.html>`_.