dongpian4954 2013-12-04 10:25
浏览 109

使用var_dump()会导致空白页面(启用错误报告)

Does anybody have idea why I get blank page when using var_dump()? In the Joomla global config I set up showing errors too. (checked with phpinfo() and the local values are on too)

<?php
    ini_set('display_errors', 1); 
    error_reporting(E_ALL);  

    $widget_id = $widget->id.'-'.uniqid();
    $settings  = $widget->settings;
    // var_dump($settings);
    // if I uncomment the line above, works fine 
    $sets      = array_chunk($widget->items, $settings['items_per_set']);
    // var_dump($sets); 
    // if I uncomment the line above 
    // and not using the the foreach below
    // blank page appears
    foreach ($sets as $set => $items){
                    var_dump($items);
                      // this line above causes blank page
                        } 

    foreach (array_keys($sets) as $s) {
        $nav[] = '<li><span></span></li>';
    }

    $i = 0;           
?>

Thank you.

  • 写回答

1条回答 默认 最新

  • dongxianji0968 2013-12-04 10:46
    关注

    Save $items into another variable. Try this

     foreach ($sets as $set => $items){
    $testvar=$items;
    var_dump($testvar);
     // this line above causes blank page
         } 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条