php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57330 Cannot redifine or add methods for non-user-defined classes
Submitted: 2006-10-28 15:36 UTC Modified: 2016-08-03 18:28 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (20.0%)
From: theoallardyce at gmail dot com Assigned:
Status: Open Package: runkit (PECL)
PHP Version: 5.1.2 OS: Ubuntu
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: theoallardyce at gmail dot com
New email:
PHP Version: OS:

 

 [2006-10-28 15:36 UTC] theoallardyce at gmail dot com
Description:
------------
In runkit 0.9

When runkit.internal_override is enabled (=1) re-declaring normal non-user-defined functions works fine however you cannot re-declare or add a method to a non-user-defined class, it returns the error: "class [] is not a user-defined class".

Perhaps this is due to RUNKIT_G(internal_override) not being checked in runkit_methods.c?


Reproduce code:
---------------
echo runkit_method_redefine(
   'DOMElement',
   'insertBefore',
   '$test',
   'return $test;',
   RUNKIT_ACC_PUBLIC
);

echo runkit_method_add(
   'DOMElement',
   'myAddedMethod',
   '$test',
   'return $test;',
   RUNKIT_ACC_PUBLIC
);

Expected result:
----------------
11

Actual result:
--------------
Warning: runkit_method_redefine() [function.runkit-method-redefine]: class domelement is not a user-defined class..

Warning: runkit_method_add() [function.runkit-method-add]: class domelement is not a user-defined class...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-03 18:28 UTC] cmb@php.net
For the record: also reported as <https://github.com/zenovich/runkit/issues/60>.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 02:01:38 2019 UTC