Annotation of embedaddon/php/ext/standard/tests/general_functions/var_export_basic7.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test var_export() function with valid null values
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : mixed var_export(mixed var [, bool return])
! 6: * Description: Outputs or returns a string representation of a variable
! 7: * Source code: ext/standard/var.c
! 8: * Alias to functions:
! 9: */
! 10:
! 11: echo "*** Testing var_export() with valid null values ***\n";
! 12:
! 13: // different valid null vlaues
! 14: $unset_var = array();
! 15: unset ($unset_var); // now a null
! 16: $null_var = NULL;
! 17:
! 18: $valid_nulls = array(
! 19: "NULL" => NULL,
! 20: "null" => null,
! 21: "null_var" => $null_var,
! 22: );
! 23:
! 24: /* Loop to check for above null values with var_export() */
! 25: echo "\n*** Output for null values ***\n";
! 26: foreach($valid_nulls as $key => $null_value) {
! 27: echo "\n-- Iteration: $key --\n";
! 28: var_export( $null_value );
! 29: echo "\n";
! 30: var_export( $null_value, FALSE);
! 31: echo "\n";
! 32: var_dump( var_export( $null_value, true) );
! 33: echo "\n";
! 34: }
! 35: ?>
! 36: ===DONE===
! 37: --EXPECT--
! 38: *** Testing var_export() with valid null values ***
! 39:
! 40: *** Output for null values ***
! 41:
! 42: -- Iteration: NULL --
! 43: NULL
! 44: NULL
! 45: string(4) "NULL"
! 46:
! 47:
! 48: -- Iteration: null --
! 49: NULL
! 50: NULL
! 51: string(4) "NULL"
! 52:
! 53:
! 54: -- Iteration: null_var --
! 55: NULL
! 56: NULL
! 57: string(4) "NULL"
! 58:
! 59: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>