diff options
author | Xinchen Hui <laruence@php.net> | 2014-07-03 13:38:38 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2014-07-03 13:48:59 +0800 |
commit | 533b1df7325673bf8159263379579d2142f57877 (patch) | |
tree | f8ad92d6287b7287f26ae33fedb7c546a1038fe0 /ext/opcache | |
parent | e17bfb472efe34934583141b963b9f90b7635594 (diff) | |
download | php-git-533b1df7325673bf8159263379579d2142f57877.tar.gz |
Add test for bug #67215
bjori> writing a testcase making sure you get a fatal error and does not
segfault after that... is difficult
Diffstat (limited to 'ext/opcache')
-rw-r--r-- | ext/opcache/tests/bug67215.phpt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/opcache/tests/bug67215.phpt b/ext/opcache/tests/bug67215.phpt new file mode 100644 index 0000000000..e9919d1001 --- /dev/null +++ b/ext/opcache/tests/bug67215.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #67215 (php-cgi work with opcache, may be segmentation fault happen) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$file_c = __DIR__ . "/bug67215.c.php"; +$file_p = __DIR__ . "/bug67215.p.php"; +file_put_contents($file_c, "<?php require \"$file_p\"; class c extends p {} ?>"); +file_put_contents($file_p, '<?php class p { protected $var = ""; } ?>'); +require $file_c; +$a = new c(); +require $file_c; +?> +--CLEAN-- +<?php +$file_c = __DIR__ . "/bug67215.c.php"; +$file_p = __DIR__ . "/bug67215.p.php"; +unlink($file_c); +unlink($file_p); +?> +--EXPECTF-- +Fatal error: Cannot redeclare class c in %sbug67215.c.php on line %d |