Skip to content

Instantly share code, notes, and snippets.

@yrashk
Created December 15, 2008 02:06
Show Gist options
  • Save yrashk/35850 to your computer and use it in GitHub Desktop.
Save yrashk/35850 to your computer and use it in GitHub Desktop.
<?
abstract class AbstractParent {
function __construct($param) { print_r($param); }
public static function test() { return new self(1234); }
}
class SpecificClass extends AbstractParent {}
SpecificClass::test();
?>
$ php test.php
Fatal error: Cannot instantiate abstract class AbstractParent in test.php on line 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment