Consolidate InvalidOperationException for operators
commit6a4a5af03cf27a9a582f7a3a0929130f2a2a7d30
authorKaty Voor <voork@fb.com>
Tue, 2 Feb 2021 04:25:19 +0000 (1 20:25 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Feb 2021 04:37:29 +0000 (1 20:37 -0800)
tree7d613cde9846f978dbdcbb6f6e08c28b668c974d
parent80bdf253c76c1a16b4f8592475963d6a9e3716c9
Consolidate InvalidOperationException for operators

Summary:
- Seems unnecessary to special case mul, sub, etc. operators from add
- consolidates them to throw the InvalidOperationException that add was throwing instead of ExtendedException (we don't seem to utilize that it is an ExtendedException and can carry a php stack trace).
- main difference is InvalidOperationException can be caught while ExtendedException is a fatal. Either these errors should all throw exceptions or all fatal. **RFC** Is there a reason to do one over the other? Is there a reason we are special casing add?

Reviewed By: ricklavoie

Differential Revision: D26185308

fbshipit-source-id: e822b923ede1a344b4e1d5fb1714eb84f5530c69
12 files changed:
hphp/runtime/base/array-data.cpp
hphp/runtime/base/array-data.h
hphp/runtime/base/tv-arith.cpp
hphp/test/slow/hack_arr_compat/add.php.expectf
hphp/test/slow/hack_arr_compat/split_misc_notices.php.expectf
hphp/test/slow/hack_arr_compat/split_misc_notices_2.php.expectf
hphp/test/zend/good/Zend/tests/add_003.php.expectf
hphp/test/zend/good/Zend/tests/add_004.php.expectf
hphp/test/zend/good/Zend/tests/add_007.php.expectf
hphp/test/zend/good/Zend/tests/div_002.php.expectf
hphp/test/zend/good/Zend/tests/mul_001.php.expectf
hphp/test/zend/good/Zend/tests/sub_001.php.expectf