Edit report at https://bugs.php.net/bug.php?id=51448&edit=1

 ID:               51448
 Updated by:       php-bugs@lists.php.net
 Reported by:      antonello dot mangone at gmail dot com
 Summary:          class and define problem
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          *General Issues
 Operating System: Sidux
 PHP Version:      5.3.2

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2010-05-12 16:33:40] m...@php.net

This should have been marked Feedback, shouldn't it?

------------------------------------------------------------------------
[2010-04-16 03:55:55] crrodriguez at opensuse dot org

Do you have any zend extension loaded ?

Provide the output of php -m

------------------------------------------------------------------------
[2010-03-31 18:16:02] antonello dot mangone at gmail dot com

Description:
------------
Using php 5.3.2-1 I tried the following code and I found probably a bug that I 
don't know if it is a problem of the define function or if it's a problem of 
php.
When I write the example 1, the first time the page print the echo message in 
the __construct. If I refresh the page the browser try to download or to open 
the php file.
If I modify something in the file or if I stop and then start the apache web 
server (apache2) the previous behaviour is repeated. 

The problem is related to de definition of the constant EXAMPLE and the 
assignment of this constant to the attribute $variabile of the class Test.

If as in the example 2 i define the constant EXAMPLE and then I set the 
property from the __construct method the problem is bypassed, but I think it 
should be solved.

Test script:
---------------
example 1
----------------------------------------------------------------------------------
define('EXAMPLE', 0);

class Test
{
    public $variabile = EXAMPLE;
    
    public function __construct()
    {
        echo "instance of Test class created";
    }
}

$newtest = new Test();


example 2
--------------------------------------------------------------------------------
define('EXAMPLE', 0);

class Test
{
    public $variabile = "";
    
    public function __construct()
    {
        $this->variabile = EXAMPLE;
        echo "instance of Test class created";
    }
}

$newtest = new Test();

Expected result:
----------------
example 2
--------------------------------------------------------------------------------
define('EXAMPLE', 0);

class Test
{
    public $variabile = "";
    
    public function __construct()
    {
        $this->variabile = EXAMPLE;
        echo "instance of Test class created";
    }
}

$newtest = new Test();



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=51448&edit=1

Reply via email to