LuaSandboxFunction::call

(PECL luasandbox >= 1.0.0)

LuaSandboxFunction::callCall a Lua function

Beschreibung

public LuaSandboxFunction::call(string ...$args): array|bool

Calls a Lua function.

Errors considered to be the fault of the PHP code will result in the function returning false and E_WARNING being raised, for example, a resource type being used as an argument. Lua errors will result in a LuaSandboxRuntimeError exception being thrown.

PHP and Lua types are converted as follows:

  • PHP null is Lua nil, and vice versa.

  • PHP ints and floats are converted to Lua numbers. Infinity and NAN are supported.

  • Lua numbers without a fractional part between approximately -2**53 and 2**53 are converted to PHP ints, with others being converted to PHP floats.

  • PHP bools are Lua booleans, and vice versa.

  • PHP strings are Lua strings, and vice versa.

  • Lua functions are PHP LuaSandboxFunction objects, and vice versa. General PHP callables are not supported.

  • PHP arrays are converted to Lua tables, and vice versa.

    • Note that Lua typically indexes arrays from 1, while PHP indexes arrays from 0. No adjustment is made for these differing conventions.

    • Self-referential arrays are not supported in either direction.

    • PHP references are dereferenced.

    • Lua __pairs and __ipairs are processed. __index is ignored.

    • When converting from PHP to Lua, integer keys between -2**53 and 2**53 are represented as Lua numbers. All other keys are represented as Lua strings.

    • When converting from Lua to PHP, keys other than strings and numbers will result in an error, as will collisions when converting numbers to strings or vice versa (since PHP considers things like $a[0] and $a["0"] as being equivalent).

  • All other types are unsupported and will raise an error/exception, including general PHP objects and Lua userdata and thread types.

Lua functions inherently return a list of results. So on success, this method returns an array containing all of the values returned by Lua, with int keys starting from zero. Lua may return no results, in which case an empty array is returned.

Parameter-Liste

args

Arguments passed to the function.

Rückgabewerte

Returns an array of values returned by the function, which may be empty, or false on error.

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Keine Moderation?

indet man in den Bereichen "PHP Scripte" überwiegend ghiblify (https://ghiblichat.ai/) uralte Scripte die teilweise sogar gefährlich sind und ka ...

Geschrieben von DaviMariya am 19.04.2025 07:55:58
Forum: Fragen/Vorschläge zum Forum
Tutorial: Download

The Arthur Morgan jacket (https://www.newamericanjackets.com/product/arthur-morgan-red-dead-redemption-2-jacket.html) is honestly one of the best ...

Geschrieben von mildreddbrown am 19.04.2025 07:43:19
Forum: Tutorials
Mongo Datenbank und Tabellendaten in sehr großer Menge...Wer kennt sich aus?

That's a lot of data! I've heard that dealing with such large datasets can sometimes feel like herding crazy cattle (https://crazycattle-3d.net). ...

Geschrieben von Sarahli88 am 18.04.2025 07:54:22
Forum: PHP Developer Forum
Hilfe! Datenübertragung

Hallo Zusammen, Ich möchte vorher sagen das ich mit dem Thema null Erfahrung habe bzw. ein Anfänger bin. Ich habe eine Mysql Datenbank erstell ...

Geschrieben von lolliesglum am 18.04.2025 04:17:20
Forum: SQL / Datenbanken