pickles/vendors/php-test-helpers/tests/set_exit_overload.phpt
Joshua Sherman 8f3c623e5d Added php-test-helpers to the vendors directory
Seemed easier than trying to figure out how to force the prompt to accept the
unknown IP (perhaps not possible at all as it is part of SSH?). `yes` didn't
work, unfortunately.
2014-01-12 16:25:52 -05:00

26 lines
466 B
PHP
Executable file

--TEST--
set_exit_overload()
--SKIPIF--
<?php
if (!extension_loaded('test_helpers')) die('skip test_helpers extension not loaded');
?>
--FILE--
<?php
set_exit_overload(function($arg = NULL) { var_dump($arg); echo "FALSE\n"; return false; });
die("DIE 1");
die;
exit;
set_exit_overload(function($arg) { var_dump($arg); echo "TRUE\n"; return true; });
die("DIE 4");
echo "HAHA";
?>
--EXPECT--
string(5) "DIE 1"
FALSE
NULL
FALSE
NULL
FALSE
string(5) "DIE 4"
TRUE
DIE 4