The core will require at least PHP 5.3, but you can install and use PHP 5.3+ (including PHP 5.4) on your server with no problems. Then all PHP 5.4 features will be available to your code (including your Yii extensions that use PHP 5.4 features).
Just a memory recollection, but CodeIgniter 1.x.x (maybe 2.x also) detected PHP version in their equivalent to a CObject, allowing different sets of classes of the same name to coexist within the framework. The idea was originally meant to handle the distinction between PHP4 and PHP5 code (a major PHP version), but the concept seems very extensible. PHP4 related classes were used when running on top of PHP4 and so on.
CodeIgniter supports one additional feature and this is core class replacement. If the application code includes a file of the same name as a core class, the core class is replaced by the application version.
I always felt these were nice DRY solutions available should a developer need them. They are also KISS in the sense that the replacement of files is simple and automatic in most respects.