Skip to content

Initialized array in class causes SIGSEGV #143

@pbiggar

Description

@pbiggar
What steps will reproduce the problem?
1. Compile phc -c myclass.php -o myclass
2.Execute

What is the expected output? What do you see instead?

SIGSEGV error

What version of the product are you using? On what operating system?

0.2.0 on FreeBSD 7.0

Please provide any additional information below.


This code is an example. Initializing the array in the constructor eliminates the problem.
But it was very difficult to isolate the problem.

<?
/*
        my_class.php
*/
        class foobar {
                var $stuff = array (
                        'foo' => 1,
                        'bar' => 2
                );
                function foobar() {
                        // empty constructor
                }
        }
        $foobar = new foobar;

        foreach ($foobar->stuff as $key => $val)
                echo "$key => $val\n";
?>

Original issue reported on code.google.com by dennis.etinc on 2011-06-23 12:02:12

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions