我在Google App Engine上运行Laravel.
由于App Engine使用PHP 5.5解释器运行PHP,因此我将php55指定为运行时.该项目在Google的服务器上运行良好.
当我在本地开发服务器上运行我的网站时,SDK使用运行时提供:php一切正常.将运行时更改为php55会在我的日志中显示空白页面并显示以下错误:
Unable to delete function dlUnable to delete function mb_send_mail
ERROR:root:php failure (255) with:
stdout:
Status: 500 Internal Server Error
X-Powered-By: PHP/5.5.23
Content-type: text/html
Run Code Online (Sandbox Code Playgroud)
我安装了最新版本的GAE SDK.
当然我可以运行运行时变量设置为php而不是php55,但我仍然想知道为什么运行时:php55不能在localhost上工作,如果我在这里遗漏了什么.
在Laravel(5.2)中是否有任何方法可以在自定义对象中调用静态和/或非静态函数,而无需在使用它的所有类中实例化引用对象?
示例:我有App\Helpers\Utilities.php
具有公共功能的类doBeforeTask()
我在我的项目中的所有类中使用此方法,如果我可以调用Utilities::doBeforeTask()
或Utilities->doBeforeTask()
不创建Utilities对象的实例,那将是非常好的$obj = new Utilities();
我想在打印时跳过元素,如果这个元素的值等于6.你能告诉我哪里错了吗?
public class Task3_Killing_6 {
public static void main(String[] args) {
int[] array = {2,4,5,6,8,6,3,4,6};
int[] killSix = new int [9];
for (int i = 0; i < array.length - 1; i++) {
if(array[i] == 6){
continue;
} else {
killSix[i] = array[i];
}
}
System.out.println(java.util.Arrays.toString(killSix));
}
}
Run Code Online (Sandbox Code Playgroud)
结果是
[2, 4, 5, 0, 8, 0, 3, 4, 0]
Run Code Online (Sandbox Code Playgroud)
我想成为
[2, 4, 5, 8, 3, 4]
Run Code Online (Sandbox Code Playgroud)