PHP warning: array_shift() expects parameter 1 to be array, null given in /home5/…/php/symfony/command/sfCommandManager.class.php

萝らか妹 提交于 2019-12-11 04:48:46

问题


array_shift() expects parameter 1 to be array, null given in /home5/.../php/symfony/command/sfCommandManager.class.php

is the error I'm getting.

I am trying to set up a Symfony 1.4 project using Bluehost, and I receive this error in the error log when I try to run symfony generate:project project name.


回答1:


You need to give the array_shift() the parameter! Look this example:

$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_shift($stack); // Here you give the parameter
print_r($fruit);

You give the null parameter on array_shift() and you need to change it!

Update:

array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array keys will be modified to start counting from zero while literal keys won't be touched. Read here for more



来源:https://stackoverflow.com/questions/18027149/php-warning-array-shift-expects-parameter-1-to-be-array-null-given-in-home5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!