php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56621 Functionality to make a class inerit a class / implement an interface
Submitted: 2005-10-29 02:06 UTC Modified: 2011-10-27 07:16 UTC
From: sebastian@php.net Assigned: sebastian (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5_1 CVS-2005-10-29 (dev) OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sebastian@php.net
New email:
PHP Version: OS:

 

 [2005-10-29 02:06 UTC] sebastian@php.net
Description:
------------
Two new functions that make a class inherit from another class (if it does not have a parent class, yet) and implement an interface (if it implements the required methods), respectively, would be nice.

Reproduce code:
---------------
<?php
class ParentClass {}
class ChildClass {}

runkit_inherit_class('ChildClass', 'ParentClass');

interface I {public function doSomething();}
class C {public function doSomething() {}}

runkit_implement_interface('C', 'I');
?>

Expected result:
----------------
<?php
class ChildClass extends ParentClass {}
class C implements I {public function doSomething() {}}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-29 17:13 UTC] pollita@php.net
http://www.php.net/runkit_class_adopt

Implementing interfaces can go on the to-do though...
 [2011-10-27 07:16 UTC] sebastian@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: sebastian
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 08 19:01:24 2021 UTC