php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33826 constructor local method call
Submitted: 2005-07-22 18:52 UTC Modified: 2005-07-22 18:57 UTC
From: s_g_spencer at yahoo dot co dot uk Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.4 OS: debian linux 2.6.8
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: s_g_spencer at yahoo dot co dot uk
New email:
PHP Version: OS:

 

 [2005-07-22 18:52 UTC] s_g_spencer at yahoo dot co dot uk
Description:
------------
Cannot call local method from the classes constructor. 

I might be wrong in thinking this is a problem. (long day)

Configure line : 

./configure \
--with-apxs=/usr/bin/apxs \
--with-libxml-dir=/usr/lib \
--with-curl=/usr/lib \
--with-curlwrappers \
--with-mysql=/usr/lib \
--with-libxml-dir=/usr/lib \
--with-pear=/usr/lib/php \
--with-imap=/usr/include/imap-uw

Reproduce code:
---------------
class foo{

function __construct(){

    bar();
}

function bar(){}

}

$example = new foo();


Expected result:
----------------
none. just no error.

Actual result:
--------------
Fatal error: Call to undefined function bar() 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-22 18:57 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC