3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $redirect_uri = 'http://path/to/app/callback'; $url = 'https://getpocket.com/v3/oauth/request'; $data = array('consumer_key' => '27963-b8ab8bc16d50240c6b5aa93b', 'redirect_uri' => $redirect_uri); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded; charset=UTF-8", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $request_token = str_replace('code=','',$result); $_SESSION['request_token'] = $request_token; header("Location: https://getpocket.com/auth/authorize?request_token=$request_token&redirect_uri=$redirect_uri"); die(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/4ddM4 on line 16 Warning: file_get_contents(): open_basedir restriction in effect. File(https://getpocket.com/v3/oauth/request) is not within the allowed path(s): (/tmp:/in:/etc) in /in/4ddM4 on line 16 Warning: file_get_contents(https://getpocket.com/v3/oauth/request): Failed to open stream: Operation not permitted in /in/4ddM4 on line 16 Warning: Cannot modify header information - headers already sent by (output started at /in/4ddM4:16) in /in/4ddM4 on line 22

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:
37.68 ms | 402 KiB | 8 Q