php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30292 Undefined array variable gives a problem with the output
Submitted: 2004-09-30 15:03 UTC Modified: 2004-10-31 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: devish at zonnet dot nl Assigned:
Status: No Feedback Package: Output Control
PHP Version: 5.0.1 OS: Windows XP
Private report: No CVE-ID: None
 [2004-09-30 15:03 UTC] devish at zonnet dot nl
Description:
------------
When declaring an array but don't initialize it, it stops running the script. When declaring a normal variable it will just produce a Undefined variable notice.

In the reproduce code it will not print "hello"

Offcourse this sort of code is rearly used, but the reason for reporting this is that it doesn't report a notice or any warning.

Im running Win XP, with Apache 2.0 and only have one extension in my php.ini (the mysql extension)



Reproduce code:
---------------
<?php
error_reporting(E_ALL);

$int[];

print "hello";
?>

Expected result:
----------------
I expect:
Notice: Undefined variable: int in E:\www-root\sqlite\test.php on line 4
hello

I See:
white screen


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-30 15:16 UTC] tony2001@php.net
You will not get a notice here, but a parse error, because this syntax is not valid. 
Set display_errors to "on" and you should see it.
 [2004-09-30 17:22 UTC] devish at zonnet dot nl
I was first thinking of that to, but that wasn't it.

A qoute out of my php.ini

error_reporting  =  E_ALL

; Print out errors (as a part of the output).  For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below).  Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On
 [2004-10-01 10:27 UTC] devish at zonnet dot nl
display errors on does not help. It is on in my php.ini.
 [2004-10-23 16:25 UTC] tony2001@php.net
Try to run the same code using PHP-CLI (php.exe).
 [2004-10-31 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC