Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12753
test.php
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 2:40 AM
2014-11-22 02:40:36 (UTC+0)
Size
935 B
Referenced Files
None
Subscribers
None
test.php
View Options
<?php
$originalObj
=
new
A
;
class
A
{
var
$foo
=
'default value'
;
}
// Important note: If you remove the &, the bug dissapears.
function
changeFooWithUnusedReference
(
&
$unusedReferenceToFoo
,
$newValue
)
{
global
$originalObj
;
$newObj
=
clone
$originalObj
;
echo
"Prior to changing value, the original object is supposed to be 'default value'. Actually is:
\n
"
;
echo
$originalObj
->
foo
.
"
\n
"
;
echo
"Prior to changing value, the cloned object is supposed to be 'default value'. Actually is:
\n
"
;
echo
$newObj
->
foo
.
"
\n
"
;
// Change value
$newObj
->
foo
=
$newValue
;
echo
"
\n
"
;
echo
"After changing value, the original object is supposed to be 'default value'. Actually is:
\n
"
;
echo
$originalObj
->
foo
.
"
\n
"
;
echo
"After changing value, the cloned object is supposed to be 'some other value'. Actually is:
\n
"
;
echo
$newObj
->
foo
.
"
\n
"
;
}
changeFooWithUnusedReference
(
$originalObj
->
foo
,
'Some other value'
);
File Metadata
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12196
Default Alt Text
test.php (935 B)
Attached To
Mode
T58226: MessageCache cloning of parser breaks stuff if it happens while in the process of parsing something
Attached
Detach File
Event Timeline
Log In to Comment