php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29828 Interfaces no longer work
Submitted: 2004-08-25 01:52 UTC Modified: 2004-08-27 00:48 UTC
From: jellybob at gmail dot com Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.1 OS: *
Private report: No CVE-ID: None
 [2004-08-25 01:52 UTC] jellybob at gmail dot com
Description:
------------
It appears that attempting to implement any interface when creating a class will cause PHP to segfault.

Reproduce code:
---------------
<?php
interface Blah {
    public function blah();
}

class BlahMore implements Blah {
    public function blah() {
        echo "Hello, world!";  
    }
}

$obj = new BlahMore();
$obj->blah();
?>

Expected result:
----------------
Hello, world!

Actual result:
--------------
jon@bertha:~/php-5.0.1> php ~/test.php
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-25 08:29 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2004-08-25 09:55 UTC] derick@php.net
You mention on your website that it was Zend Optimizer, so bogussing this report. Please add those comments yourself next time as not all PHP developers are monitoring your website.
 [2004-08-26 23:57 UTC] helly@php.net
Apart from the SEGV based on Zend Optimizer the Bug report shows another problem. The code is not working at all in 5.* and that is not becasue of the Optimizer.

The problem is that the interface has a function with the name of the interface itself. This is an old style constructor which is not allowed for interfaces.
 [2004-08-27 00:02 UTC] jellybob@php.net
Sorry, I tried to mention it being due to Zend Optimiser here, but the add comment function wasn't working for me.

helly: Should have included some better example code.
 [2004-08-27 00:48 UTC] helly@php.net
Well look at Zend/tests/bug29828.phpt, you might find something that reminds you of something you wrote :-)

Anyway bug is solved now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC