Re: [PHP] Object of class could not be converted to string
PHP tries to convert the class to string, but he can't because in your class is missing the __toString magic method. try to add this one and the error must be gone. On Thu, Jun 18, 2009 at 9:06 AM, Yuri Yarlei wrote: > > But what you trying to pass to the variable? > > I already see this error, but I see when I write $$ in the variable, > you can see if you have some $$ in variables or try casting type with > the function settype(); > > ex: > settype($foo, "array"); > settype($foo, "integer"); > settype($foo, "string"); > > Or maybe in your class you did not declare the variable > > ex: > private $var1 = NULL; > private $var2 = NULL; > > Yuri Yarlei > > > > From: ang...@elemental.co.za > > To: php-general@lists.php.net > > Date: Thu, 18 Jun 2009 13:20:59 +0200 > > Subject: [PHP] Object of class could not be converted to string > > > > Dear all, > > > > We are experiencing this error: > > > > "Object of class xxxClass could not be converted to string" > > > > I have searched google a lot mostly the results are for Drupal or badly > > coded sites. > > > > I have further found out that the issue is with PHP 5.2 version. > > > > There isn't a problem with the script as it works on other servers with > > prior versions, so I am wondering if any one has any tips or ways to go > > about this error. Unfortunately we are in a position whereby we cant > > downgrade PHP as it's a shared hosted server. > > > > Any help will be appreciated. > > > > Thanks, > > > > > > Web: http://www.elemental.co.za > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > _ > Conheça os novos produtos Windows Live! Clique aqui. > http://www.windowslive.com.br -- Martin Scotta
RE: [PHP] Object of class could not be converted to string
But what you trying to pass to the variable? I already see this error, but I see when I write $$ in the variable, you can see if you have some $$ in variables or try casting type with the function settype(); ex: settype($foo, "array"); settype($foo, "integer"); settype($foo, "string"); Or maybe in your class you did not declare the variable ex: private $var1 = NULL; private $var2 = NULL; Yuri Yarlei > From: ang...@elemental.co.za > To: php-general@lists.php.net > Date: Thu, 18 Jun 2009 13:20:59 +0200 > Subject: [PHP] Object of class could not be converted to string > > Dear all, > > We are experiencing this error: > > "Object of class xxxClass could not be converted to string" > > I have searched google a lot mostly the results are for Drupal or badly > coded sites. > > I have further found out that the issue is with PHP 5.2 version. > > There isn't a problem with the script as it works on other servers with > prior versions, so I am wondering if any one has any tips or ways to go > about this error. Unfortunately we are in a position whereby we cant > downgrade PHP as it's a shared hosted server. > > Any help will be appreciated. > > Thanks, > > > Web: http://www.elemental.co.za > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > _ Conheça os novos produtos Windows Live! Clique aqui. http://www.windowslive.com.br
RE: [PHP] Object of class could not be converted to string
But what you trying to pass to the variable? I already see this error, but I see when I write $$ in the variable, you can see if you have some $$ in variables or try casting type with the function settype(); ex: settype($foo, "array"); settype($foo, "integer"); settype($foo, "string"); Or maybe in your class you did not declare the variable ex: private $var1 = NULL; private $var2 = NULL; > From: ang...@elemental.co.za > To: php-general@lists.php.net > Date: Thu, 18 Jun 2009 13:20:59 +0200 > Subject: [PHP] Object of class could not be converted to string > > Dear all, > > We are experiencing this error: > > "Object of class xxxClass could not be converted to string" > > I have searched google a lot mostly the results are for Drupal or badly > coded sites. > > I have further found out that the issue is with PHP 5.2 version. > > There isn't a problem with the script as it works on other servers with > prior versions, so I am wondering if any one has any tips or ways to go > about this error. Unfortunately we are in a position whereby we cant > downgrade PHP as it's a shared hosted server. > > Any help will be appreciated. > > Thanks, > > > Web: http://www.elemental.co.za > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > _ Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. É grátis! http://specials.br.msn.com/ilovemessenger/pacotes.aspx
[PHP] Object of class could not be converted to string
Dear all, We are experiencing this error: "Object of class xxxClass could not be converted to string" I have searched google a lot mostly the results are for Drupal or badly coded sites. I have further found out that the issue is with PHP 5.2 version. There isn't a problem with the script as it works on other servers with prior versions, so I am wondering if any one has any tips or ways to go about this error. Unfortunately we are in a position whereby we cant downgrade PHP as it's a shared hosted server. Any help will be appreciated. Thanks, Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php