Annotation of embedaddon/php/ext/standard/tests/general_functions/var_export_basic2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test var_export() function with valid boolean values
                      3: --FILE--
                      4: <?php
                      5: 
                      6: /* Prototype  : mixed var_export(mixed var [, bool return])
                      7:  * Description: Outputs or returns a string representation of a variable 
                      8:  * Source code: ext/standard/var.c
                      9:  * Alias to functions: 
                     10:  */
                     11: 
                     12: echo "*** Testing var_export() with valid boolean values ***\n";
                     13: // different valid  boolean vlaues 
                     14: $valid_bool = array(
                     15:                    "1" => 1,
                     16:                    "TRUE" => TRUE,
                     17:             "true" => true, 
                     18:             "0" => 0,
                     19:                    "FALSE" => FALSE,
                     20:                    "false" => false
                     21: );
                     22:                
                     23: /* Loop to check for above boolean values with var_export() */
                     24: echo "\n*** Output for boolean values ***\n";
                     25: foreach($valid_bool as $key => $bool_value) {
                     26:        echo "\n-- Iteration: $key --\n";
                     27:        var_export( $bool_value );
                     28:        echo "\n";
                     29:        var_export( $bool_value, FALSE);
                     30:        echo "\n";
                     31:        var_dump( var_export( $bool_value, TRUE) );
                     32:        echo "\n";
                     33: }
                     34: ?>
                     35: ===DONE===
                     36: --EXPECT--
                     37: *** Testing var_export() with valid boolean values ***
                     38: 
                     39: *** Output for boolean values ***
                     40: 
                     41: -- Iteration: 1 --
                     42: 1
                     43: 1
                     44: string(1) "1"
                     45: 
                     46: 
                     47: -- Iteration: TRUE --
                     48: true
                     49: true
                     50: string(4) "true"
                     51: 
                     52: 
                     53: -- Iteration: true --
                     54: true
                     55: true
                     56: string(4) "true"
                     57: 
                     58: 
                     59: -- Iteration: 0 --
                     60: 0
                     61: 0
                     62: string(1) "0"
                     63: 
                     64: 
                     65: -- Iteration: FALSE --
                     66: false
                     67: false
                     68: string(5) "false"
                     69: 
                     70: 
                     71: -- Iteration: false --
                     72: false
                     73: false
                     74: string(5) "false"
                     75: 
                     76: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>