3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $repeatedFields = [ 1 => [ 'field' => value] ]; /* go through each page and create a PDF for each one */ foreach ($repeatedFields as $formPage => $fieldContent) { $repeatValues = []; foreach ($fieldContent as $fieldName => $fieldValue) { $repeatValues[$fieldName] = $fieldValue; } } die(var_dump($repeatedFields));
Output for 7.2.0
Warning: Use of undefined constant value - assumed 'value' (this will throw an Error in a future version of PHP) in /in/pIKOh on line 5 array(1) { [1]=> array(1) { ["field"]=> string(5) "value" } }
Output for 5.4.0 - 7.1.10
Notice: Use of undefined constant value - assumed 'value' in /in/pIKOh on line 5 array(1) { [1]=> array(1) { ["field"]=> string(5) "value" } }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/pIKOh on line 3
Process exited with code 255.