OutOfRangeException vs. OutOfBoundsException

后端 未结 6 1939
我在风中等你
我在风中等你 2020-12-13 18:23

PHP defines two SPL exceptions for invalid keys:

OutOfRangeException: Exception thrown when an illegal index was requested. This represents errors that s

6条回答
  •  天涯浪人
    2020-12-13 18:53

    It is quite simple:

    OutOfRange mean "Your requested key is not within the index of a set defined in code."

    OutOfBounds means "Your requested key is not within the index of a set defined by loaded configuration."

提交回复
热议问题