Created
August 2, 2018 16:54
-
-
Save Frago9876543210/d012c24a5347cfa5a0be58f68679798b to your computer and use it in GitHub Desktop.
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 | |
declare(strict_types=1); | |
class clazz{ | |
public $var1 = "value1"; | |
protected $var2 = "value2"; | |
private $var3 = "value3"; | |
} | |
$array = ((array) new clazz); | |
var_dump($array["var1"]); //public | |
var_dump($array["\0*\0var2"]); //protected | |
var_dump($array["\0" . clazz::class . "\0var3"]); //private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment