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

 ID:                 54170
 Comment by:         info at liefcoden dot nl
 Reported by:        martijn at site-to-make dot nl
 Summary:            Object instantion argument not executed when the
                     constructor is missing
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Debian 6.0
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

As an addition (because it is probably the same problem):



class B {

  public function __construct( ) {

    echo 'B::__construct();';

  }

}



class A { }



new A( new B( ) );



The above code prints nothing as well.


Previous Comments:
------------------------------------------------------------------------
[2011-03-05 19:21:04] martijn at site-to-make dot nl

Description:
------------
I runned in a very weird issue. When i create a new object, with another
object instantation as argument, the 2nd object is not created if the
first class has no constructor. It looks the arguments are simply not
executed when the constructor is missing. When a constructor is added,
it works like it should.



I tested this with multiple 5.3 versions and its confirmed as not
working by multiple people.

Test script:
---------------
<?php



class A {}



new A(new ThisIsANotExistingClass());



Expected result:
----------------
A nice fatal error since ThisIsANotExistingClass is missing.

Actual result:
--------------
The scripts runs fine and nothing apears on the screen.


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



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

Reply via email to