3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function encodePost(array $post, $print=false){ $_post_string = array(); foreach($post as $key=>$value){ if(!is_array($value)){ $_post_string[] = $key."=".urlencode($value); }else{ foreach($value as $k=>$v){ $_post_string[] = $key."[]=".urlencode($v); } } } $_post_string = implode("&",$_post_string); if($print){ echo "<br/>".$_post_string."<br/>"; } return $_post_string; } $post = [ 'hash' => '62d417c8554711d322887588ed8ab3dd4636c8d5', 'product' => PROD_LITIGANT_ALERT_NAME, 'hits' => 20, 'rows' => 1000, 'billable_rows' => 850, 'errors' => [ '567 - Unknown zipcode [ignoring]', '23 - Invalid radius format [using default]', '150 - Data does not match header count, 1 extra columns [not searching]' ], 'submitted' => '2018-04-25 15:24:32', 'completed' => '2018-04-25 16:01:12' ]; encodePost($post, true);
Output for 7.2.0 - 7.3.0alpha1
Warning: Use of undefined constant PROD_LITIGANT_ALERT_NAME - assumed 'PROD_LITIGANT_ALERT_NAME' (this will throw an Error in a future version of PHP) in /in/dfVBM on line 24 <br/>hash=62d417c8554711d322887588ed8ab3dd4636c8d5&product=PROD_LITIGANT_ALERT_NAME&hits=20&rows=1000&billable_rows=850&errors[]=567+-+Unknown+zipcode+%5Bignoring%5D&errors[]=23+-+Invalid+radius+format+%5Busing+default%5D&errors[]=150+-+Data+does+not+match+header+count%2C+1+extra+columns+%5Bnot+searching%5D&submitted=2018-04-25+15%3A24%3A32&completed=2018-04-25+16%3A01%3A12<br/>
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.21.3, 7.1.0 - 7.1.16
Notice: Use of undefined constant PROD_LITIGANT_ALERT_NAME - assumed 'PROD_LITIGANT_ALERT_NAME' in /in/dfVBM on line 24 <br/>hash=62d417c8554711d322887588ed8ab3dd4636c8d5&product=PROD_LITIGANT_ALERT_NAME&hits=20&rows=1000&billable_rows=850&errors[]=567+-+Unknown+zipcode+%5Bignoring%5D&errors[]=23+-+Invalid+radius+format+%5Busing+default%5D&errors[]=150+-+Data+does+not+match+header+count%2C+1+extra+columns+%5Bnot+searching%5D&submitted=2018-04-25+15%3A24%3A32&completed=2018-04-25+16%3A01%3A12<br/>
Output for hhvm-3.22.0
Notice: Use of undefined constant PROD_LITIGANT_ALERT_NAME - assumed 'PROD_LITIGANT_ALERT_NAME' in /in/dfVBM on line -1 <br/>hash=62d417c8554711d322887588ed8ab3dd4636c8d5&product=PROD_LITIGANT_ALERT_NAME&hits=20&rows=1000&billable_rows=850&errors[]=567+-+Unknown+zipcode+%5Bignoring%5D&errors[]=23+-+Invalid+radius+format+%5Busing+default%5D&errors[]=150+-+Data+does+not+match+header+count%2C+1+extra+columns+%5Bnot+searching%5D&submitted=2018-04-25+15%3A24%3A32&completed=2018-04-25+16%3A01%3A12<br/>