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 fileatime(), filemtime(), filectime() & touch() functions : error conditions..

Decoded Output download

*** Testing error conditions ***

-- Testing with  Non-existing files --

Did this file decode correctly?

Original Code

--TEST--
Test fileatime(), filemtime(), filectime() & touch() functions : error conditions
--FILE--
<?php

echo "*** Testing error conditions ***\n";

echo "\n-- Testing with  Non-existing files --";
/* Both invalid arguments */
var_dump( fileatime("/no/such/file/or/dir") );
var_dump( filemtime("/no/such/file/or/dir") );
var_dump( filectime("/no/such/file/or/dir") );
var_dump( touch("/no/such/file/or/dir", 10) );

echo "\nDone";
?>
--EXPECTF--
*** Testing error conditions ***

-- Testing with  Non-existing files --
Warning: fileatime(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: filemtime(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: filectime(): stat failed for /no/such/file/or/dir in %s on line %d
bool(false)

Warning: touch(): Unable to create file /no/such/file/or/dir because No such file or directory in %s on line %d
bool(false)

Done

Function Calls

fileatime 1

Variables

None

Stats

MD5 aff84b529bdd13b87a786c4b8a15eaae
Eval Count 0
Decode Time 78 ms