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: 2021-05-10 15:05 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: cmb (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5.1.2 OS: Ubuntu
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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>.
 [2021-05-10 15:05 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-05-10 15:05 UTC] cmb@php.net
I'm closing this ticket, since the proper place to report runkit
related issues is <https://github.com/zenovich/runkit/issues>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 27 16:01:27 2024 UTC