rafaelmorais
rafaelmorais

Reputation: 1383

Fat Free Framework change $f3 variable name

For those who know FatFree Framework, you are used to see this variable $f3. I want to change it to some other name more intuitive like $this or $app, and although I know that it's possible, what are the counter parts of doing that?

For example, this code:

<?php

$f3=require('lib/base.php');

$f3->set('DEBUG',1);
if ((float)PCRE_VERSION<7.9)
    trigger_error('PCRE version is out of date');

$f3->config('config.ini');

Would be:

<?php

$app=require('lib/base.php');

$app->set('DEBUG',1);
if ((float)PCRE_VERSION<7.9)
    trigger_error('PCRE version is out of date');

$app->config('config.ini');

Upvotes: 0

Views: 416

Answers (1)

xfra35
xfra35

Reputation: 3908

There's absolutely no counterpart of doing so. Here, $f3 is a local PHP variable, which can be renamed to whatever you like, as long as you follow the usual rules for PHP variables.

Especially, PHP won't allow you to rename it to $this, which is a reserved keyword.

Upvotes: 1

Related Questions