From:             atomo64 at gmail dot com
Operating system: Debian sid
PHP version:      5.2.6
PHP Bug Type:     Class/Object related
Bug description:  E_STRICT warns about two constructors only on included files

Description:
------------
[This is http://bugs.debian.org/498914]

When a class has two constructors (__constructor, and a method named 
after the class) E_STRICT only produces a warning when the file 
defining the class is included/required but not when file is 
executed directly.

Reproduce code:
---------------
file foo.php:
<?php

error_reporting(E_STRICT);
class foo {
    function __construct() {}
    function foo() {}
}

?>

file bar.php:
<?php
error_reporting(E_STRICT);
require('foo.php');
?>

$ php -n foo.php; echo ---; php -n bar.php

Expected result:
----------------
Strict Standards: Redefining already defined constructor for class 
foo in /tmp/foo.php on line 6
---

Strict Standards: Redefining already defined constructor for class 
foo in /tmp/foo.php on line 6


Actual result:
--------------
---

Strict Standards: Redefining already defined constructor for class 
foo in /tmp/foo.php on line 6

-- 
Edit bug report at http://bugs.php.net/?id=46077&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46077&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46077&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46077&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46077&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46077&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46077&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46077&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46077&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46077&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46077&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46077&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46077&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46077&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46077&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46077&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46077&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46077&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46077&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46077&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46077&r=mysqlcfg

Reply via email to