php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33280 range() stops script without error when used in delcaring class member variable
Submitted: 2005-06-08 23:50 UTC Modified: 2005-06-09 01:27 UTC
From: phpbugs at s8 dot org Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.10 OS: Linux 2.4.29
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at s8 dot org
New email:
PHP Version: OS:

 

 [2005-06-08 23:50 UTC] phpbugs at s8 dot org
Description:
------------
When defining the initial value of a member variable of a class using the range () function, the php script does not execute and no error message is displayed. (I triple-checked that display_errors was set to true.) If I take cut the line using range and move it outside of the class definition (and remove the var keyword as well) the script executes normally.

Reproduce code:
---------------
print ( "Hello" );
class test
{
        var $test = array ( 1,2,3,4,5 );
        var $test_too = range ( 1, 5 );
}
print ( " World!" );






Expected result:
----------------
"Hello World!" is printed out.

Actual result:
--------------
Blank page. No error messages, nothing. I don't even see "Hello" printed to the screen.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-09 01:27 UTC] iliaa@php.net
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

The code you've shown is invalid, you cannot set default property values based on output of functions.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC