Note that this is a Parsoid issue, not a Parsoid/PHP porting issue.
[subbu@earth:~/work/wmf/parsoid] echo '[[File:Foo.jpg|frameless|some ignored caption with an unexpanded ref<ref>boo</ref>]]' | parse.js --body_only <p data-parsoid='{"dsr":[0,84,0,0]}'><figure-inline class="mw-default-size" typeof="mw:Image/Frameless" data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"caption","ak":"some ignored caption with an unexpanded ref<ref>boo</ref>"}],"dsr":[0,84,null,null]}' data-mw='{"caption":"some ignored caption with an unexpanded ref<sup typeof=\"mw:DOMFragment/sealed/ref\" data-parsoid='{\"html\":\"mwf1\",\"extTagOffsets\":[68,82,5,6],\"dsr\":[68,82,5,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{},\"body\":{\"extsrc\":\"boo\"}}'></sup>"}'><a href="./File:Foo.jpg" data-parsoid="{}"><img resource="./File:Foo.jpg" src="//upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/220px-Foo.jpg" data-file-width="300" data-file-height="197" data-file-type="bitmap" height="144" width="220" data-parsoid='{"a":{"resource":"./File:Foo.jpg","height":"144","width":"220"},"sa":{"resource":"File:Foo.jpg"}}'/></a></figure-inline></p>
Here is another test snippet:
{| |-<ref>boo</ref> |x |}
on which we get output:
<table data-parsoid='{"dsr":[0,25,2,2]}'> <tbody data-parsoid='{"dsr":[3,23,0,0]}'><tr about="#mwt4" typeof="mw:ExpandedAttrs" data-parsoid='{"startTagSrc":"|-","a":{"<ref>boo</ref>":null},"sa":{"<ref>boo</ref>":""},"dsr":[3,22,16,0]}' data-mw='{"attribs":[[{"txt":"","html":"<sup typeof=\"mw:DOMFragment/sealed/ref\" data-parsoid='{\"html\":\"mwf1\",\"extTagOffsets\":[5,19,5,6],\"dsr\":[5,19,5,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{},\"body\":{\"extsrc\":\"boo\"}}'></sup>"},{"html":""}]]}'> <td data-parsoid='{"dsr":[20,22,1,0]}'>x</td></tr> </tbody></table>