Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there something in PHP similar to Option Explicit in VB [duplicate]

Possible Duplicate:
Strict mode in PHP?

I am doing a big project in PHP. In PHP you do not need to declare variables. This is causing a lot of problems for me.

In Visual Basic 6, the Option Explicit statement makes it mandatory to declare variables. Is something similar available in PHP?

like image 832
Cracker Avatar asked Feb 16 '10 15:02

Cracker


1 Answers

If you turn on E_NOTICE error messages, PHP will tell you about uninitialized variables:

ini_set("error_reporting", E_ALL);

Uninitialized is a little bit different than undeclared, but it should give you a similar effect.

like image 124
Tim Yates Avatar answered Sep 24 '22 03:09

Tim Yates