소스 검색

empty() test

Mark Grainger 2 년 전
부모
커밋
79a46804dc
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      tests/issue_504_001.phpt

+ 20 - 0
tests/issue_504_001.phpt

@@ -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
+