5 Comments

  1. Hi Matt,

    this it works for me

    if ( ( class_exists(‘CLASS_1’) ) || ( class_exists(‘CLASS_2’) ) ) {
    echo ‘Ok’;
    }

  2. I would do if ( class_exists('class1') || class_exists('class2') ) { } directly. Every core PHP function is just like your own PHP functions where it expects an exact type and number of arguments. Although sometimes it gets really confusing with certain functions, such as array manipulation where arguments are passed by reference instead of value and you get something random as a return value.

    1. I’m 99% certain I tried that as well. I didn’t want to list ALL of the things I tried in order to get it to work, no one wants to read THAT list! Thanks for dropping by!

    1. Hi Kenth, that looks like a really useful function. Will try that out as well. I wonder if there are potential performance differences between these methods as well.

Comments are closed.