<div dir="ltr">Hi Michal,<div><br></div><div><div>There is an issue with keys generated in the function adding null to the end of each key, I have created an issue with a patch from Eric at LimeTech.<br></div><div><br></div><div><a href="https://gitlab.com/libvirt/libvirt-php/-/issues/7">https://gitlab.com/libvirt/libvirt-php/-/issues/7</a><br></div><div><br></div><div>my testing.</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(156,220,254)">$tmp</span> = <span style="color:rgb(220,220,170)">libvirt_connect_get_machine_types</span>(<span style="color:rgb(156,220,254)">$lv</span>-><span style="color:rgb(220,220,170)">get_connection</span>());</div><div><span style="color:rgb(156,220,254)">$key</span> = <span style="color:rgb(206,145,120)">"ppc</span><span style="color:rgb(215,186,125)">\0</span><span style="color:rgb(206,145,120)">"</span> ;</div><div><span style="color:rgb(220,220,170)">var_dump</span>(<span style="color:rgb(220,220,170)">bin2hex</span>((<span style="color:rgb(156,220,254)">$key</span>)) );</div><div><span style="color:rgb(220,220,170)">var_dump</span>( <span style="color:rgb(156,220,254)">$tmp</span>[<span style="color:rgb(156,220,254)">$key</span>]) ;</div></div></div><div><br></div><div>Regards</div><div>Simon</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 5, 2022 at 10:44 AM Simon Fairweather <<a href="mailto:simon.n.fairweather@gmail.com">simon.n.fairweather@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks for your reply Michal, looks like it is a php array processing issue which I am looking into.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 5, 2022 at 9:51 AM Michal Prívozník <<a href="mailto:mprivozn@redhat.com" target="_blank">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/4/22 18:18, Simon Fairweather wrote:<br>
> Using the following<br>
> <br>
> php: version 8.1.13<br>
> php-libvirt: version 0.5.6 (build 2)<br>
> <br>
> libvirt 8.7.0<br>
> QEMU 7.1.0<br>
> <br>
> virsh capabilities works fine.<br>
> <br>
<br>
<br>
> <br>
> Any known issues with php 8 for this function, others seem to be working<br>
> fine.<br>
<br>
Hey, I haven't tried php-8 yet. What is the problem you're seeing?<br>
Looking into the source code, the only thing that<br>
libvirt_connect_get_machine_types() does is it fetches capabilities<br>
(libvirt_connect_get_capabilities()) and then runs couple of XPATHs to<br>
construct an associative array of supported machine types. The same can<br>
be achieved in plain PHP.<br>
<br>
Michal<br>
<br>
</blockquote></div>
</blockquote></div>