1--TEST-- 2Test 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 11echo "*** Testing var_export() with valid null values ***\n"; 12 13// different valid null values 14$unset_var = array(); 15unset ($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() */ 25echo "\n*** Output for null values ***\n"; 26foreach($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 -- 43NULL 44NULL 45string(4) "NULL" 46 47 48-- Iteration: null -- 49NULL 50NULL 51string(4) "NULL" 52 53 54-- Iteration: null_var -- 55NULL 56NULL 57string(4) "NULL" 58 59===DONE=== 60