Function for Checking Property Existence in OOP in PHP

property_exists
Задание 1

Create a class Test with a property prop1 and without a property prop2. Check what the function property_exists will output for the property prop1 and for the property prop2.

Задание 2

Given an array with class properties. Also given a class that has some of these properties. Iterate through this array with a loop, for each property check if it exists in the class and, if it exists, output the value of this property to the screen.