- var_dump: documentation ( source)
- phpversion: documentation ( source)
<?php
phpversion() >= "7.0.0" or die();
$foo = 'foo';
$bar = new stdClass;
$bar->$foo = array(10, 20, 30); // $bar->foo => array(10, 20, 30)
$bar->{$foo[0]} = 42; // dynamic property $f = 42 – derived from zero offset of ‘foo’
$bar->$foo[0] = 42; // zeroth element of array that $foo identifies = 42
var_dump($bar);