Corveda / PHPSandbox

A PHP-based sandboxing library with a full suite of configuration and validation options.
https://phpsandbox.org
Other
220 stars 46 forks source link

Declare Global vars inside the Sandbox, and make them available only there... #13

Closed DrOctavius closed 5 years ago

DrOctavius commented 6 years ago

Hi, is it possible to Declare Global vars inside the Sandbox, and make them available only there...? I need this because i want to execute a lot of functions using same global vars => but i need to execute them in multithreading environment, so don't need them to access same var with same memory stack (same pointer), need to separate them without changing the Arhitecture and classes...

fieryprophet commented 5 years ago

It's not possible as the sandbox runs within the same global context as the PHP thread itself, so every sandbox running within that thread would have access to the same overall global state (if you allow those sandboxes to access the global state, that is.)