Edit report at https://bugs.php.net/bug.php?id=54162&edit=1

 ID:                 54162
 Updated by:         fel...@php.net
 Reported by:        mz dot evgeny at gmail dot com
 Summary:            Code given as argument for non-existing constructor
                     won't execute
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

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

This is expected, as the checking is done in runtime. It's just like: <?php if 
(0) { foo(); }


Previous Comments:
------------------------------------------------------------------------
[2011-03-04 14:06:57] mz dot evgeny at gmail dot com

Description:
------------
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:
---------------
new stdClass(NOT_EXISTING_FUNCTION());

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


Actual result:
--------------
Nothing. Object was created without errors


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=54162&edit=1

Reply via email to