0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-09 15:18:41 +00:00

empty() test

This commit is contained in:
Mark Grainger 2023-02-18 15:12:29 +00:00
parent 1e25cc8788
commit 79a46804dc

20
tests/issue_504_001.phpt Normal file
View File

@ -0,0 +1,20 @@
--TEST--
Test empty() : Segmentation fault caused by 'empty' check on a V8Function object
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$v = new \V8Js();
$r = $v->executeString('
a = {
main: function() {}
};
', null, V8Js::FLAG_FORCE_ARRAY | V8Js::FLAG_PROPAGATE_PHP_EXCEPTIONS);
if (!empty($r['main'])) {
echo 'Ok' . PHP_EOL;
}
?>
--EXPECTF--
Ok