Created
December 9, 2013 11:54
-
-
Save jiskanulo/7871172 to your computer and use it in GitHub Desktop.
hogehoge
This file contains 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 Hoge | |
{ | |
public $hoge = array(1,2,3); | |
private $_page = array('a','b','c'); | |
} | |
function falsificate(& $property) | |
{ | |
$property = array('kaizan'); | |
} | |
$hoge = new Hoge; | |
var_dump($hoge); | |
falsificate($hoge->_page); | |
var_dump($hoge); |
This file contains 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 hoge.php | |
object(Hoge)#1 (2) { | |
["hoge"]=> | |
array(3) { | |
[0]=> | |
int(1) | |
[1]=> | |
int(2) | |
[2]=> | |
int(3) | |
} | |
["_page":"Hoge":private]=> | |
array(3) { | |
[0]=> | |
string(1) "a" | |
[1]=> | |
string(1) "b" | |
[2]=> | |
string(1) "c" | |
} | |
} | |
PHP Fatal error: Cannot access private property Hoge::$_page in /Users/jiska/Workspace/befool/b3m/hoge.php on line 20 | |
Fatal error: Cannot access private property Hoge::$_page in /Users/jiska/Workspace/befool/b3m/hoge.php on line 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment