Ejemplo n.º 1
0
Archivo: XDebug.php Proyecto: ksst/kf
 public static function showCallStack()
 {
     echo 'CallStack - File: ' . xdebug_call_file();
     echo '<br />Class: ' . xdebug_call_class();
     echo '<br />Function: ' . xdebug_call_function();
     echo '<br />Line: ' . xdebug_call_line();
     echo '<br />Depth of Stacks: ' . xdebug_get_stack_depth();
     echo '<br />Content of Stack: ' . xdebug_var_dump(xdebug_get_function_stack());
 }
Ejemplo n.º 2
0
 public function testDoesNotInfinitelyRecurse()
 {
     $client = new Client(['handler' => function () {
         throw new \RuntimeException('No network access');
     }]);
     $last = null;
     $client->getEmitter()->on('before', function (BeforeEvent $e) use(&$last) {
         $e->intercept(new Response(200));
         if (function_exists('xdebug_get_stack_depth')) {
             if ($last) {
                 $this->assertEquals($last, xdebug_get_stack_depth());
             } else {
                 $last = xdebug_get_stack_depth();
             }
         }
     });
     $requests = [];
     for ($i = 0; $i < 100; $i++) {
         $requests[] = $client->createRequest('GET', 'http://foo.com');
     }
     $pool = new Pool($client, $requests);
     $pool->wait();
 }
Ejemplo n.º 3
0
<?php

function foo($i)
{
    echo "{$i}\n";
    foo($i + 1);
}
$i = xdebug_get_stack_depth();
ini_set("xdebug.max_nesting_level", $i + 3);
echo "{$i}\n";
foo($i + 1);
Ejemplo n.º 4
0
 /**
  * Returns the stack depth level.
  * The main body of a script is level 0 and each include and/or function call adds one to the stack depth level.
  * @return int
  */
 public function getStackDepth()
 {
     return xdebug_get_stack_depth();
 }