Jump to content

[SOLVED] Use of undefined constant void - assumed 'void'


MrCreeky

Recommended Posts

Hi,

 

Today I have started getting this error:

Notice: Use of undefined constant void - assumed 'void'

Line of code:

<?php 
  $day   = ($row_rs1_events['ddate']);     // Day of the countdown
  $month = ($row_rs1_events['mdate']);      // Month of the countdown
  $year  = ($row_rs1_events['ydate']);   // Year of the countdown
  $hour  = 24;     // Hour of the day (east coast time)
  $event = ($row_rs1_events['name']); //event

  $calculation = ((mktime ($hour,0,0,$month,$day,$year) - time(void))/3600);
  $hours = (int)$calculation;
  $days  = (int)($hours/24);
?>

 

 

and this one:

Notice: Undefined index: loginid in

Line of code:

<div class="login_div" id="login_div"><form action="index.php" method="get" enctype="multipart/form-data" name="login" class="login_form" id="login_form">
<span class="login_text">Login ID</span> <input name="loginid" type="text" size="10" /></form></div>

 

What would make that just start to happen?

 

Windows Server 2003, PHP 5.2.8

http://www.hifisquad.com/test.php

Some sites show (void) as a optional parameter.

 

Like the manual you mean? The meaning of the word void....

 

Containing nothing; empty; vacant; not occupied; not

filled.

 

Some people need to read a manual about reading manuals. Optional arguments are surrounded by [] brackets.

 

Removing it worked but why would it have only just started to show this error on my part?

 

Maybe your error_reporting level has changed?

And some people need to not assume...

 

http://www.w3schools.com/PHP/func_date_time.asp

 

Some sites show (void) as a optional parameter.

 

Like the manual you mean? The meaning of the word void....

 

Containing nothing; empty; vacant; not occupied; not

filled.

 

Some people need to read a manual about reading manuals. Optional arguments are surrounded by [] brackets.

 

 

And some people need to not assume...

 

http://www.w3schools.com/PHP/func_date_time.asp

 

Some sites show (void) as a optional parameter.

 

Like the manual you mean? The meaning of the word void....

 

Containing nothing; empty; vacant; not occupied; not

filled.

 

Some people need to read a manual about reading manuals. Optional arguments are surrounded by [] brackets.

 

 

 

Thats what you get reading an unreliable source. Whoever wrote that also cannot read the manual.

Traditionally, 'void', when used in function headers, means that nothing gets passed in.  Not sure why it says "optional" next to it on W3schools.

Regardless, the PHP manual is the best source to rely on for these function prototypes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.