Doc #62145 [Opn->Nab]: strpos returns null instead of false

From: Date: Fri, 25 May 2012 01:58:39 +0000
Subject: Doc #62145 [Opn->Nab]: strpos returns null instead of false
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8395@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62145&edit=1 ID: 62145 Updated by: laruence@php.net Reported by: maddok01 at hotmail dot com Summary: strpos returns null instead of false -Status: Open +Status: Not a bug Type: Documentation Problem Package: *General Issues Operating System: linux hardy PHP Version: 5.3.13 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php not found and invalid argument are differenet. Previous Comments: ------------------------------------------------------------------------ [2012-05-24 20:19:31] maddok01 at hotmail dot com Description: ------------ --- From manual page: http://www.php.net/function.strpos#refsect1-function.strpos-returnvalues --- If the input to strpos is invalid the function used to return false. Now it returns null. Null is not a documented return value for this function. Test script: --------------- php -r 'var_export( @strpos( array( "" ), "test", 0 ) );echo "\n";' Before php 5.3 false After PHP 5.3 NULL Expected result: ---------------- false Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62145&edit=1

« previous php.doc.bugs (#8395) next »