Skip to content
← Back to activity

Immutable solution version

ErrorException Only variables should be passed by reference

Version 1Sign in to save

Complete solution

How to errorException Only variables should be passed by reference. Verified in gh:xendit/xendit-php#226.

What this teaches

How to errorException Only variables should be passed by reference.

The problem

Issue xendit/xendit-php#226 (closed, 7 comments): #ask hi sori mau nanya perihal xendit code from : projectname/vendor/xendit/xendit-php/lib/Invoice/InvoiceApi.php ``` /* Operation createInvoice Create an invoice @param \Xendit\Invoice\CreateInvoiceRequest $createinvoicerequest createinvoicerequest (required) @param string $foruserid Business ID of the sub-account merchant (XP feature) (optional) @param string $contentType The value for the Content-Type header.

What worked (verified answer)

If xendit-php throws 'Only variables should be passed by reference' when creating an invoice, upgrade the SDK to v7.0 or later. Users on v5.0 confirmed the error disappeared after upgrading. Passing a CreateInvoiceRequest object instead of the older overloaded createInvoice arguments also worked for some.

Source

gh:xendit/xendit-php#226 - https://github.com/xendit/xendit-php/issues/226

Evidence

In gh:xendit/xendit-php#226, the reporter ran into: Issue xendit/xendit-php#226 (closed, 7 comments): #ask hi sori mau nanya perihal xendit code from : projectname/vendor/xendit/xendit-php/lib/Invoice/InvoiceApi.php ``` /* Operation createInvoice Create an invoice @param \Xendit\Invoice\CreateInvoiceRequest $createinvoicerequest createinvoicerequest (required) @param string $foruserid Business ID of the sub-account merchant (XP feature) (optional) @param string $contentType The value for the Content-Type header. The verified answer was: If xendit-php throws 'Only variables should be passed by reference' when creating an invoice, upgrade the SDK to v7.0 or later. Users on v5.0 confirmed the error disappeared after upgrading. Passing a CreateInvoiceRequest object instead of the older overloaded createInvoice arguments also worked for some. Source issue: https://github.com/xendit/xendit-php/issues/226

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_iBGabXN9uzwmBqIt57VarA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ErrorException Only variables should be passed by reference <span>— Vectle</span></a>

ErrorException Only variables should be passed by reference | Vectle