Skip to content

Refactored Nikita's idea about converting fatal errors into exceptions #1095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Feb 19, 2015

Original proposal: https://wiki.php.net/rfc/engine_exceptions_for_php7

In addition:

  • Introduced abstract BaseException class as a parent for all other exception classes
  • Uncaught EngineException and ParseException lead to old error message (so we don't have to fix thausend tests)

Original proposal: https://wiki.php.net/rfc/engine_exceptions_for_php7

In addition:

  - Introduced abstract BaseException class as a parent for all other exception classes

  - Uncaught EngineException and ParseException lead to old error message (so we don't have to fix thausend tests)
* master: (21 commits)
  this line got accitentally dropped on merge
  Implemented AST pretty-printer
  update NEWS to match the actual stuff in 5.6.6
  update NEWS to match the actual stuff in 5.5.22
  update NEWS(add missing entry for the enchant fix, and reorder the entries a bit)
  fix typo in bug#
  update NEWS
  fix email format
  update NEWS
  update 5.6.6 release date in NEWS
  Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI)
  BFN
  fix test
  fix test
  fix test
  Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
  Updated NEWS
  add CVE
  5.4.39 next
  Fix associativity to match Perl
  ...
@smalyshev smalyshev added the RFC label Feb 19, 2015
);

$op2_free_unfetched = array(
"ANY" => "FREE_UNDETCHED_OP(opline->op2_type, opline->op2.var)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "UNDETCHED"

* master: (40 commits)
  Updated NEWS
  updated NEWS
  curl: add new proxy constants
  Fixed test fails for bug68557
  Fix bug #64695 (JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e)
  NEWS entry
  NEWS entry
  Fix bug #68166 We can't always efree here php_escape_html_entities can return an interned_empty_string
  Fix bug #68166 We can't always efree here php_escape_html_entities can return an interned_empty_string
  updated NEWS
  updated NEWS
  Fix Win32 SSPI initialization for digest authentication in cURL
  correct title
  Fixed segfault because resource is freed prematurely
  Only do this in debug build
  Fixed mem issue with internal return type hinting assert
  removed duplicated code
  revisit fix for bug #65272
  Fixed test fails for bug68557
  Cleanup globals initialization
  ...
This reverts commit 5f64ee5.
@Majkl578
Copy link
Contributor

Isn't there any better name than BaseException? That really sounds a bit weird and hackish.
Not to mention it's a BC break for a lot of non-namespaced code: https://github.com/search?l=php&p=1&q=BaseException+&type=Code&utf8=%E2%9C%93.
Also I can't find this in "BC break" section of the RFC.

@dstogov
Copy link
Member Author

dstogov commented Feb 24, 2015

Any new name may break something and the more intuitive the name the more
it may break :(
better name is welcome.

On Tue, Feb 24, 2015 at 1:46 PM, Michael Moravec notifications@github.com
wrote:

Isn't there any better name than BaseException? That really sounds a
bit weird and hackish.
Not to mention it's a BC break for a lot of non-namespaced code:
https://github.com/search?l=php&p=1&q=BaseException+&type=Code&utf8=%E2%9C%93
.
Also I can't find this in "BC break" section of the RFC.


Reply to this email directly or view it on GitHub
#1095 (comment).

@staabm
Copy link
Contributor

staabm commented Feb 24, 2015

Could those Exception be moved into a namespace?

* master:
  Make zend_array_destroy() to free the corresponding zend_array
  Eliminate check on the fast path
  Make current() and key() receive argument by value.
  Use Firebird default home folder, replace Interbase with Firebird

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
* master:
  Split INIT_FCALL_BY_NAME inti INIT_FCALL_BY_NAME(CONST+STRING) and INIT_DYNAMIC_CALL(CONST-STRING|TMPVAR|CV)
  Support list($a, $b) = $a
  Avoid unnecassary check

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
* master:
  Use cache_slot offsets instead of indexes (simplify run-time instructions)
* master:
  Added specialized versions of DO_FCALL handler:   DO_ICALL - for internal functions   DO_UCALL - for user functions   DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
@dstogov
Copy link
Member Author

dstogov commented Feb 26, 2015

On Tue, Feb 24, 2015 at 2:01 PM, Markus Staab notifications@github.com
wrote:

Could those Exception be moved into a namespace?

In general they can, but we didn't use namespaces in the core before.
Using it for exceptions only is a bit inconsistent, but may be we should
start.

Thanks. Dmitry.


Reply to this email directly or view it on GitHub
#1095 (comment).

* master:
  Improved ASSIGN_DIM handler
  Don't inline slow path
  Revert a part committted by mistake
  Fixed compilation warnings
  Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
  better name
  Improve fix for #69038
  Update NEWs
  Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage)
@mleko
Copy link

mleko commented Mar 1, 2015

Could BaseException be changed from abstract class to interface? Name: Throwable?

@Majkl578
Copy link
Contributor

Majkl578 commented Mar 1, 2015

@mleko: 💯 I wanted to suggest it as well.

@Maks3w
Copy link

Maks3w commented Mar 1, 2015

@mleko +1 For BaseException as interface instance class. ExceptionInterface could be the name

dstogov added 2 commits March 2, 2015 10:40
* master:
  Fixed C++ support
  Fixed bug #69115 crash in mail
  Reorder
  Update NEWs
  Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build)
  Update News
  Fixed bug #69125 (Array numeric string as key)
  fix bug#68942's patch
  Fixed ability to build unspecialized executor
  Fixed bug #69124 (method name could not be used when by ref)
  Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
  Fixed a bug that header value is not terminated by '\0' when accessed through getenv().

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	Zend/zend_vm_gen.php
* master: (100 commits)
  Avoid repeatable strlen() calls
  Unused var
  Minimize copying of HashTable realocation
  Error also maybe happened here
  Avoid useless op_array duplication
  Revert commit to zend signal by mistake
  fix incompatible pointer
  Update NEWs
  Fixed bug #69174 (leaks when unused inner class use traits precedence)
  Revive Zend Signals handler (and fixed bug #61083)
  This test fails with multibyte on because it spews a conversion error on the bogus file
  This test fails with multibyte on because it spews a conversion error on the bogus file
  Remove the unused vars
  Fixed bug #68265 (SAN match fails with trailing DNS dot)
  Fixed bug #68879 (IP Address fields in subjectAltNames not used)
  Fix broken test
  Use strpprintf
  Use a deprecated function that still exists.
  Remove unnecessary debug warning (that also broke tests).
  Explicitly depend opcache on pcre.
  ...
@nikic
Copy link
Member

nikic commented Mar 9, 2015

Merged via 1c94ff0.

@nikic nikic closed this Mar 9, 2015
@Kubo2
Copy link
Contributor

Kubo2 commented Mar 10, 2015

@Majkl578, @mleko 👍

@dstogov dstogov deleted the exception branch October 14, 2019 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants