|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54162 Code given as argument for non-existing constructor won't execute
Submitted: 2011-03-04 14:06 UTC Modified: 2012-09-08 15:45 UTC
From: mz dot evgeny at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
 [2011-03-04 14:06 UTC] mz dot evgeny at gmail dot com
If a class doesn't have a constructor but we pass some arguments into it, then the statements in parentheses won't be executed.

But if we add an empty constructor, it will work as expected.

Test script:

Expected result:
Fatal error: Call to undefined function NOT_EXISTING_FUNCTION()

Actual result:
Nothing. Object was created without errors


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-08 15:45 UTC]
-Status: Open +Status: Not a bug
 [2012-09-08 15:45 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is expected, as the checking is done in runtime. It's just like: <?php if (0) { foo(); }
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 05:01:27 2024 UTC