Skip to content

Commit

Permalink
empty() test
Browse files Browse the repository at this point in the history
  • Loading branch information
redbullmarky committed Feb 18, 2023
1 parent 1e25cc8 commit 79a4680
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/issue_504_001.phpt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 79a4680

Please sign in to comment.