4.2.48. Var To Public

Replace the var syntax with public keyword.

It is also possible to replace it with protected or private, with the parameter.

4.2.48.1. Before

<?php

class x {
    var $y = 1;
}
?>

4.2.48.2. After

<?php

class x {
    public $y = 1;
}
?>

4.2.48.3. Parameters

Name

Default

Type

Description

var_to_visibility

public

string

The destination visibility to be used. May be one of: public, protected or private.

4.2.48.5. Specs

Short Name

Classes/VarToPublic

Exakat version

2.3.0

Available in

Entreprise Edition, Exakat Cloud