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.
18 lines
443 B
PHP
Executable file
18 lines
443 B
PHP
Executable file
--TEST--
|
|
A closure can be registered as a callback with set_new_overload()
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('test_helpers')) die('skip test_helpers extension not loaded');
|
|
if (version_compare(PHP_VERSION, '5.3.0') < 0) die('skip Test requires PHP 5.3');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
class Foo {}
|
|
class Bar {}
|
|
|
|
var_dump(set_new_overload(function ($className) { return 'Foo'; }));
|
|
|
|
var_dump(get_class(new Bar));
|
|
--EXPECT--
|
|
bool(true)
|
|
string(3) "Foo"
|