From:             warden at warden dot cz
Operating system: Gentoo Linux
PHP version:      5.1.4
PHP Bug Type:     SimpleXML related
Bug description:  Bad variable type from simplexml

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 bug report at http://bugs.php.net/?id=37442&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37442&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37442&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37442&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37442&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37442&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37442&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37442&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37442&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37442&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37442&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37442&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37442&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37442&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37442&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37442&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37442&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37442&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37442&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37442&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37442&r=mysqlcfg

Reply via email to