有一段时间,我正在使用Phpstorm EAP,并且xdebug完美运行.我最近购买了个人许可证,并将我在EAP中的所有设置导入7.1.3.现在xdebug不起作用.
这是xdebug.ini
zend_extension=xdebug.so
xdebug.remote_host = 192.168.56.1
xdebug.remote_cookie_expire_time = 36000
xdebug.remote_log = /tmp/xdebug.log
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.idekey="PHPSTORM"
xdebug.scream=0
xdebug.remote_connect_back=1
xdebug.show_local_vars=1
Run Code Online (Sandbox Code Playgroud)
xdebug也在php.ini中显示.我甚至在http://xdebug.org/wizard.php中运行它并安装了最新版本.
Phpstorm正在侦听端口9000上的xdebug,并且"侦听PHP调试连接"已启用.
我的xdebug日志经常告诉我这个:
Log opened at 2014-07-18 17:46:16
I: Checking remote connect back address.
I: Remote address found, connecting to 192.168.56.1:9000.
E: Time-out connecting to client. :-(
Log closed at 2014-07-18 17:46:16
Run Code Online (Sandbox Code Playgroud)
我甚至尝试过注册表编辑:http://brianreiter.org/2010/09/18/fix-virtualbox-host-only-network-adapter-creates-a-virtual-public-network-connection-that-causes -Windows到禁用服务/
无论我尝试什么,xdebug都会超时.即使关闭了所有防火墙.
我在Windows 7 Enterprise上.VM是puphpet/centos65-x64
编辑 忘了在Phpstorm中提到IDE密钥是PHPSTORM
我有这样一个数组:
array(
'firstName' => 'Joe',
'lastName' => 'Smith'
)
Run Code Online (Sandbox Code Playgroud)
我需要循环遍历数组中的每个元素,最后,数组应如下所示:
array(
'FirstName' => 'Joe',
'LastName' => 'Smith'
)
Run Code Online (Sandbox Code Playgroud)
失败的想法是:
foreach($array as $key => $value)
{
$key = ucfirst($key);
}
Run Code Online (Sandbox Code Playgroud)
这显然不起作用,因为数组不是通过引用传递的.但是,所有这些尝试也都失败了:
foreach(&$array as $key => $value)
{
$key = ucfirst($key);
}
foreach($array as &$key => $value)
{
$key = ucfirst($key);
}
Run Code Online (Sandbox Code Playgroud)
我的智慧结束了这个.我正在使用Magento 1.9.0.1 CE,但这与此问题无关.如果你必须知道,我必须这样做的原因是因为我有一堆对象,我将作为一个数组返回组装到SOAP客户端.我正在使用的API要求键以大写字母开头...但是,我不希望将对象的变量名的第一个字母大写.傻,我知道,但我们都回答某人,并且有人想要这样.