1--TEST-- 2Test define_syslog_variables() function : basic functionality 3--SKIPIF-- 4<?php 5if(substr(PHP_OS, 0, 3) != "WIN") 6 die("skip Only run on Windows"); 7?> 8--FILE-- 9<?php 10/* Prototype : void define_syslog_variables(void) 11 * Description: Initializes all syslog-related variables 12 * Source code: ext/standard/syslog.c 13 * Alias to functions: 14 */ 15 16echo "*** Testing define_syslog_variables() : basic functionality ***\n"; 17 18$log_constants = array( 19 LOG_EMERG, 20 LOG_ALERT, 21 LOG_CRIT, 22 LOG_ERR, 23 LOG_WARNING, 24 LOG_NOTICE, 25 LOG_INFO, 26 LOG_DEBUG, 27 LOG_KERN, 28 LOG_USER, 29 LOG_MAIL, 30 LOG_DAEMON, 31 LOG_AUTH, 32 LOG_SYSLOG, 33 LOG_LPR, 34 LOG_NEWS, 35 LOG_UUCP, 36 LOG_CRON, 37 LOG_AUTHPRIV, 38 LOG_PID, 39 LOG_CONS, 40 LOG_ODELAY, 41 LOG_NDELAY, 42 LOG_NOWAIT, 43 LOG_PERROR, 44); 45 46 47$log_variables = array( 48 "LOG_EMERG", 49 "LOG_ALERT", 50 "LOG_CRIT", 51 "LOG_ERR", 52 "LOG_WARNING", 53 "LOG_NOTICE", 54 "LOG_INFO", 55 "LOG_DEBUG", 56 "LOG_KERN", 57 "LOG_USER", 58 "LOG_MAIL", 59 "LOG_DAEMON", 60 "LOG_AUTH", 61 "LOG_SYSLOG", 62 "LOG_LPR", 63 "LOG_NEWS", 64 "LOG_UUCP", 65 "LOG_CRON", 66 "LOG_AUTHPRIV", 67 "LOG_PID", 68 "LOG_CONS", 69 "LOG_ODELAY", 70 "LOG_NDELAY", 71 "LOG_NOWAIT", 72 "LOG_PERROR", 73); 74 75error_reporting(E_ALL); 76$failed = false; 77 78// show variables not defined 79foreach($log_variables as $log_var) { 80 if (isset($$log_var)) { 81 $failed = true; 82 echo "FAILED: variable defined\n"; 83 } 84} 85 86var_dump( define_syslog_variables() ); 87 88// show variables defined 89for ($t = 0; $t < count($log_variables); $t++) { 90 if (isset($$log_variables[$t]) === false || $$log_variables[$t] != $log_constants[$t]) { 91 $failed = true; 92 echo "FAILED: $log_variables[$t] doesn't contain the correct value\n"; 93 } 94} 95 96if ($failed == false) { 97 echo "PASSED\n"; 98} 99?> 100===DONE=== 101--EXPECTF-- 102*** Testing define_syslog_variables() : basic functionality *** 103 104Deprecated: Function define_syslog_variables() is deprecated in %s on line %d 105NULL 106PASSED 107===DONE=== 108