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--
pairs() and __pairs
--FILE--
'pairs_test1',
'With __pairs' => 'pairs_test2',
'No argument' => 'pairs_test3',
'With __pairs throwing an error' => 'pairs_error',
'With next func throwing an error' => 'pairs_next_error',
'Table with __pairs returned to PHP' => 'pairs_return',
'Table with __pairs throwing an error returned to PHP' => 'pairs_return_error',
'Table with next func throwing an error returned to PHP' => 'pairs_return_next_error',
);
foreach ( $tests as $desc => $func ) {
echo "$desc: ";
$sandbox = new LuaSandbox;
$sandbox->loadString( $lua )->call();
$sandbox->setCPULimit( 0.25 );
$sandbox->setMemoryLimit( 100000 );
try {
print var_export( $sandbox->callFunction( $func ), 1 ) . "\n";
} catch ( LuaSandboxError $e ) {
echo "LuaSandboxError: " . $e->getMessage() . "\n";
}
}
--EXPECT--
Normal: array (
0 => 'Ok',
)
With __pairs: array (
0 => 'Ok',
)
No argument: LuaSandboxError: [string ""]:32: bad argument #1 to 'pairs' (table expected, got no value)
With __pairs throwing an error: LuaSandboxError: [string ""]:45: Error from __pairs function
With next func throwing an error: LuaSandboxError: [string ""]:60: Error from next function
Table with __pairs returned to PHP: array (
0 =>
array (
'a' => 1,
'b' => 2,
),
)
Table with __pairs throwing an error returned to PHP: LuaSandboxError: [string ""]:52: Error from __pairs function
Table with next func throwing an error returned to PHP: LuaSandboxError: [string ""]:71: Error from next function