3v4l.org

run code in 300+ PHP versions simultaneously
<?php header("Content-Type: text/html; charset=utf-8"); $array1 = explode("\n",$_POST['mytxt2']); for($i=0;$i<sizeof($array1);$i++){ $array2[$i] = explode('=', $array1[$i]); } $final_balance =0; echo "address=n_tx=total_received=final_balance<br>"; $url = 'https://blockchain.info/multiaddr?active='; for($i=0;$i<sizeof($array2);$i++){ $url .= $array2[$i][1].'|'; if ((($i % 128 == 0)&($i <> 0)) || $i==sizeof($array2)-1) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL,$url); $result=curl_exec($ch); $obj = json_decode($result); for($j=0;$j<sizeof($obj->{'addresses'});$j++){ if($obj->{'addresses'}[$j]->{'n_tx'}>0) {echo "<b>";} if($obj->{'addresses'}[$j]->{'final_balance'}>0) {echo "<font color=red>";} $final_balance += $obj->{'addresses'}[$j]->{'final_balance'}/100000000; echo $obj->{'addresses'}[$j]->{'address'}.'='.($obj->{'addresses'}[$j]->{'n_tx'}).'='.(sprintf("%.7f", $obj->{'addresses'}[$j]->{'total_received'}/100000000)).'='.(sprintf("%.7f", $obj->{'addresses'}[$j]->{'final_balance'}/100000000)).'<br>'; if($obj->{'addresses'}[$j]->{'final_balance'}>0) {echo "</font color>";} if($obj->{'addresses'}[$j]->{'n_tx'}>0) {echo "</b>";} } echo '!<br>'; $url = 'https://blockchain.info/multiaddr?active='; } } echo '!ALL: <b>'.(sprintf("%.7f", $final_balance)).'</b> BTC<br>'; echo '<b>by agran / BTC: 1agran1xQ4Nwiqv1qegBDF6kqZdfESMUG</b>'; ?>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined array key "mytxt2" in /in/uU8tv on line 5 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/uU8tv on line 5 address=n_tx=total_received=final_balance<br> Warning: Undefined array key 1 in /in/uU8tv on line 13 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uU8tv:16 Stack trace: #0 {main} thrown in /in/uU8tv on line 16
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 Warning: Undefined array key "mytxt2" in /in/uU8tv on line 5 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/uU8tv on line 5 address=n_tx=total_received=final_balance<br> Warning: Undefined array key 1 in /in/uU8tv on line 13 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uU8tv:16 Stack trace: #0 {main} thrown in /in/uU8tv on line 16
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Warning: Undefined array key "mytxt2" in /in/uU8tv on line 5 address=n_tx=total_received=final_balance<br> Warning: Undefined array key 1 in /in/uU8tv on line 13 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uU8tv:16 Stack trace: #0 {main} thrown in /in/uU8tv on line 16
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined index: mytxt2 in /in/uU8tv on line 5 address=n_tx=total_received=final_balance<br> Notice: Undefined offset: 1 in /in/uU8tv on line 13 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uU8tv:16 Stack trace: #0 {main} thrown in /in/uU8tv on line 16
Process exited with code 255.
Output for 7.3.32 - 7.3.33
address=n_tx=total_received=final_balance<br> Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uU8tv:16 Stack trace: #0 {main} thrown in /in/uU8tv on line 16
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Notice: Undefined index: mytxt2 in /in/uU8tv on line 5 address=n_tx=total_received=final_balance<br> Notice: Undefined offset: 1 in /in/uU8tv on line 13 Fatal error: Call to undefined function curl_init() in /in/uU8tv on line 16
Process exited with code 255.

preferences:
240.51 ms | 402 KiB | 288 Q