#37442 [Opn]: Bad variable type from simplexml
| From: | warden at warden dot cz | Date: | Sun, 14 May 2006 23:40:28 +0000 |
| Subject: | #37442 [Opn]: Bad variable type from simplexml | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97087@lists.php.net to get a copy of this message | ||
ID: 37442
User updated by: warden at warden dot cz
Reported By: warden at warden dot cz
Status: Open
Bug Type: SimpleXML related
Operating System: Gentoo Linux
PHP Version: 5.1.4
New Comment:
I forgot to write my frequency value in this example, so that file
looks like:
<conf>
<frequency>30</frequency>
</conf>
Previous Comments:
------------------------------------------------------------------------
[2006-05-14 23:11:39] warden at warden dot cz
Description:
------------
I have file conf.xml:
<conf>
<frequency></frequency>
</conf>
If I use $conf = simplxml_load_file(conf.xml) in object and than put
the value of frequency into object variable ($this->frequency =
$conf->frequency) everything is OK, but if I want to use this value in
sleep($this->frequency) function, an error is displayed:
Warning: sleep() expects parameter 1 to be long, object given in...
If I try to get variable type of frequency, "object" is returned...when
I settype($this->frequency, "integer"), everything works good...
List of compiled modules:
apache2, bzip2, cgi, cli, crypt, exif, force-cgi-redirect, ftp, gd,
iconv, imap, mhash, mysql, ncurses, nls, pcntl, pcre, posix, readline,
reflection, session, simplexml, spell, spl, ssl, truetype, xml, xpm,
xsl, zip, zlib
Expected result:
----------------
Clasic sleep(30); with no error
Actual result:
--------------
Warning: sleep() expects parameter 1 to be long, object given in...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37442&edit=1