}
MAKE_STD_ZVAL(halt_constant);
- zend_get_constant("__COMPILER_HALT_OFFSET__", 24, halt_constant TSRMLS_CC);
+ if (0 == zend_get_constant("__COMPILER_HALT_OFFSET__", 24, halt_constant TSRMLS_CC)) {
+ zval_dtor(halt_constant);
+ FREE_ZVAL(halt_constant);
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "__HALT_COMPILER(); must be declared in a phar");
+ return;
+ }
halt_offset = Z_LVAL(*halt_constant);
zval_dtor(halt_constant);
FREE_ZVAL(halt_constant);
PHP_Archive::mapPhar(5, 'hio');
PHP_Archive::mapPhar(5, 'hio', 'hi');
PHP_Archive::mapPhar(5, 'hio', true, 5, 5);
+__HALT_COMPILER();
?>
--EXPECTF--
Warning: PHP_Archive::mapPhar() expects at least 3 parameters, 0 given in %s on line %d
--- /dev/null
+--TEST--
+PHP_Archive::mapPhar improper parameters
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip";?>
+--FILE--
+<?php
+PHP_Archive::mapPhar(5, 'hio', false);
+?>
+--EXPECTF--
+Fatal error: PHP_Archive::mapPhar(): __HALT_COMPILER(); must be declared in a phar in %s on line %d
\ No newline at end of file