3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'https://www.tiny.com.br/api2/produtos.pesquisa.php'; $token = '6134695a443b60856faf745793258745e3328a33'; $pesquisa = 'xxxxx'; $data = "token=$token&pesquisa=$pesquisa&formato=XML"; enviarREST($url, $data); function enviarREST($url, $data, $optional_headers = null) { $params = array('http' => array( 'method' => 'POST', 'content' => $data )); if ($optional_headers !== null) { $params['http']['header'] = $optional_headers; } $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx); if (!$fp) { throw new Exception("Problema com $url, $php_errormsg"); } $response = @stream_get_contents($fp); if ($response === false) { throw new Exception("Problema obtendo retorno de $url, $php_errormsg"); } return $response; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $php_errormsg in /in/gAsHF on line 23 Fatal error: Uncaught Exception: Problema com https://www.tiny.com.br/api2/produtos.pesquisa.php, in /in/gAsHF:23 Stack trace: #0 /in/gAsHF(8): enviarREST('https://www.tin...', 'token=6134695a4...') #1 {main} thrown in /in/gAsHF on line 23
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:
75.71 ms | 401 KiB | 8 Q