3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://beta.congress.gov/search?pageSort=dateOfIntroduction%3Adesc&q={%22congress%22%3A%22112|113|111|110|109|108|107|106%22%2C%22source%22%3A%22legislation%22}&pageSize=25'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // write the response to a variable curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // follow redirects if any curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 600); curl_setopt($ch, CURLOPT_TIMEOUT, 600); $contents = curl_exec($ch); libxml_use_internal_errors(true); $dom = new DOMDocument; $dom->loadHTML($contents); header('content-type: text/plain'); $xpath = new DOMXPath($dom); $found = $xpath->query('//ul[@class="results_list"]/li'); $results = array(); foreach ($found as $li) { $bill = $xpath->query('h2/a', $li); $bill_name = $bill->item(0)->nodeValue; $bill_url = $bill->item(0)->getAttribute('href'); $sponsor = $xpath->query('table/tbody/tr/td/a', $li); $sponsor_name = $sponsor->item(0)->nodeValue; $sponsor_url = $sponsor->item(0)->getAttribute('href'); $results[] = array( $bill_name => $bill_url, $sponsor_name => $sponsor_url ); } var_dump($results);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/THI6S:4 Stack trace: #0 {main} thrown in /in/THI6S on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.99 ms | 401 KiB | 8 Q