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-- uri_template() invalid expression - error 7 "{!hello}" --FILE-- <?php $data = ar..
Decoded Output download
--TEST--
uri_template() invalid expression - error 7 "{!hello}"
--FILE--
<?php
$data = array(
"id" => "thing",
"var" => "value",
"hello" => "Hello World!",
"empty" => "",
"path" => "/foo/bar",
"x" => "1024",
"y" => "768",
"list" => array("red", "green", "blue"),
"keys" => array(
"semi" => ";",
"dot" => ".",
"comma" => ","
),
"example" => "red",
"searchTerms" => "uri templates"
);
uri_template("{!hello}", $data, $result);
var_dump($result);
?>
--EXPECT--
array(3) {
["result"]=>
string(8) "{!hello}"
["state"]=>
int(3)
["expressions"]=>
array(1) {
[0]=>
array(7) {
["op"]=>
string(0) ""
["sep"]=>
string(1) ","
["ifemp"]=>
string(0) ""
["allow"]=>
bool(false)
["named"]=>
bool(false)
["error"]=>
bool(true)
["vars"]=>
array(1) {
[0]=>
array(3) {
["name"]=>
string(6) "!hello"
["length"]=>
int(0)
["explode"]=>
bool(false)
}
}
}
}
}
Did this file decode correctly?
Original Code
--TEST--
uri_template() invalid expression - error 7 "{!hello}"
--FILE--
<?php
$data = array(
"id" => "thing",
"var" => "value",
"hello" => "Hello World!",
"empty" => "",
"path" => "/foo/bar",
"x" => "1024",
"y" => "768",
"list" => array("red", "green", "blue"),
"keys" => array(
"semi" => ";",
"dot" => ".",
"comma" => ","
),
"example" => "red",
"searchTerms" => "uri templates"
);
uri_template("{!hello}", $data, $result);
var_dump($result);
?>
--EXPECT--
array(3) {
["result"]=>
string(8) "{!hello}"
["state"]=>
int(3)
["expressions"]=>
array(1) {
[0]=>
array(7) {
["op"]=>
string(0) ""
["sep"]=>
string(1) ","
["ifemp"]=>
string(0) ""
["allow"]=>
bool(false)
["named"]=>
bool(false)
["error"]=>
bool(true)
["vars"]=>
array(1) {
[0]=>
array(3) {
["name"]=>
string(6) "!hello"
["length"]=>
int(0)
["explode"]=>
bool(false)
}
}
}
}
}
Function Calls
uri_template | 1 |
Stats
MD5 | ee91c390f4e973aabb07d944389b4834 |
Eval Count | 0 |
Decode Time | 85 ms |