3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $s=100; $_POST['ar1[]']=array("1"=>"1"); $_POST['ar2[]']=[]; $_POST['ar3[]']=[]; $_POST['a1']=1; $_POST['a2']=2; $_POST['a3']=3; $_POST['a4']=4; $_POST['a5']=5; $_POST['a6']=6; $_POST['a7']=7; $_POST['a8']=8; $_POST['a9']=9; $_POST['a10']=10; foreach ($_POST as $p ) { if(is_array($p)) $s+=-17; else $s-=-2; echo $p."\n"; } if ($s!==69) die(); echo 'udalo sie 69';
based on tRuh5
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
Notice: Array to string conversion in /in/0m9RM on line 19 Array Notice: Array to string conversion in /in/0m9RM on line 19 Array Notice: Array to string conversion in /in/0m9RM on line 19 Array 1 2 3 4 5 6 7 8 9 10 udalo sie 69