If-else-if durumda PHP bug?

0 Cevap

Hata ayıklama için bir yöntemi bir if-else-if bölümünde iki yankılanırken girdiniz:

if ( $options instanceof Zend_Config ) {
    $options = $options->toArray();

    echo "1st condition true<br>";

} else if ( ! is_array($options) ) {


    echo "2nd condition true<br>";
    exit();

    throw new Bvb_Grid_Exception('options must be an instance from Zend_Config or an array');
}

Çılgın şey alıyorum çıkışı olduğunu:

1st condition true
2nd condition true

Can you explain this?!?!

0 Cevap