Пример #1
0
<?php

/**
 * @package     JBDump test
 * @version     1.2.0
 * @author      admin@joomla-book.ru
 * @link        http://joomla-book.ru/
 * @copyright   Copyright (c) 2009-2011 Joomla-book.ru
 * @license     GNU General Public License version 2 or later; see LICENSE
 * 
 */
include './included_file.php';
JBDump::showErrors();
?>
<h3>Code</h3><?php 
JBDump(file_get_contents(__FILE__), 0, '-= Code =-::source');
?>
<h3>Result</h3><?php 
echo '$jbdump = jbdump::i()->post()->get()->server();';
$jbdump = jbdump::i()->post()->get()->server();
echo 'jbdump::get();';
jbdump::get();
echo 'jbdump::post();';
jbdump::post();
echo 'jbdump::server();';
jbdump::server();
echo '$jbdump->get();';
$jbdump->get();
echo "jbdump()->dump('123')->get();";
jbdump()->dump('123')->get();
Пример #2
0
    foreach ($vect as $pos => $value) {
        if (!is_numeric($value)) {
            trigger_error("Value at position {$pos} is not a number, using 0 (zero)", E_USER_NOTICE);
            $value = 0;
        }
        $temp[$pos] = log($scale) * $value;
    }
    return $temp;
}
function testFuncArgs($a, $b, $c = 123456)
{
    jbdump::args();
}
// session start
session_start();
// user defined constants
define('CONSTANT_1', true);
define('CONSTANT_2', 'text');
// vars
$stdClass = new stdClass();
$stdClass->property = 'Property value';
$jsonData = '{"J":5,"0":"N"}';
// simple complex va
$var = array('null' => NULL, 'bool' => TRUE, 'integer' => 10, 'float' => 100.5, 'string' => '10 123 34', 'longString' => file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testfile.txt'), 'stdClass' => $stdClass, 'simpleObject' => new simpleObject(), 'json' => $jsonData, 'function' => $simpleClosureFunction);
// nested vars
$var['var'] = $var;
if (!class_exists('JBDump')) {
    include_once '../class.jbdump.php';
}
jbdump::i(array('root' => realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'), 'profiler' => array('render' => 28, 'showEnd' => 1)));