Use of undefined constant NIL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Use of undefined constant NIL

Postby mo3awia » 11. June 2015 11:10

when a variable value is NIL , xampp prints an error message on browser
the message is "Use of undefined constant NIL"
i don't want to hide errors in php.ini
I want to solve this problem
By the way it works fine on mamp on (mac and windows) and wamp
mo3awia
 
Posts: 2
Joined: 11. June 2015 11:01
Operating System: windows 8.1 x64

Re: Use of undefined constant NIL

Postby Nobbie » 11. June 2015 13:00

mo3awia wrote:when a variable value is NIL , xampp prints an error message on browser
the message is "Use of undefined constant NIL


Because there is no constant called "NIL". It is "NULL" instead:

http://php.net/manual/en/language.types.null.php
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Use of undefined constant NIL

Postby mo3awia » 11. June 2015 16:01

there is a 'NIL' in php and editors don't have a problem with it
and i said it works fine at mac , windows and on a online server not just local server
mo3awia
 
Posts: 2
Joined: 11. June 2015 11:01
Operating System: windows 8.1 x64

Re: Use of undefined constant NIL

Postby Nobbie » 11. June 2015 18:05

Ok, you know it better than me and better than the PHP documentation. And even better than the PHP interpreter, which gives you that error message.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Use of undefined constant NIL

Postby glitzi85 » 11. June 2015 18:14

mo3awia wrote:there is a 'NIL' in php and editors don't have a problem with it
and i said it works fine at mac , windows and on a online server not just local server

First of all, there is no NIL unless you define it:
Code: Select all
define('NIL', null);

Are you comparing the same script and the same php configuration (and exact version) on all environments?

What code are we talking about? In a Framework this might be defined because it is derived from another programming language where nil is used instead of null?
----------------------------------------------------
EDIT: Scratch that. Testscript:
Code: Select all
<?php
var_dump(NIL);
?>

Windows (PHP 5.5.15): int(0)
Arch (PHP 5.6.9): int(0)
Ubuntu (PHP 5.5.9): string(3) "NIL"

I will investigate that.
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Use of undefined constant NIL

Postby glitzi85 » 11. June 2015 18:37

User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 120 guests