fork(1) download
  1. <?php
  2.  
  3. class Yea
  4. {
  5. public static function withStatic()
  6. {
  7. return new static;
  8. }
  9.  
  10. public static function withCalledClass()
  11. {
  12. $class = get_called_class();
  13. return new $class;
  14. }
  15. }
  16.  
  17.  
  18. var_dump(Yea::withStatic());
  19. var_dump(Yea::withCalledClass());
  20.  
Success #stdin #stdout 0.04s 52480KB
stdin
Standard input is empty
stdout
object(Yea)#1 (0) {
}
object(Yea)#1 (0) {
}