3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test { public $chciDoArray1 = '1'; public $chciDoArray2 = '2'; public $chciDoArray3 = '3'; public $neChciDoArray = 'oops'; public function ohMyHandsWillFallOff() { return [ $this->chciDoArray1, $this->chciDoArray2, $this->chciDoArray3, ]; } } $a = new test(); var_dump((array)$a, json_decode(json_encode($a), true), $a->ohMyHandsWillFallOff());
Output for 7.3.0rc3
array(4) { ["chciDoArray1"]=> string(1) "1" ["chciDoArray2"]=> string(1) "2" ["chciDoArray3"]=> string(1) "3" ["neChciDoArray"]=> string(4) "oops" } array(4) { ["chciDoArray1"]=> string(1) "1" ["chciDoArray2"]=> string(1) "2" ["chciDoArray3"]=> string(1) "3" ["neChciDoArray"]=> string(4) "oops" } array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" }