|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-14 23:11 UTC] 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...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
I forgot to write my frequency value in this example, so that file looks like: <conf> <frequency>30</frequency> </conf>