doc-en
doc-en copied to clipboard
Wrong Example in SplFixedArray docs
From manual page: https://php.net/class.splfixedarray
In the example of SplFixedArray Example #1 SplFixedArray usage example
, you state that the following code will give RuntimeException
but what it is actually throws is TypeError
. So, the catch
part will never executed.
// The following lines throw a RuntimeException: Index invalid or out of range
try {
var_dump($array["non-numeric"]);
} catch(RuntimeException $re) {
echo "RuntimeException: ".$re->getMessage()."\n";
}