Login   Register  
PHP Classes
elePHPant
Icontem

File: test/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Leon Sorokin  >  dump_r  >  test/index.php  >  Download  
File: test/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: dump_r
Display values of variables
Author: By
Last change: dupe ref and recursion detection for arrays
Date: 6 months ago
Size: 1,244 bytes
 

Contents

Class file image Download
<?php
    
require __DIR__ '/../dump_r.php';
    include 
__DIR__ '/obj.php';

//    dump_r\Rend::$sql_pretty = true;
//    dump_r\Rend::$xml_pretty = true;
//    dump_r\Rend::$json_pretty = true;

?><!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <h1>dump_r()</h1>

        <h2>html (default)</h2>
        <?php dump_r($obj); ?>

        <h2>limited pre-expand and recursion</h2>
        <style>
            .dump_r .myVals > * {
                background: lightyellow !important;
            }
        </style>
        <?php
            dump_r
\Type::$dic = array();
            
dump_r($objfalsetrue21);
        
?>

        <h2>text-only</h2>
        <pre><?php
            dump_r
\Type::$dic = array();
            
$ascii dump_r($objtruefalse1e31);
            echo 
htmlspecialchars($asciiENT_NOQUOTES);
        
?></pre>

        <h2>limited recursion</h2>
        <pre><?php
            dump_r
\Type::$dic = array();
            
$ascii dump_r($objtruefalse11);
            echo 
htmlspecialchars($asciiENT_NOQUOTES);
        
?></pre>

        <h2>native print_r()</h2>
        <pre><?=print_r($objtrue)?></pre>

        <h2>native var_dump()</h2>
        <pre><? var_dump($obj); ?></pre>

        <a href="https://github.com/leeoniya/dump_r.php"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
    </body>
</html>