note 125049 added to class.outofrangeexception
| From: | Free@php.net | Date: | Tue, 26 May 2020 17:54:02 +0000 |
| Subject: | note 125049 added to class.outofrangeexception | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214682@lists.php.net to get a copy of this message | ||
I tried to write a snippet that would be detected at compile time, but was unable, apparently due to
my PHP engine's interpreted nature. The creator(s) should have provided a usage example (for
end-users) or pointed to PHP sources for an example of where/how it's used. None of the
provided examples, to date, reflect an exception detected at compile time, as this class asserts.
IMO it's hopeful at best to expect a compiler to detect an illegal index in a
dynamically-typed, typically JIT-executed, enviro. Since when is there a strict contract of what
indexes should be considered "within range" and how would the compiler know about this
contract? Also, how would we try/catch that in the compile phase?
SPL also provides the OutOfBounds exception. If this class, its parent, and OOB have little
distinction, then does SPL need all 3?
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 73.217.122.241)
----
Manual Page -- http://php.net/manual/en/class.outofrangeexception.php
Edit -- https://master.php.net/note/edit/125049
Del: integrated -- https://master.php.net/note/delete/125049/integrated
Del: useless -- https://master.php.net/note/delete/125049/useless
Del: bad code -- https://master.php.net/note/delete/125049/bad+code
Del: spam -- https://master.php.net/note/delete/125049/spam
Del: non-english -- https://master.php.net/note/delete/125049/non-english
Del: in docs -- https://master.php.net/note/delete/125049/in+docs
Del: other reasons-- https://master.php.net/note/delete/125049
Reject -- https://master.php.net/note/reject/125049
Search -- https://master.php.net/manage/user-notes.php