• We are trusted partners of:

What does this var_dump return? - INNOBYTE - Serious Web Development

Posted by | September 12, 2013 | Development | 2 Comments

Tell us what does this var_dump return!


var_dump(
null == 0, # ?
false == 0, # ?
INF==INF, # ?
(-1*INF) == (-1*INF), # ?
(-1*INF) < (-1*INF), # ?
(-1*INF) > (-1*INF), # ?
'Interesting',
null == (-1*INF), # ?
false == (-1*INF), # ?
null < (-1*INF), # ?
false < (-1*INF) # ?
);

«Go back

2 Comments

  • Florin says:

    bool(true)
    bool(true)
    bool(true)
    bool(true)
    bool(false)
    bool(false)
    string(11) “Interesting”
    bool(false)
    bool(false)
    bool(true)
    bool(true)

  • Alin D. says:

    Florin, what version of PHP you used ?

    I tested on PHP 5.3.10-1ubuntu3.7 and i got :

    bool(true)
    bool(true)
    bool(false)
    bool(false)
    bool(true)
    bool(true)
    string(11) “Interesting”
    bool(false)
    bool(false)
    bool(true)
    bool(true)

    var_dump( INF == INF ) return false (INF is not equal with INF ?!?);

    var_dump( (-1*INF) == (-1*INF) ) return false (-INF not equal with -INF ?!?).

    var_dump((-1*INF) > (-1*INF)) return true (-INF > -INF ?!?).

    var_dump((-1*INF) < (-1*INF)) return true (-INF < -INF ???).

Leave a Reply

Your email address will not be published.