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-- cairo_toy_font_face_get_weight function --SKIPIF-- <?php if(!extension_loaded('ca..

Decoded Output download

--TEST--
cairo_toy_font_face_get_weight function
--SKIPIF--
<?php
if(!extension_loaded('cairo')) die('skip - Cairo extension not available');
if(!class_exists('CairoToyFontFace')) die('skip - CairoToyFontFace not enabled');
?>
--FILE--
<?php
$c = cairo_toy_font_face_create("sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
var_dump(cairo_toy_font_face_get_weight($c));

$c = cairo_toy_font_face_create("sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
var_dump(cairo_toy_font_face_get_weight($c));

// Set up handler for catchable errors
function catch_error($errno, $errstr) {
    echo 'CAUGHT ERROR: ' . $errstr . PHP_EOL;
}
set_error_handler('catch_error', E_RECOVERABLE_ERROR);

// Test with a different class
var_dump(cairo_toy_font_face_get_weight(new stdClass));

// Test with a non-object
var_dump(cairo_toy_font_face_get_weight("Foo"));
?>
--EXPECTF--
int(0)
int(1)
CAUGHT ERROR: Argument 1 passed to cairo_toy_font_face_get_weight() must be an instance of CairoToyFontFace, instance of stdClass given

Warning: cairo_toy_font_face_get_weight() expects parameter 1 to be CairoToyFontFace, object given in %s on line %d
NULL
CAUGHT ERROR: Argument 1 passed to cairo_toy_font_face_get_weight() must be an instance of CairoToyFontFace, string given

Warning: cairo_toy_font_face_get_weight() expects parameter 1 to be CairoToyFontFace, string given in %s on line %d
NULL

Did this file decode correctly?

Original Code

--TEST--
cairo_toy_font_face_get_weight function
--SKIPIF--
<?php
if(!extension_loaded('cairo')) die('skip - Cairo extension not available');
if(!class_exists('CairoToyFontFace')) die('skip - CairoToyFontFace not enabled');
?>
--FILE--
<?php
$c = cairo_toy_font_face_create("sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
var_dump(cairo_toy_font_face_get_weight($c));

$c = cairo_toy_font_face_create("sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
var_dump(cairo_toy_font_face_get_weight($c));

// Set up handler for catchable errors
function catch_error($errno, $errstr) {
    echo 'CAUGHT ERROR: ' . $errstr . PHP_EOL;
}
set_error_handler('catch_error', E_RECOVERABLE_ERROR);

// Test with a different class
var_dump(cairo_toy_font_face_get_weight(new stdClass));

// Test with a non-object
var_dump(cairo_toy_font_face_get_weight("Foo"));
?>
--EXPECTF--
int(0)
int(1)
CAUGHT ERROR: Argument 1 passed to cairo_toy_font_face_get_weight() must be an instance of CairoToyFontFace, instance of stdClass given

Warning: cairo_toy_font_face_get_weight() expects parameter 1 to be CairoToyFontFace, object given in %s on line %d
NULL
CAUGHT ERROR: Argument 1 passed to cairo_toy_font_face_get_weight() must be an instance of CairoToyFontFace, string given

Warning: cairo_toy_font_face_get_weight() expects parameter 1 to be CairoToyFontFace, string given in %s on line %d
NULL

Function Calls

class_exists 1
extension_loaded 1

Variables

None

Stats

MD5 67cc54bc6506656b103633775ca02a76
Eval Count 0
Decode Time 112 ms