3v4l.org

run code in 300+ PHP versions simultaneously
<?php// User Public/Private Keys $private_key = 'private_key_user_id_QQKsTYtABdHd'; $public_key = 'public_key_user_id_v4dkuUg5pAeV'; // Data to be submitted $my_string = array( 'action' => 'api_register', 'first_name' => ".urlencode($first_name).", 'surname' => ".urlencode($surname).", 'user_password' => ".urlencode($user_password.)", 'user_password_repeat' => ".urlencode($user_password).", 'user_name' => ".urlencode($user_name).", 'signup_channel' => ".urlencode($signup_channel)." ); echo json_encode($my_string); // Generate content verification signature $signature = base64_encode(hash_hmac('sha1', $my_string, $private_key, TRUE)); $curl = curl_init(); if ( !$curl ) { print "Failed to initalise cURL object\n"; } else { $url ='https://www.casafina.com/api/user.php'; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, array("signature" => $signature, "pubKey" => $public_key)); curl_setopt($ch, CURLOPT_POSTFIELDS, $my_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($my_string)) ); if ( !curl_setopt_array( $curl, $curl_opts ) ) { print "Unable to set properties on CURL object\n"; } else { $response = curl_exec( $curl ); $responseCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE ); if ( is_bool( $response ) && $response == false ) { // Failed to make HTTP request to tracking URL echo 'Error from CURL in livefeed: "', curl_error( $curl ), '" ', var_export( curl_getinfo( $curl ), TRUE ); } else if ( ! ( $responseCode >= 200 && $responseCode <= 299 ) ) { // We got an HTTP response, but it was not successful print "Error: Tracking URL returned HTTP $responseCode\n"; } else { // All good print "Success, response was:\n"; echo var_export( $response ), "\n"; } } } curl_close( $curl ); // log the values $values[] = $response; $values[] = $responseCode; $values[] = $my_string; logResults($values, 'Casafina');
Output for git.master, git.master_jit, rfc.property-hooks
<?php// User Public/Private Keys $private_key = 'private_key_user_id_QQKsTYtABdHd'; $public_key = 'public_key_user_id_v4dkuUg5pAeV'; // Data to be submitted $my_string = array( 'action' => 'api_register', 'first_name' => ".urlencode($first_name).", 'surname' => ".urlencode($surname).", 'user_password' => ".urlencode($user_password.)", 'user_password_repeat' => ".urlencode($user_password).", 'user_name' => ".urlencode($user_name).", 'signup_channel' => ".urlencode($signup_channel)." ); echo json_encode($my_string); // Generate content verification signature $signature = base64_encode(hash_hmac('sha1', $my_string, $private_key, TRUE)); $curl = curl_init(); if ( !$curl ) { print "Failed to initalise cURL object\n"; } else { $url ='https://www.casafina.com/api/user.php'; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, array("signature" => $signature, "pubKey" => $public_key)); curl_setopt($ch, CURLOPT_POSTFIELDS, $my_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($my_string)) ); if ( !curl_setopt_array( $curl, $curl_opts ) ) { print "Unable to set properties on CURL object\n"; } else { $response = curl_exec( $curl ); $responseCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE ); if ( is_bool( $response ) && $response == false ) { // Failed to make HTTP request to tracking URL echo 'Error from CURL in livefeed: "', curl_error( $curl ), '" ', var_export( curl_getinfo( $curl ), TRUE ); } else if ( ! ( $responseCode >= 200 && $responseCode <= 299 ) ) { // We got an HTTP response, but it was not successful print "Error: Tracking URL returned HTTP $responseCode\n"; } else { // All good print "Success, response was:\n"; echo var_export( $response ), "\n"; } } } curl_close( $curl ); // log the values $values[] = $response; $values[] = $responseCode; $values[] = $my_string; logResults($values, 'Casafina');

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:
52.19 ms | 409 KiB | 8 Q