<?php
if (condition) { class X {} }
class Y extends X {} // extending conditionally declared class
PHP Peachpie Snippet class extension conditional declaration