递归PHP函数返回500错误

时间:2016-05-14 16:05:34

标签: php recursion http-status-code-500

嗨我有递归函数,它产生二叉树数组,所以从

开始
var webpack = require('webpack');
var wpStream = require('webpack-stream');
var path = require('path');
var files = ['app.js', 'controller.js', 'etc.js'];

gulp.task('pack', function () {
    return gulp.src(files)
        .pipe(wpStream(
            {
                output: {
                    filename: 'bundle.js'
                },
                plugins: [
                    new webpack.ProvidePlugin({
                        angular: "angular",
                        $: "jquery",
                        jQuery: "jquery"
                    })
                ],
                resolve: {
                    root: path.resolve('./vendor'), // directory that contains jquery.js and angular.js
                    extensions: ['', '.js']
                }
            }
        ).pipe(gulp.dest('dist'));
});

我明白了:

array(
array(
   'name' => 'John',
   'id' => 1,
   'mother_id' => 2,
   'father_id' => 3
),
array(
   'name' => 'Lucy',
   'id' => 2,
   'mother_id' => 5,
   'father_id' => 4
),
array(
   'name' => 'Jim',
   'id' => 3,
   'mother_id' => 7,
   'father_id' => 9
),
array(
   'name' => 'Paul',
   'id' => 4,
   'mother_id' => 534,
   'father_id' => 54
),
array(
   'name' => 'Laura',
   'id' => 5,
   'mother_id' => 554,
   'father_id' => 51
),
array(
   'name' => 'Vanessa',
   'id' => 7,
   'mother_id' => 5354,
   'father_id' => 514
),
array(
   'name' => 'Adam',
   'id' => 9,
   'mother_id' => 245354,
   'father_id' => 514234
),
);

并且它完全正常,直到它获得超过 - + 100值的数组,并且当它获得此数组时,它返回500错误,这对我来说似乎很奇怪,显然我没有无限循环或类似的东西cos,最小的数组解析得很好,但我无法弄清楚这种行为的原因是什么。

array(
 array(
'person' => array(
    'name' => 'John',
    'id' => 1,
    'mother_id' => 2,
    'father_id' => 3
),
'parents' => array(
    'mother' => array(
          'person' => array(
              'name' => 'Lucy',
              'id' => 2,
              'mother_id' => 5,
              'father_id' => 4
          ),
          'parents' => array(
              'mother' => array(
                  'person' => array(
                      'name' => 'Laura',
                      'id' => 5,
                      'mother_id' => 554,
                      'father_id' => 51
                  ),
                  'parents' => array(...)
              ),
              'father' => array(
                    'person' => array(
                        'name' => 'Paul',
                        'id' => 4,
                        'mother_id' => 534,
                        'father_id' => 54
                    ),
                    'parents' => array(...)
               ), 
          )
    ),
    'father' => ...
 )

0 个答案:

没有答案