Saying PHP can't do it is not strictly true. Though it does depend on your DNS setup. If your domain is resolving anything.yourdomain.com to your webserver then you can fake subdomains by pointing your 404 error document to a PHP file. Then have the PHP file read the full URL that has been entered and map it to a file. So you could get test.mydomain.com to point to the same file as www.mydomain.com/helloworld.php.
But, obviously, it will take longer and more processing to end up at that page that actually having a proper sub-domain