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_get_antialias function --SKIPIF-- <?php if(!extension_loaded('cairo')) die(..
Decoded Output download
--TEST--
cairo_get_antialias function
--SKIPIF--
<?php
if(!extension_loaded('cairo')) die('skip - Cairo extension not available');
?>
--FILE--
<?php
$surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 50, 50);
var_dump($surface);
$context = cairo_create($surface);
var_dump($context);
var_dump(cairo_get_antialias($context));
// bad type hint is an E_RECOVERABLE_ERROR, so let's hook a handler
function bad_class($errno, $errstr) {
echo 'CAUGHT ERROR: ' . $errstr, PHP_EOL;
}
set_error_handler('bad_class', E_RECOVERABLE_ERROR);
// check number of args - should accept ONLY 1
cairo_get_antialias();
cairo_get_antialias($context, 1);
// check arg types, should be CairoSurface
cairo_get_antialias(1);
?>
--EXPECTF--
object(CairoImageSurface)#%d (0) {
}
object(CairoContext)#%d (0) {
}
int(0)
Warning: cairo_get_antialias() expects exactly 1 parameter, 0 given in %s on line %d
Warning: cairo_get_antialias() expects exactly 1 parameter, 2 given in %s on line %d
CAUGHT ERROR: Argument 1 passed to cairo_get_antialias() must be an instance of CairoContext, integer given
Warning: cairo_get_antialias() expects parameter 1 to be CairoContext, integer given in %s on line %d
Did this file decode correctly?
Original Code
--TEST--
cairo_get_antialias function
--SKIPIF--
<?php
if(!extension_loaded('cairo')) die('skip - Cairo extension not available');
?>
--FILE--
<?php
$surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 50, 50);
var_dump($surface);
$context = cairo_create($surface);
var_dump($context);
var_dump(cairo_get_antialias($context));
// bad type hint is an E_RECOVERABLE_ERROR, so let's hook a handler
function bad_class($errno, $errstr) {
echo 'CAUGHT ERROR: ' . $errstr, PHP_EOL;
}
set_error_handler('bad_class', E_RECOVERABLE_ERROR);
// check number of args - should accept ONLY 1
cairo_get_antialias();
cairo_get_antialias($context, 1);
// check arg types, should be CairoSurface
cairo_get_antialias(1);
?>
--EXPECTF--
object(CairoImageSurface)#%d (0) {
}
object(CairoContext)#%d (0) {
}
int(0)
Warning: cairo_get_antialias() expects exactly 1 parameter, 0 given in %s on line %d
Warning: cairo_get_antialias() expects exactly 1 parameter, 2 given in %s on line %d
CAUGHT ERROR: Argument 1 passed to cairo_get_antialias() must be an instance of CairoContext, integer given
Warning: cairo_get_antialias() expects parameter 1 to be CairoContext, integer given in %s on line %d
Function Calls
extension_loaded | 1 |
Stats
MD5 | 74698f2674004555a81d843755534aeb |
Eval Count | 0 |
Decode Time | 88 ms |