Created
November 16, 2011 06:49
-
-
Save olegwtf/1369465 to your computer and use it in GitHub Desktop.
Export variable from the class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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