note 123415 added to sqlite3.enableexceptions

From: Date: Tue, 11 Dec 2018 01:51:12 +0000
Subject: note 123415 added to sqlite3.enableexceptions
Groups: php.notes 
Request: Send a blank email to php-notes+get-209868@lists.php.net to get a copy of this message
Be sure to note the poorly chosen name and default value. The following snippet does not throw an exception, despite calling a function with the name "enableExceptions" immediately prior to the bad query. <?php $sqlite = new SQLite3('test.tmp'); $sqlite->enableExceptions(); $sqlite->exec('invalid query'); echo 'code still running since no exception was thrown'; ?> Note that this is still error-prone if the passed value is false. One is likely to read "enableExceptions" and ignore the parameter list since the function name conveys a strong (but incorrect) meaning. ---- Server IP: 208.43.231.9 Probable Submitter: 47.55.94.90 ---- Manual Page -- http://php.net/manual/en/sqlite3.enableexceptions.php Edit -- https://master.php.net/note/edit/123415 Del: integrated -- https://master.php.net/note/delete/123415/integrated Del: useless -- https://master.php.net/note/delete/123415/useless Del: bad code -- https://master.php.net/note/delete/123415/bad+code Del: spam -- https://master.php.net/note/delete/123415/spam Del: non-english -- https://master.php.net/note/delete/123415/non-english Del: in docs -- https://master.php.net/note/delete/123415/in+docs Del: other reasons-- https://master.php.net/note/delete/123415 Reject -- https://master.php.net/note/reject/123415 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209868) next »