|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78336 Error compare zero with array[n]
Submitted: 2019-07-26 16:10 UTC Modified: 2019-07-26 16:13 UTC
From: lucastiagodemoraes at gmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 7.2.20 OS: Ubuntu 18.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: lucastiagodemoraes at gmail dot com
New email:
PHP Version: OS:


 [2019-07-26 16:10 UTC] lucastiagodemoraes at gmail dot com
Hi guys,
See example of bug you will understand. 
If this is normal in PHP is very strange. Thanks.

Test script:
$letters = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');

print 0 == $letters[0] ? $letters[0] : 'false';
print 0 == $letters[1] ? $letters[1] : 'false';
print 0 == $letters[2] ? $letters[2] : 'false';
print 0 == $letters[3] ? $letters[3] : 'false';
print 0 == $letters[4] ? $letters[4] : 'false';

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-26 16:13 UTC]
-Status: Open +Status: Not a bug
 [2019-07-26 16:13 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue May 24 02:05:45 2022 UTC