[wp-trac] [WordPress Trac] #35058: PHP Fatal when map_deep tries to work on an object that has a property by reference
WordPress Trac
noreply at wordpress.org
Wed Dec 16 22:10:55 UTC 2015
#35058: PHP Fatal when map_deep tries to work on an object that has a property by
reference
--------------------------+--------------------
Reporter: jeff@… | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.4.1
Component: Formatting | Version: 4.4
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+--------------------
Comment (by jeff@…):
'''We have something that I have tested as follows:'''
{{{
$test_object = (object)array( 'var0' => 'ali', 'var1' => array( 'gaga' )
);
$test_array = array( 'var0' => 'varvar', 'var1' => array( 'googoo' ) );
function append_baba( $value ) {
return $value . 'baba';
}
error_log( 'BEFORE ' . var_export( $test_object, true ) );
$output = map_deep( $test_object, 'append_baba' );
error_log( 'AFTER ' . var_export( $output, true ) );
error_log( 'BEFORE ' . var_export( $test_array, true ) );
$output = map_deep( $test_array, 'append_baba' );
error_log( 'AFTER ' . var_export( $output, true ) );
}}}
'''This is the test output:'''
{{{
[16-Dec-2015 17:07:20 America/New_York] BEFORE
stdClass::__set_state(array(
'var0' => 'ali',
'var1' =>
array (
0 => 'gaga',
),
))
[16-Dec-2015 17:07:20 America/New_York] AFTER stdClass::__set_state(array(
'var0' => 'alibaba',
'var1' =>
array (
0 => 'gagababa',
),
))
[16-Dec-2015 17:07:20 America/New_York] BEFORE array (
'var0' => 'varvar',
'var1' =>
array (
0 => 'googoo',
),
)
[16-Dec-2015 17:07:20 America/New_York] AFTER array (
'var0' => 'varvarbaba',
'var1' =>
array (
0 => 'googoobaba',
),
)
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35058#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list