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-- Check for jsonschema vali string --SKIPIF-- <?php if (!extension_loaded("jsonsch..

Decoded Output download

--TEST--
Check for jsonschema vali string
--SKIPIF--

<?php
if (!extension_loaded("jsonschema")) {
    print "skip";
}
?>
--FILE--
<?php
echo 'string:';
$value = 'teststring';
$schema = array(
    'type' => 'string',
    'format' => 'regex',
    'pattern' => '/^[a-z]+$/i',
    'minLength' => 0,
    'maxLength' => 2147483647,
);

$jsonSchema = new JsonSchema();
echo assert($jsonSchema->validate($schema, $value));
?>
--EXPECT--
string:1

Did this file decode correctly?

Original Code

--TEST--
Check for jsonschema vali string
--SKIPIF--

<?php
if (!extension_loaded("jsonschema")) {
    print "skip";
}
?>
--FILE--
<?php
echo 'string:';
$value = 'teststring';
$schema = array(
    'type' => 'string',
    'format' => 'regex',
    'pattern' => '/^[a-z]+$/i',
    'minLength' => 0,
    'maxLength' => 2147483647,
);

$jsonSchema = new JsonSchema();
echo assert($jsonSchema->validate($schema, $value));
?>
--EXPECT--
string:1

Function Calls

extension_loaded 1

Variables

$value teststring
$schema [{'key': 'type', 'value': 'string'}, {'key': 'format', 'value': 'regex'}, {'key': 'pattern', 'value': '/^[a-z]+$/i'}, {'key': 'minLength', 'value': 0}, {'key': 'maxLength', 'value': 2147483647}]

Stats

MD5 ed58e24419041c08240156028e331c92
Eval Count 0
Decode Time 148 ms