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 |
Stats
MD5 | ed58e24419041c08240156028e331c92 |
Eval Count | 0 |
Decode Time | 148 ms |