strict warning: var: Deprecated. Please use the public/private/protected modifiers in c:\www\drupal-cvs\themes\engines\xtemplate\xtemplate.inc on line 42.

in a part of php.ini I've got this:
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off

Comments

marcelloh’s picture

It's my point and I've got to add that I'm using PHP 5.02 under Windows XP SP2
Perhaps that helps a little bit.

BTW: The status isn't fixed, because it isn't fixed.
The status should be open, or something....?

Anonymous’s picture

I have this proble in my win2003 sever. But It's OK in my local windows XP.
how to resolve it ?:

strict warning: var: Deprecated. Please use the public/private/protected modifiers in D:\ee\web\php\drupal\themes\engines\xtemplate\xtemplate.inc on line 42.
strict warning: var: Deprecated. Please use the public/private/protected modifiers in D:\ee\web\php\drupal\themes\engines\xtemplate\xtemplate.inc on line 43.
strict warning: var: Deprecated. Please use the public/private/protected modifiers in D:\ee\web\php\drupal\themes\engines\xtemplate\xtemplate.inc on line 44.
strict warning: var: Deprecated. Please use the public/private/protected modifiers in D:\ee\web\php\drupal\themes\engines\xtemplate\xtemplate.inc on line 45.
.....

narres’s picture

Version: 4.5.0-rc »
Component: base system » theme system

I have changed to:
private $filecontents=""; /* raw contents of template file */
private $blocks=array(); /* unparsed blocks */
private $pars...

from:
var $filecontents=""; /* raw contents of template file */
var $blocks=array(); /* unparsed blocks */
var $pars...

in themes/engines/xtemplate/xtemplate.inc

narres’s picture

I have changed to:
private $filecontents=""; /* raw contents of template file */
private $blocks=array(); /* unparsed blocks */
private $pars...

from:
var $filecontents=""; /* raw contents of template file */
var $blocks=array(); /* unparsed blocks */
var $pars...

in themes/engines/xtemplate/xtemplate.inc

TDobes’s picture

The fixes you suggest do work for PHP 5, but they completely break xtemplate for PHP 4 users.

The short-term solution is to turn off these strict error messages. (See this issue.) A long-term solution is being discussed in the Make Drupal PHP 5 Compliant task... This suggestion looks particularly promising.

Marking this as a duplicate.

Anonymous’s picture

it works to change var by private like narras said..
Dont know why but worked fine..
thanks

TDobes’s picture

FYI: The reason we do not simply follow narres' suggestion, which fixes this problem for PHP5, is that changing var to private breaks the xtemplate engine for PHP4. We'd like to maintain backwards compatibility with PHP4, which still is used on many (probably most) shared hosts.