From:             
Operating system: Windows 7
PHP version:      5.4.0alpha3
Package:          Class/Object related
Bug Type:         Bug
Bug description:Trait fails when method parameter has a default

Description:
------------
My code that worked in php 5.4.0alpha2 is not working in 5.4.0alpha3. When
I stripped down the code to nail down exactly where things were going
wrong, it turns out that I have a trait with a method with a parameter that
has a default. When I remove the default, the script works just fine. When
the default is there, I get this error message showing up in my browser
(Firefox 5):
"The connection was reset
The connection to the server was reset while the page was loading."


Test script:
---------------
// This does not work:
trait example_trait {
    public function example_method($example_paramter = 1) {
        echo $example_paramter;
    }
}

// This does work:
trait example_trait {
    public function example_method($example_paramter) {
        echo $example_paramter;
    }
}


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

Reply via email to