3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Undefined constant "PROD_LITIGANT_ALERT_NAME" in /in/dfVBM:24 Stack trace: #0 {main} thrown in /in/dfVBM on line 24
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Undefined constant "PROD_LITIGANT_ALERT_NAME" in /in/dfVBM:24 Stack trace: #0 {main} thrown in /in/dfVBM on line 24
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
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 7.1.0 - 7.1.20
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/>

preferences:
131.06 ms | 402 KiB | 161 Q