note 109689 deleted from function.include by peehaa

From: Date: Fri, 09 Dec 2016 22:48:33 +0000
Subject: note 109689 deleted from function.include by peehaa
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-208389@lists.php.net to get a copy of this message
Note Submitter: brett dot jr dot alton at gmail dot com ---- You need to test to see if include() is equal to 1 to see if it's successful. For some reason it tests success instead of failure. So to test if the include failed, you need to test like this: <?php if ((include 'inc/db.php') !== 1) { die('Include failed.'); } ?> The docs say to test against 'OK', which is incorrect, as the return value is int(1);

« previous php.notes (#208389) next »