From:             ehymel at e-medico dot com
Operating system: Fedora 17
PHP version:      5.4.3
Package:          Class/Object related
Bug Type:         Bug
Bug description:apache segfault with function named init()

Description:
------------
I have been using a set of scripts and classes for about a year without
problem 
until recent upgrade from Fedora 16 to 17, which brought with it PHP 5.4.3.
I 
started seeing segfaults in apache and I eventually narrowed the problem to
the 
use of the function name 'init()'. See the code below.

After some experimentation, I found that by simply renaming the init()
function to 
something else, like initialize(), then all works fine.

fwiw, I do not have ZendFramework installed (I believe that framework uses
init() 
function quite a bit).

Test script:
---------------
//DOES NOT WORK:
class Foo {
    function __construct() {
        // construction functions
        $this->init();
    }
    
    function init() {    
        // init functions;
    }
}


//WORKS:
class Bar{
    function __construct() {
        // construction functions
        $this->initialize();
    }
    
    function initialize() {    
        // init functions;
    }
}

Expected result:
----------------
No segfault.

Actual result:
--------------
Segfault.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62225&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=62225&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=62225&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=62225&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=62225&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62225&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=62225&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=62225&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=62225&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=62225&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=62225&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=62225&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=62225&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=62225&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=62225&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=62225&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62225&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=62225&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=62225&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=62225&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=62225&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=62225&r=mysqlcfg

Reply via email to