View Issue Details

IDProjectCategoryView StatusLast Update
0001973XdebugUncategorizedpublic2023-08-01 10:33
Reportermaaarghk Assigned Toderick  
PrioritylowSeveritytweakReproducibilityalways
Status feedbackResolutionopen 
Product Version3.0.4 
Summary0001973: var_dump on an extension object could use get_class_name object handler
Description

I am looking here specifically:

https://github.com/xdebug/xdebug/blob/9751bf70e15bb2a01d38363b21084342a14a5e16/src/lib/var_export_html.c#L225

when I have xdebug loaded, if I var_dump($object) where $object is a class defined by a custom extension, the base name of that class will be output. However, the extension can define an object handler function get_class_name which adds additional information here, e.g.: https://github.com/php/php-src/blob/01b3fc03c30c6cb85038250bb5640be3a09c6a32/ext/ffi/ffi.c#L1636

Would you accept a pull request on this?

TagsNo tags attached.
Operating System
PHP Version8.0.0-8.0.4

Activities

derick

2021-05-19 12:02

administrator   ~0005879

Hi,

I did not know that existed :-) I would indeed welcome a pull request, as long as it's also done for var_export_line, and var_export_text. Please follow the guidelines at https://xdebug.org/docs/contributing As this is a new feature, it should be against the master branch. If you're unsure about anything, or have questions, please reach out.

cheers,
Derick

derick

2021-08-07 10:06

administrator   ~0005965

Are you still considering making a PR for this?

maaarghk

2021-08-09 09:17

reporter   ~0005971

Hi, yes, I got some way towards this actually but got stuck on an issue and forgot to follow it up.

The question is regarding tests. The FFI extension is the only upstream extension which uses this functionality, so I would require it to write a test. Does your CI system have it installed?

More generally do you consider that a correct approach? Or do you have anything like test extensions / features which are built only for the purposes of testing xdebug itself, but not built for release?

derick

2023-08-01 10:33

administrator   ~0006624

Sorry, I dropped the ball on this.

Do you have an example of code where this would make an impact? Such as some code that uses FFI? I'm having a hard time trying to figure out how this works on the FFI side of things.

cheers,
Derick

Issue History

Date Modified Username Field Change
2021-05-13 01:38 maaarghk New Issue
2021-05-19 12:02 derick Assigned To => derick
2021-05-19 12:02 derick Status new => feedback
2021-05-19 12:02 derick Note Added: 0005879
2021-08-07 10:06 derick Note Added: 0005965
2021-08-09 09:17 maaarghk Note Added: 0005971
2021-08-09 09:17 maaarghk Status feedback => assigned
2023-08-01 10:33 derick Status assigned => feedback
2023-08-01 10:33 derick Note Added: 0006624