|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-05-09 04:13 UTC] microcamers at hotmail dot com
Description: ------------ Can you make it possible to make most fatal errors catchable, such as the ones for undefined functions, classes, redefined things and so on. Generally make it so any error that can be caught can be caught. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 15:00:01 2025 UTC |
+1 from my side. Mixing and matching expressions with fatals and return-0-checks is evil and clutters the code. Rationale: At least methods on non-objects can happen when you come from javascript or similar scripting communities which encourage chaining/nesting calls to more or less human-readable commands like $granny_name = $baby->getMother()->getMother()->getName(); In PHP you would rather do $mother = $baby->getMother(); if ($mother) { $granny = $mother->getMother(); if ($granny) { $granny_name = $granny->getName(); } } A comment would be welcome if such a patch would generally be apreciated or you want to keep this fatal as a design decision. If the change is welcome, i'll see if I can provide a patch.