Bug #52928 [Opn]: Segfault using parent::_construct

From: Date: Mon, 27 Sep 2010 02:24:04 +0000
Subject: Bug #52928 [Opn]: Segfault using parent::_construct
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-154653@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52928&edit=1

 ID:                 52928
 Updated by:         cataphract@php.net
 Reported by:        M8R-nheyum at mailinator dot com
 Summary:            Segfault using parent::_construct
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   CentOS release 4.8
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

Stack overflow on Windows, trunk.


Previous Comments:
------------------------------------------------------------------------
[2010-09-27 02:26:56] felipe@php.net

This is causing an infinite recursion, but works fine on 5.2.15-dev.

------------------------------------------------------------------------
[2010-09-27 01:14:54] M8R-nheyum at mailinator dot com

Description:
------------
When calling parent::__construct using call_user_func_array, a segfault
occurs. 
Script to reproduce attached below.

This worked in 5.2.14.

Expected: instantiation of class
Actual: segfault

Notes: Only occurs with multiple nesting levels. A single level doesn't
cause 
this.

Test script:
---------------
<?

class baseA{
        function foo(){
                return 'bar';
        }

        function __construct(){
                foo();
        }
}
class baseB extends baseA  {
    function __construct(){
        $args = func_get_args();
        call_user_func_array(array($this, 'parent::__construct'),
$args);
    }

        }


class demo extends baseB{
    function __construct(){
        $args = func_get_args();
        call_user_func_array(array($this, 'parent::__construct'),
$args);
    }
}

$z = new demo('d');
?>

Expected result:
----------------
instantiation of class

Actual result:
--------------
segfault. 


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



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


Thread (5 messages)

« previous php.bugs (#154653) next »