Changes between Initial Version and Version 2 of Ticket #60190
- Timestamp:
- 01/04/2024 06:44:57 AM (13 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #60190
- Property Keywords has-patch has-unit-tests added
-
Ticket #60190 – Description
initial v2 1 1 2 ```php2 {{{#!php 3 3 do_action( 'foo', array( (object) null ) ); 4 4 5 5 function foo_cb( array $arg ) {} 6 6 add_action( 'foo', 'foo_cb' ); 7 ``` 7 }}} 8 8 9 9 This will fail with a fatal error in PHP 7+, since `do_action` (as the only one, this isn't an issue with `apply_filters` or `do_action_ref_array`) will convert arrays with only 1 object into that object. 10 The reason for that is some PHP 4 legacy behavior, see https://core.trac.wordpress.org/ticket/4831210 The reason for that is some PHP 4 legacy behavior, see #48312 11 11 12 12 It's time to drop this PHP 4 support, as this prevent using native types in callback functions in cases where the argument is an array of objects.