Skip to content

Instantly share code, notes, and snippets.

@olegwtf
Created November 16, 2011 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olegwtf/1369465 to your computer and use it in GitHub Desktop.
Save olegwtf/1369465 to your computer and use it in GitHub Desktop.
Export variable from the class
<?php
class Ax {
public $super;
function __construct() {
$this->super = "super";
$GLOBALS['super'] = &$this->super;
}
function say() {
echo $this->super, "\n";
}
}
$xxx = new Ax();
echo $super, "\n";
$super = "good";
$xxx->say();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment