Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Both URL and Method can be captured using curl + CURLOPT_CUSTOMREQUEST --SKIPIF--..

Decoded Output download

--TEST--
Both URL and Method can be captured using curl + CURLOPT_CUSTOMREQUEST
--SKIPIF--
<?php if (!extension_loaded("scoutapm")) die("skip scoutapm extension required."); ?>
<?php if (!extension_loaded("curl")) die("skip curl extension required."); ?>
--FILE--
<?php

var_dump(in_array('curl_exec', scoutapm_list_instrumented_functions()));
scoutapm_enable_instrumentation(true);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://scoutapm.com/robots.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_USERAGENT, 'scoutapp/scout-apm-php-ext Test Suite curl');
curl_exec($ch);

$call = scoutapm_get_calls()[0];

var_dump($call['function']);
var_dump($call['argv']);
?>
--EXPECTF--
bool(true)
string(9) "curl_exec"
array(%d) {
  [%d]=>
  string(%d) "https://scoutapm.com/robots.txt"
  [%d]=>
  NULL
  [%d]=>
  string(%d) "POST"
}

Did this file decode correctly?

Original Code

--TEST--
Both URL and Method can be captured using curl + CURLOPT_CUSTOMREQUEST
--SKIPIF--
<?php if (!extension_loaded("scoutapm")) die("skip scoutapm extension required."); ?>
<?php if (!extension_loaded("curl")) die("skip curl extension required."); ?>
--FILE--
<?php

var_dump(in_array('curl_exec', scoutapm_list_instrumented_functions()));
scoutapm_enable_instrumentation(true);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://scoutapm.com/robots.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_USERAGENT, 'scoutapp/scout-apm-php-ext Test Suite curl');
curl_exec($ch);

$call = scoutapm_get_calls()[0];

var_dump($call['function']);
var_dump($call['argv']);
?>
--EXPECTF--
bool(true)
string(9) "curl_exec"
array(%d) {
  [%d]=>
  string(%d) "https://scoutapm.com/robots.txt"
  [%d]=>
  NULL
  [%d]=>
  string(%d) "POST"
}

Function Calls

None

Variables

None

Stats

MD5 9e2e08ad41f8991b5fd0e13538d0015a
Eval Count 0
Decode Time 94 ms