Login   Register  
PHP Classes
elePHPant
Icontem

Error at line: $xw = new emptyObject(); Cause emptyObject not...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      wURI  >  All threads  >  Error at line: $xw = new emptyObject(); Cause emptyObject not...  >  (Un) Subscribe thread alerts  
Subject:Error at line: $xw = new emptyObject(); Cause emptyObject not...
Summary:Package rating comment
Messages:4
Author:Maykonn Welington Candido
Date:2013-10-21 14:31:43
Update:2013-10-22 16:15:42
 

Maykonn Welington Candido rated this package as follows:

Utility: Bad
Consistency: Insufficient

  1. Error at line: $xw = new emptyObject(); Cause emptyObject not...   Reply   Report abuse  
Picture of Maykonn Welington Candido
Maykonn Welington Candido
2013-10-21 14:31:44
Error at line: $xw = new emptyObject();
Cause emptyObject not exists, not is provided by the package and not is a SPL* class.

*http://php.net/manual/pt_BR/book.spl.php

  2. Re: Error at line: $xw = new emptyObject(); Cause emptyObject no   Reply   Report abuse  
Picture of Till Wehowski
Till Wehowski
2013-10-22 11:38:59 - In reply to message 1 from Maykonn Welington Candido
What error do you get?
The whole part is:

if(class_exists('emptyObject'))
{
$xw = new emptyObject();
}else{
$xw = array();
$xw = (object)$xw;
}

So it should work?
Can you post the error message?

Yo could try to change to
$xw = array();
$xw = (object)$xw;
or
$xw = new Object()

  3. Re: Error at line: $xw = new emptyObject(); Cause emptyObject no   Reply   Report abuse  
Picture of Maykonn Welington Candido
Maykonn Welington Candido
2013-10-22 14:54:05 - In reply to message 2 from Till Wehowski
No error, sorry, but, this is not necessary, 'cause nobody has the emptyObject ok?

if(class_exists('emptyObject'))
{
$xw = new emptyObject();
}else{
$xw = array();
$xw = (object)$xw;
}

So the necessary is only:
$xw = array();
$xw = (object)$xw;

It's not wrong, it's just an improvement.

  4. Re: Error at line: $xw = new emptyObject(); Cause emptyObject no   Reply   Report abuse  
Picture of Till Wehowski
Till Wehowski
2013-10-22 16:15:42 - In reply to message 3 from Maykonn Welington Candido
Ok, your right!
I will change it soon in the next update.
Thank you!