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-- Test dot notation for a node that is a reference --SKIPIF-- <?php if (!extension_..

Decoded Output download

--TEST--
Test dot notation for a node that is a reference
--SKIPIF--
<?php if (!extension_loaded("jsonpath")) print "skip"; ?>
--FILE--
<?php

$data = [
    "key" => 42,
];

$another = [
    "key" => 43,
];

$data["another"] =& $another;

$jsonPath = new \JsonPath\JsonPath();

$result = $jsonPath->find($data, "$.another.key");

var_dump($result);
?>
--EXPECT--
array(1) {
  [0]=>
  int(43)
}

Did this file decode correctly?

Original Code

--TEST--
Test dot notation for a node that is a reference
--SKIPIF--
<?php if (!extension_loaded("jsonpath")) print "skip"; ?>
--FILE--
<?php

$data = [
    "key" => 42,
];

$another = [
    "key" => 43,
];

$data["another"] =& $another;

$jsonPath = new \JsonPath\JsonPath();

$result = $jsonPath->find($data, "$.another.key");

var_dump($result);
?>
--EXPECT--
array(1) {
  [0]=>
  int(43)
}

Function Calls

None

Variables

None

Stats

MD5 acd5b63b0fd92b2908c3e8397883d615
Eval Count 0
Decode Time 89 ms