emulate PHP condition