<?php
header("Location: http://www.example.com/"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
?>
// PHP 7
$ php -i | grep -A1 "uopz support"; php -r 'die; echo "Die did not work\n";'
// PHP 82
php -i | grep -A1 "uopz support"; php -r 'die; echo "Die did not work\n";'
uopz support => enabled
Version => 7.1.1
Die did not work
// Changed uopz.exit setting to 1 in /path/to/php.d/05-uopz.ini, to restore default die/exit behavior. Showing contents here:
; Enable 'User Operations for Zend' extension module
extension=uopz.so
; Configuration
; See http://php.net/manual/en/uopz.configuration.php
; If enabled, uopz should stop having any effect on the engine.
;uopz.disable = 0
; Whether to allow the execution of exit opcodes or not.
; This setting can be overridden during runtime by calling uopz_allow_exit().
;uopz.exit = 0
uopz.exit = 1
// Tested again - die worked:
php -i | grep -A1 "uopz support"; php -r 'die; echo "Die did not work\n";'
uopz support => enabled
Version => 7.1.1
4条答案
按热度按时间mw3dktmi1#
你在看这一页。
this页面中需要注意的示例:
hc2pp10m2#
可能应该是(注意
'
):函数
exit()
在执行时肯定会停止执行,你的if条件肯定有问题。在PHP中,多个值“等于”零(如果你使用
==
)。尝试var_dump($num)
看看到底是什么。sshcrbum3#
exit
无法工作,因为它具有2个依赖项A.如果
$num
不为零,则if ($num == 0)
退出不起作用B.
header("Location:index.php#captcha");
如果您的位置工程退出不会wort尝试
ebdffaop4#
在RHEL/CentOS上将php版本切换到82后,exit()和die()停止工作。花了一天的大部分时间进行调试。结果发现'uopz'模块正在改变默认行为。
对于一个Zend扩展来说,修改php的默认行为是一个令人震惊的发现。