id,summary,reporter,owner,description,type,status,component,version,resolution,keywords,cc,guest,host 6378,PHP web API return wrong value(s) when only a single machine is present on host,Sm0k1n,,"If only one virtual machine is present on the host, some calls to the php web api like IVirtualBox->machines should return an array of machines, but since there is only one machine, only one object is returned. It seems that either there is a bug in the api itself or PHP tries to be smart and does not create an array with only one object. Either way, the constructor of the collection object requires an array and it fails to get one, therefore this error comes up: {{{Argument 2 passed to VBox_ManagedObjectCollection::__construct() must be an array, string given}}} This is also the case with IVirtualBox->DVDImage when only one dvd image is present. Having more than one machine/dvd/etc. solves the issue. {{{ System info ---- VirtualBox: 3.1.2, 3.1.4 (bug is present in both versions) Host: openSuse 11.2 Kernel: 2.6.31.12-0.1-default PHP: 5.3.1 Web Server: Apache 2.0 }}} ",defect,closed,webservices,VirtualBox 3.1.4,fixed,"php, collection, constructor",,other,Linux