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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 20:01:35 2025 UTC