Bug #49606 [NoF->Fbk]: empty( $this->variable )

From: Date: Sun, 07 Mar 2010 17:14:08 +0000
Subject: Bug #49606 [NoF->Fbk]: empty( $this->variable )
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148361@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=49606&edit=1

 ID:               49606
 Updated by:       felipe@php.net
 Reported by:      clin dot isbut at gmail dot com
 Summary:          empty( $this->variable )
-Status:           No Feedback
+Status:           Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Windows Xp
 PHP Version:      5.3.0

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------
[2009-09-30 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2009-09-22 10:15:47] jani@php.net

I still can not reproduce this with the class extending mysqli. Please
try the snapshot. (And next time, DO NOT use the "Add comment" tab when
you add comments to your _own_ report! Use the "Edit Submission" tab!)

------------------------------------------------------------------------
[2009-09-20 18:25:21] clin dot isbut at gmail dot com

Sorry, expected and actual result are as this:

Expected result:
----------------
   Publish_date: 45678
   publish IS NOT EMPTY!

Actual result:
---------------
   Publish_date: 45678
   publish IS EMPTY!

------------------------------------------------------------------------
[2009-09-20 18:14:32] clin dot isbut at gmail dot com

Ok, I found the root of problems. Seems it fails when the class extends
mysqli class (?¿). See this:

Reproduce code:
---------------
FooClass.php
class FooClass extends mysqli
{
   var $publish_date;
   function __construct()
   {
   }

   function foo( $var )
   {
      $this->publish_date = $var;
      echo "Publish_date:".$this->publish_date."<br>";
      if( empty( $this->publish_date ) )
         echo "publish IS EMPTY!<br>";
      else
         echo "publish IS NOT EMPTY!<br>";
   }
}



Index.php

include ("FooClass.php");
$obj = new FooClass();
$obj->foo( '45678' );



Expected result:
----------------
   Publish_date: 45678
   publish IS NOT EMPTY!

Actual result:
---------------
   Publish_date: 45678
   publish IS NOT EMPTY!


I expect this time you can reproduce it.

------------------------------------------------------------------------
[2009-09-20 17:45:24] clin dot isbut at gmail dot com

Seems like my example code does not reproduce the error. I'll try to
reduce my failing code to write here.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=49606


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


Thread (8 messages)

« previous php.bugs (#148361) next »