Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
--TEST--
pcall() catching various errors
--FILE--
'return 1',
'User error' => 'error("runtime error")',
'Argument check error' => 'string.byte()',
'Infinite recursion' => 'function foo() foo() end foo()',
'Infinite loop (timeout)' => 'while true do end',
'Out of memory' => 'string.rep("x", 1000000)'
);
foreach ( $tests as $desc => $code ) {
echo "$desc: ";
$sandbox = new LuaSandbox;
$sandbox->loadString( $lua )->call();
$sandbox->setCPULimit( 0.25 );
$sandbox->setMemoryLimit( 100000 );
try {
print implode("\n",
$sandbox->callFunction( 'pcall_test', $sandbox->loadString( $code ) ) ) . "\n";
} catch ( LuaSandboxError $e ) {
echo "LuaSandboxError: " . $e->getMessage() . "\n";
}
}
--EXPECT--
Normal: success
User error: Caught: [string ""]:1: runtime error
Argument check error: Caught: [string ""]:1: bad argument #1 to 'byte' (string expected, got no value)
Infinite recursion: LuaSandboxError: not enough memory
Infinite loop (timeout): LuaSandboxError: The maximum execution time for this script was exceeded
Out of memory: LuaSandboxError: not enough memory