3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_0 = ['foo']; $array_1 = ['bar']; for ($i = 0; $i <= 1; $i++) { print_r(${'array_' . $i}); // Here we "build" the variable name }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
216.31 ms | 2115 KiB | 9 Q