#43442 [Opn->Fbk]: __destruct is calling right after __construct

From: Date: Mon, 03 Dec 2007 11:14:50 +0000
Subject: #43442 [Opn->Fbk]: __destruct is calling right after __construct
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120303@lists.php.net to get a copy of this message
 ID:               43442
 Updated by:       jani@php.net
 Reported By:      cjshark at mail dot ru
-Status:           Open
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: FreeBSD v60
 PHP Version:      5.2.5
 New Comment:

So what is the configure line you used?


Previous Comments:
------------------------------------------------------------------------

[2007-11-30 11:00:48] cjshark at mail dot ru

I meen everything is ok under php 5.2.3 and less BUT 5.2.5! Nothing
else is using (search as 3rd party extensions or smth).

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

[2007-11-29 10:39:13] jani@php.net

Me too:

$ src/build/php_5_2/sapi/cli/php t.php
construct
method!!
destruct

So what could be wrong with your build / setup? In what SAPI? What
configure line was used? What 3rd party extensions are loaded? 

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

[2007-11-29 08:03:16] derick@php.net

This is not what I'm seeing, I see the correct:

construct<br>method!!<br>destruct<br>

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

[2007-11-28 17:48:15] cjshark at mail dot ru

Description:
------------
__destruct is calling right after __construct before using any methods!

Reproduce code:
---------------
	class test
	 {
	 	function __construct()
	 	 {
	 	 	echo "construct<br>";
	 	 }

  		function method($i)
  		 {
  		 	echo $i."<br>";
  		 }


	 	function __destruct()
	 	 {
	 	 	echo "destruct<br>";
	 	 }

	 }


	$cl = new test();
	$cl->method('method!!');

Expected result:
----------------
construct
method!!
destruct

Actual result:
--------------
construct
destruct
method!!
destruct


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


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


Thread (8 messages)

« previous php.bugs (#120303) next »