ID:               37442
 Updated by:       [EMAIL PROTECTED]
 Reported By:      warden at warden dot cz
-Status:           Open
+Status:           Bogus
 Bug Type:         SimpleXML related
-Operating System: Gentoo Linux
+Operating System: *
-PHP Version:      5.1.4
+PHP Version:      5.*
-Assigned To:      
+Assigned To:      helly
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Right now this is by design. In PHP 6.0 we might be able to case
SimpleXMLElement objects to any type and therefor a function that
requires an integer would get an integer.


Previous Comments:
------------------------------------------------------------------------

[2006-05-14 23:40:28] warden at warden dot cz

I forgot to write my frequency value in this example, so that file
looks like:

<conf>
    <frequency>30</frequency>
</conf>

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

[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

Reply via email to