gpt4 book ai didi

php - 整数没有显示为 die() 参数?

转载 作者:可可西里 更新时间:2023-10-31 23:11:57 25 4
gpt4 key购买 nike

我有一个奇怪的问题。调试时,有时我的代码看起来像这样

<?php
$var = 15;
die($var);

die() 函数有效,但不输出任何内容

然而,这个有效

<?php
$var = 15;
die($var."<-");

http://sandbox.phpcode.eu/g/81462.php

这怎么可能?我错过了什么?还是错误?

最佳答案

参见 http://www.php.net/manual/en/function.exit.php (die() 等同于 exit())

If status is a string, this function prints the status just before exiting.

If status is an integer, that value will be used as the exit status and not printed. Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate the program successfully.

关于php - 整数没有显示为 die() 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6913312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com