php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52051 handling of case sensitivity of old-style constructors changed in 5.3+
Submitted: 2010-06-11 17:33 UTC Modified: 2010-06-12 17:30 UTC
From: php at kingsquare dot nl Assigned: felipe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Win32
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at kingsquare dot nl
New email:
PHP Version: OS:

 

 [2010-06-11 17:33 UTC] php at kingsquare dot nl
Description:
------------
Since PHP 5.3+ (it worked in 5.2.6) handling of old-style constructors with case sensitive (i.e. camelcasing) changed. The 'generated' constructor is only available in lower case since 5.3

Test script:
---------------
<?php
// WORKING
class AA {
    function AA() { echo 'works!'; }
}
class bb extends AA {}
class CC extends bb {
   function CC() { parent::bb(); }
}
new CC();

// FATAL ERROR
 class A {
    function A() { echo 'check'; }
}
class B extends A {}
class C extends B {
   function C() { parent::B(); }
}
new C();

Expected result:
----------------
works!check

Actual result:
--------------
works!
Fatal error: Call to undefined method B::B() in C:\php\test.php on line 18

Call Stack:
    0.0002     331488   1. {main}() C:\php\test.php:0
    0.0003     331656   2. C->C() C:\php\test.php:20



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-12 17:24 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: felipe
 [2010-06-12 17:30 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=300407
Log: - Fixed bug #52051 (handling of case sensitivity of old-style constructors changed in 5.3+)
 [2010-06-12 17:30 UTC] felipe@php.net
-Status: Assigned +Status: Closed
 [2010-06-12 17:30 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC