1.2.502. Global Definitions

Sets the definitions of global variables across the application.

It creates a Virtualglobal atom, which links to all definitions of that variables, using global $a or $GLOBALS['a'].

It currently doesn’t work with variables in the global space, as it is not known how to detect them : they might be included at some point.

<?php

function foo() {
     global $a;

     $a = 'PHP';
}

function goo() {
     echo $GLOBALS['a'];
}


?>

1.2.502.1. Specs

Short name

Complete/GlobalDefinitions

Rulesets

All

Exakat since

2.5.2

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

High

Features

global, globals

Available in

Entreprise Edition, Exakat Cloud