$a = new Ext();
$a->someMethod("foo");
$a->someMethod();
+?>
--EXPECT--
foo
default
--FILE--
<?php
var_dump(new class{});
+?>
--EXPECTF--
object(class@%s)#%d (0) {
}
};
var_dump($a instanceof A, $a instanceof B);
+?>
--EXPECT--
bool(true)
bool(true)
}
});
}
+?>
--EXPECTF--
object(class@%s)#1 (1) {
["i"]=>
/* not null because inheritance */
var_dump($outer->getArrayAccess()[0]);
+?>
--EXPECTF--
int(%d)
/* null because no inheritance, so no access to protected member */
var_dump(@$outer->getArrayAccess()[0]);
+?>
--EXPECT--
NULL
namespace {
var_dump ($hello);
}
+?>
--EXPECTF--
object(class@%s)#1 (0) {
}
new Outer();
}
+?>
--EXPECTF--
object(class@%s)#2 (0) {
}
var_dump($anonClass::$foo);
var_dump($anonClass::getBar());
+?>
--EXPECT--
string(4) "cats"
string(4) "dogs"
};
var_dump($anonClass->someMethod());
+?>
--EXPECT--
string(3) "bar"
var_dump([0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()]);
var_dump([0, ...$array, ...$array, 'end']);
+?>
--EXPECT--
array(0) {
}
} catch (Error $ex) {
echo "Exception: " . $ex->getMessage() . "\n";
}
+?>
--EXPECT--
array(5) {
[0]=>
echo "Exception: " . $ex->getMessage() . "\n";
}
+?>
--EXPECT--
Exception: Cannot unpack Traversable with non-integer keys
var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1)
+?>
--EXPECT--
array(1) {
[0]=>
var_dump($ex->getMessage());
}
+?>
--EXPECT--
string(36) "Cannot unpack array with string keys"
string(42) "Cannot unpack Traversable with string keys"
var_dump([...$arr]);
+?>
--EXPECTF--
Warning: Undefined variable $arr in %s on line %d
assert_options(ASSERT_WARNING);
assert(false && ($a **= 2));
+?>
--EXPECTF--
Warning: assert(): assert(false && ($a **= 2)) failed in %s%ezend-pow-assign.php on line %d
assert_options(ASSERT_WARNING);
assert(false && `echo -n ""`);
+?>
--EXPECTF--
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d
var_dump(get_class($a));
var_dump($a->flags == Attribute::TARGET_ALL);
}
+?>
--EXPECT--
string(9) "Attribute"
array(0) {
@@Attribute
function foo() {}
+?>
--EXPECTF--
Fatal error: Attribute "Attribute" cannot target function (allowed targets: class) in %s
@@ZendTestAttribute
function foo() {
}
+?>
--EXPECTF--
Fatal error: Only classes can be marked with @@ZendTestAttribute in %s
var_dump(-0b1111111111111111111111111111111);
var_dump(-0b111111111111111111111111111111);
var_dump(-0b1);
+?>
--EXPECT--
int(1)
int(3)
var_dump(-0b111111111111111111111111111111111111111111111111111111111111111);
var_dump(-0b11111111111111111111111111111111111111111111111111111111111111);
var_dump(-0b1);
+?>
--EXPECT--
int(1)
int(3)
} catch (Exception $e) {
var_dump($x);
}
+?>
--EXPECT--
object(foo)#1 (0) {
}
} catch (Error $e) {
echo 'OK';
}
+?>
--EXPECT--
OK
}
// Alternatively $c = $a; and foreachloop removal will cause identical results.
var_dump(key($a['b']));
+?>
--EXPECT--
int(3)
int(3)
$b = new B();
$c = new C();
$d = new D();
+?>
--EXPECT--
A::foo
A::foo
var_dump($k);
}
var_dump(key($arr["v"]));
+?>
--EXPECT--
int(0)
int(0)
var_dump($k);
}
var_dump(key($foo));
+?>
--EXPECT--
int(0)
int(0)
echo 1/-2*5;
echo "\n";
echo 6/+2*-3;
+?>
--EXPECT--
-2.5
-9
}
var_dump(get_class_vars("foo"));
+?>
--EXPECT--
array(1) {
["x"]=>
$a->foo();
$b = new B();
$b->foo();
+?>
--EXPECT--
bool(true)
bool(true)
}
foo();
+?>
--EXPECT--
ok
test3($x);
test4($y);
test5($x);
+?>
--EXPECTF--
ok
ok
var_dump(defined('\\ns\\foo::bug'));
var_dump(defined('ns\\bar::bug'));
var_dump(defined('\\ns\\bar::bug'));
+?>
--EXPECT--
bool(true)
bool(false)
class Bar {}
use Test\Bar;
echo "ok\n";
+?>
--EXPECT--
ok
$foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new \stdclass); // Error, ok!
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: foobar\foo::bar(): Argument #1 ($a) must be of type foobar\foo, stdClass given, called in %s:%d
Stack trace:
$foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new stdclass); // Error, ok!
+?>
--EXPECTF--
Fatal error: '\self' is an invalid class name in %sbug43332_2.php on line 5
var_dump(is_callable("\\Test::foo"));
var_dump(is_callable("is_string"));
var_dump(is_callable("\\is_string"));
+?>
--EXPECT--
bool(false)
bool(false)
$y = Y::cheat(5);
echo $y->x, PHP_EOL;
+?>
--EXPECTF--
Fatal error: Uncaught Error: Call to private X::__construct() from scope Y in %s:%d
Stack trace:
}
new Bar2(array());
+?>
--EXPECT--
array(0) {
}
$b = &$a[1];
$b = "f";
echo $a;
+?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sbug49866.php:3
Stack trace:
call_user_func_array( array( $proxy, 'bar' ), $args );
call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
var_dump($arg);
+?>
--EXPECT--
bar called!
bar called!
var_dump($mapWithoutConst1[1]);
var_dump($mapWithoutConst2[1]);
var_dump($mapWithoutConst3[1]);
+?>
--EXPECT--
string(3) "two"
string(3) "two"
set_error_handler("eh");
$a = $empty($b);
+?>
--EXPECTF--
Fatal error: Uncaught Exception: error! in %sbug51394.php:%d
Stack trace:
var_dump($foo->a1[0]);
$foo->f6()[0]++;
var_dump($foo->a1[0]);
+?>
--EXPECT--
NULL
array(0) {
$myGlobal->myRef=&$myGlobal;
$myGlobal->myNonExistentProperty="ok\n";
echo $myGlobal;
+?>
--EXPECT--
ok
test();
echo "bug\n";
+?>
--EXPECTF--
Fatal error: Uncaught Exception: ops 1 in %sbug53511.php:4
Stack trace:
echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n";
echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
+?>
--EXPECT--
true
true
}
$f = test_3(); $f();
$f = test_3(); $f();
+?>
--EXPECT--
Outer function increments $v to 1
Inner function reckons $v is 1
}
$x = new Test();
Test::$mystatic = new DestructorCreator();
+?>
--EXPECTF--
Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d
/* not exactly what the bug is about, but closely related problem: */
var_dump("999223372036854775807"=="999223372036854775808");
var_dump("899223372036854775807">"00999223372036854775807");
+?>
--EXPECT--
bool(false)
bool(false)
$input = new B();
echo $input->getEmail();
+?>
--EXPECT--
No such method - 'noSuchMethod'
Test::method();
Test::$method();
Test::{'method'}();
+?>
--EXPECT--
method
method
$c1 = new C;
$c1->inc();
$c1->inc();
+?>
--EXPECT--
1
2
list($a,$b) = is_array($arr)? $arr : $arr;
list($c,$d) = is_array($arr)?: NULL;
echo "ok\n";
+?>
--EXPECT--
ok
var_dump($arr['exists'][1][0]);
}
echo "DONE";
+?>
--EXPECT--
sub-key 'non_existent' is not set.
sub-key 1 is set: string(1) "o"
}
new Foo;
echo "done\n";
+?>
--EXPECT--
done
$cls->{false}();
$cls->{null}();
echo "ok\n";
+?>
--EXPECTF--
Fatal error: Method name must be a string in %sbug60613.php on line %d
});
require 'notfound.php';
+?>
--EXPECTF--
error(require(notfound.php): Failed to open stream: %s)
Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5
$bad = new Bad();
echo "$bad";
+?>
--EXPECTF--
Fatal error: Uncaught Exception: I CAN DO THIS in %s:%d
Stack trace:
strip_tags(new T);
}
var_dump($handler);
+?>
--EXPECTF--
object(T)#%d (1) {
["_this"]=>
$args = array_fill(0, 64 * 1024 - 64, 0);
call_user_func_array(function(&$a) {}, $args);
echo strval("okey");
+?>
--EXPECTF--
Warning: {closure}(): Argument #1 ($a) must be passed by reference, value given in %s on line %d
okey
//$undefined = null; // defined variable does not cause problems
$undefined->foo();
+?>
--EXPECTF--
Error handler called (Undefined variable $undefined)
$obj = new LatchkeyKid();
echo "DONE\n";
+?>
--EXPECT--
In LatchkeyKid:
MommasBoy::__clone
}
echo 'DONE';
+?>
--EXPECT--
DONE
class Bar extends Foo {
protected function __construct(){}
}
+?>
--EXPECTF--
Fatal error: Access level to Bar::__construct() must be public (as in class Foo) in %s on line 8
class Baz extends Bar {
protected function __construct(){}
}
+?>
--EXPECTF--
Fatal error: Access level to Baz::__construct() must be public (as in class Foo) in %s on line 12
"02147483648" == "2147483648",
"09007199254740991" == "9007199254740991",
"09007199254740992" == "9007199254740992");
+?>
--EXPECT--
bool(true)
bool(true)
$x = new Bar;
var_dump($x->run());
+?>
--EXPECT--
string(3) "Bar"
echo "$n\n";
}
echo "ok\n";
+?>
--EXPECT--
0
1
var_dump(isset($test->protectedProperty));
var_dump(isset($test->protectedProperty->foo));
+?>
--EXPECT--
bool(false)
bool(false)
} catch(Throwable $e) {
echo "Exception is thrown";
}
+?>
--EXPECT--
Exception is thrown
}
print_r(get_class_methods("A"));
print_r(get_class_methods("B"));
+?>
--EXPECT--
Array
(
$o['x'] = 1;
++$o['x'];
echo $o['x'], "\n";
+?>
--EXPECT--
2
$y = '1';
x($y);
print_r($y);
+?>
--EXPECT--
string(26) "Illegal string offset "2a""
1
}
$isCallable = is_callable(array('E', 'f'));
var_dump($isCallable);
+?>
--EXPECT--
bool(false)
bool(false)
{
echo 'caught';
}
+?>
--EXPECT--
caught
}
$bar = foo3();
+?>
--EXPECTF--
string(9) "not catch"
NULL
$test = new Test();
?>
-
--EXPECT--
array (
1 => 'first',
}
const C = B::BHW;
echo C, "\n";
+?>
--EXPECT--
this is A extended by B
echo "13\n";
}
bar();
+?>
--EXPECT--
1
2
echo "made it once\n";
crash();
echo "ok\n";
+?>
--EXPECTF--
Warning: Undefined variable $i in %s on line %d
made it once
const bar = ["bar" => 3]["bar"];
}
echo "okey";
+?>
--EXPECT--
okey
$b = new b();
$b->test();
+?>
--EXPECTF--
string(%d) "The magic method b::__invoke() must have public visibility"
b::test()
$b = new b();
$b->test();
+?>
--EXPECTF--
Warning: The magic method b::__invoke() must have public visibility in %s on line %d
b::test()
$x = $c->test();
print_r($x);
unset($c, $x);
+?>
--EXPECTF--
Fatal error: Cannot unset $this in %sbug68370.php on line 4
$obj["a"] = 1;
$obj["a"] .= "test";
var_dump($obj["a"]);
+?>
--EXPECT--
string(5) "1test"
string(5) "1test"
unset($foo);
gc_collect_cycles();
var_dump($bar);
+?>
--EXPECT--
object(bad)#2 (2) {
["x"]=>
gc_collect_cycles();
var_dump($bar);
+?>
--EXPECT--
object(bad)#4 (1) {
["_private"]=>
$wpq->interesting =& ret_assoc();
$x = $wpq->interesting;
printf("%s\n", $x);
+?>
--EXPECTF--
Warning: Undefined property: wpq::$interesting in %s on line %d
var_dump([1, 2, 3] <=> []);
var_dump([] <=> [1, 2, 3]);
var_dump([1] <=> [2, 3]);
+?>
--EXPECT--
int(1)
int(-1)
$c10 = new C10;
var_dump($c10[] += 5);
+?>
--EXPECT--
Inside C10::offsetGet
NULL
var_dump(foo());
var_dump(foo1());
+?>
--EXPECT--
string(1) "1"
string(3) "ref"
unset($a);
var_dump(gc_collect_cycles());
+?>
--EXPECT--
int(2)
$b = new B;
$b->test();
+?>
--EXPECT--
bool(true)
--FILE--
<?php
register_shutdown_function("get_defined_vars");
+?>
--EXPECT--
Fatal error: Uncaught Error: Cannot call get_defined_vars() dynamically in [no active file]:0
Stack trace:
}
echo "ok";
+?>
--EXPECT--
ok
class B extends A {
public function m(array $a = []) {}
}
+?>
--EXPECTF--
Fatal error: Declaration of B::m(array $a = []) must be compatible with A::m(?array $a = null) in %s on line %d
$OuterMatcher->stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback([$foo, 'callback']);
$a = $b = $c = 0;
$foo->bar($a, $b, $c);
+?>
--EXPECTF--
Fatal error: Uncaught Error: Class "DoesNotExists" not found in %s:%d
Stack trace:
}
echo "OK\n";
+?>
--EXPECT--
OK
$arr[0] = 0; // without this line will print both keys
unset($arr[0]);
}
+?>
--EXPECT--
See key 1
See key 3
$circularDoublyLinkedList = $nextNode;
}
var_dump('end');
+?>
--EXPECT--
bool(true)
string(5) "start"
-string(3) "end"
\ No newline at end of file
+string(3) "end"
gc_collect_cycles();
var_dump('end');
+?>
--EXPECT--
bool(true)
string(5) "start"
-string(3) "end"
\ No newline at end of file
+string(3) "end"
<?php
__COMPILER_HALT_OFFSET__;
; // <- important
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "__COMPILER_HALT_OFFSET__" in %s:%d
Stack trace:
--FILE--
<?php
0xg10;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "xg10" in %s on line %d
}
var_dump(get());
var_dump(gc_collect_cycles());
+?>
--EXPECT--
object(stdClass)#1 (1) {
["prop"]=>
call_user_func("Test::Two", 'A', 'B');
call_user_func(array("Test", "Three"), NULL, 0, false);
Test::Four(5, 6, 7, 8);
+?>
--EXPECT--
Two() called with 2 arguments
Three() called with 3 arguments
}
}
foo::bar();
+?>
--EXPECT--
Done
$d = $nonstaticScoped->bindTo(new B); $d(); echo "\n";
echo "Done.\n";
+?>
--EXPECTF--
Before binding
scoped to A: bool(false)
$d = $staticScoped->bindTo(new A, 'A');
echo "Done.\n";
+?>
--EXPECTF--
Before binding
bool(false)
$d = $nonstaticScoped->bindTo(new A, 'A'); $d(); echo "\n";
echo "Done.\n";
+?>
--EXPECTF--
Before binding
bool(false)
$a->bindTo(new A);
echo "Done.\n";
+?>
--EXPECT--
Done.
$d = $nonstaticScoped->bindTo(new B, "static"); $d(); echo "\n";
echo "Done.\n";
+?>
--EXPECTF--
Before binding
bool(false)
$b = new B;
var_dump($b->foo());
+?>
--EXPECT--
string(1) "B"
$b = new B;
var_dump($b->foo());
+?>
--EXPECT--
string(1) "B"
class B extends A {}
var_dump(B::foo());
+?>
--EXPECT--
string(1) "B"
class B extends A {}
var_dump(B::foo());
+?>
--EXPECT--
string(1) "B"
$b = new B;
var_dump($b->foo());
+?>
--EXPECT--
string(1) "A"
$b = new B;
var_dump($b->foo());
+?>
--EXPECT--
string(1) "A"
class B extends A {}
var_dump(B::foo());
+?>
--EXPECT--
string(1) "A"
class B extends A {}
var_dump(B::foo());
+?>
--EXPECT--
string(1) "A"
$c();
call_user_func(array($b,"__invoke"));
$z(array($b,"__invoke"));
+?>
--EXPECT--
string(1) "A"
string(1) "A"
} catch (Error $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
+?>
--EXPECTF--
Exception: {closure}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d
Exception: {closure}(): Argument #1 ($a) must be of type A, B given
B::baz();
}
test();
+?>
--EXPECT--
B vs B
B vs B
$n = "-1";
$n %= $n;
var_dump($n);
+?>
--EXPECT--
int(0)
var_dump("foobar"[3]);
var_dump("foobar"[2][0]);
var_dump("foobar"["0foo"]["0bar"]);
+?>
--EXPECTF--
string(1) "b"
string(1) "o"
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
+?>
--EXPECTF--
array(4) {
[0]=>
--FILE--
<?php
const T = array(1,2) - array(0);
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: Unsupported operand types: array - array in %s:%d
Stack trace:
} catch (CLException $e) {
echo $e."\n";
}
+?>
--EXPECTF--
ERR#2: include(class://non.existent.Class): Failed to open stream: "CLWrapper::stream_open" call failed @ include
ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include
$c = new C(0.0);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.0.php on line %d
$c = new C(0);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.php on line %d
$c = new C(1.0);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.0.php on line %d
$c = new C(1);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.php on line %d
$c = new C("");
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-empty_str.php on line %d
$c = new C(false);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-false.php on line %d
$c = new C(new stdClass);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-object.php on line %d
$c = new C(fopen("data:text/plain,Foo", 'r'));
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-resource.php on line %d
$c = new C("foo");
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-str.php on line %d
$c = new C(true);
var_dump($c);
+?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-true.php on line %d
$b = new Bar;
var_dump($b);
+?>
--EXPECTF--
object(Foo)#%d (3) {
["a"]=>
declare(ticks = UNKNOWN_CONST) {
echo 'Done';
}
+?>
--EXPECTF--
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
$name = 0.0;
$ref =& $obj->$name;
var_dump($obj);
+?>
--EXPECT--
object(stdClass)#1 (1) {
["0"]=>
var_dump(empty(""));
var_dump(empty(true));
var_dump(empty(false));
+?>
--EXPECT--
bool(true)
bool(false)
fclose($fp);
echo "done";
+?>
--EXPECT--
done
fclose($fp);
echo "done";
+?>
--EXPECT--
done
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
}
+?>
--EXPECT--
substr() expects at least 2 parameters, 1 given
echo get_class($e) . PHP_EOL;
echo $e->getMessage(), "\n";
}
+?>
--EXPECT--
ArgumentCountError
substr() expects at least 2 parameters, 1 given
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
+?>
--EXPECTF--
ArgumentCountError
Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
+?>
--EXPECTF--
ArgumentCountError
Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
echo $exception->getMessage() . "\n";
}
+?>
--EXPECTF--
foo(): Argument #2 ($bar) must be of type int, array given, called in %s on line %d
foo(): Argument #4 ($bar) must be of type int, array given, called in %s on line %d
unset($a);
var_dump(gc_collect_cycles());
echo "ok\n";
+?>
--EXPECT--
int(0)
int(1000)
unset($a); // 10000 zvals collected automatic
var_dump(gc_collect_cycles());
echo "ok\n";
+?>
--EXPECT--
int(0)
int(9999)
gc_collect_cycles();
}
echo "ok\n";
+?>
--EXPECT--
ok
unset($a);
var_dump(gc_collect_cycles());
var_dump(gc_collect_cycles());
+?>
--EXPECT--
int(0)
int(0)
gc_collect_cycles();
gc_collect_cycles();
var_dump(gc_status());
+?>
--EXPECT--
array(4) {
["runs"]=>
foreach(gen(new stdClass()) as $value)
echo $value, "\n";
+?>
--EXPECTF--
foo
foreach (foo(1, 5) as $x) {
echo $x, "\n";
}
+?>
--EXPECT--
1
foreach (foo(1, 5) as $x) {
echo $x, "\n";
}
+?>
--EXPECTF--
1
foreach (foo(1, 5) as $x) {
echo $x, "\n";
}
+?>
--EXPECT--
1
foreach (foo(1, 5) as $x) {
echo $x, "\n";
}
+?>
--EXPECTF--
1
foreach (foo() as $x) {
echo $x;
}
+?>
--EXPECT--
1234567
foreach (foo() as $value) {
var_dump($value);
}
+?>
--EXPECT--
int(42)
int(24)
);
echo "\nDone\n";
+?>
--EXPECT--
Foo::function
Foo::function
var_dump(Foo::
CLASS);
+?>
--EXPECT--
string(3) "Foo"
string(3) "Foo"
}
function echo(){} // not valid
+?>
--EXPECTF--
Parse error: syntax error, unexpected token "echo", expecting "(" in %s on line %d
}
const return = 'nope';
+?>
--EXPECTF--
Parse error: syntax error, unexpected token "return", expecting identifier in %s on line %d
USE, PHP_EOL;
echo "\nDone\n";
+?>
--EXPECT--
declare
return
var_dump(Foo::use);
echo "\nDone\n";
+?>
--EXPECT--
Foo::new
Foo::new
echo "$friday->require ($friday->require) {$friday->require}", PHP_EOL;
echo "\nDone\n";
+?>
--EXPECT--
fun (fun) fun
}
echo PHP_EOL, "Done", PHP_EOL;
+?>
--EXPECT--
Done
$obj->__NAMESPACE__();
echo "\nDone\n";
+?>
--EXPECT--
Obj::empty
Obj::callable
Obj::__NAMESPACE__();
echo "\nDone\n";
+?>
--EXPECT--
Obj::empty
Obj::callable
echo Obj::$__halt_compiler, PHP_EOL;
echo "\nDone\n";
+?>
--EXPECT--
empty
callable
echo Obj::__NAMESPACE__, PHP_EOL;
echo "\nDone\n";
+?>
--EXPECT--
empty
callable
Foo::farewell();
echo "\nDone\n";
+?>
--EXPECT--
TraitA::catch
TraitA::list
new Bar;
echo "\nDone\n";
+?>
--EXPECT--
From Foo::__construct:
self
attempt();
echo PHP_EOL, "Done", PHP_EOL;
+?>
--EXPECT--
TraitB::try
Foo::try();
echo PHP_EOL, "Done", PHP_EOL;
+?>
--EXPECT--
TraitA::as
Foo::insteadof();
echo PHP_EOL, "Done", PHP_EOL;
+?>
--EXPECT--
TraitB::insteadof
__HALT_COMPILER();
none of this should be displayed!
+?>
--EXPECT--
yo!
if (true) {
__HALT_COMPILER();
}
+?>
--EXPECTF--
Fatal error: __HALT_COMPILER() can only be used from the outermost scope in %shalt03.php on line %d
<?php
__COMPILER_HALT_OFFSET__;
{}
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "__COMPILER_HALT_OFFSET__" in %s:%d
Stack trace:
echo "6";
}
echo "7\n";
+?>
--EXPECT--
4567
<?php
class static {
}
+?>
--EXPECTF--
Parse error: %s error,%sexpecting %s in %s on line %d
<?php
interface static {
}
+?>
--EXPECTF--
Parse error: %s error,%sexpecting %s in %s on line %d
}
}
B::foo();
+?>
--EXPECT--
B
B
*/
Bar::test();
Bar::test();
+?>
--EXPECT--
int(1)
int(2)
<?php
echo '\'hello';
?>
-
--EXPECT--
'hello
use Foo\Bar;
class Bar {}
}
+?>
--EXPECTF--
Fatal error: Cannot declare class Bazzle\Bar because the name is already in use in %s on line %d
use function Foo\bar;
function bar() {}
}
+?>
--EXPECTF--
Fatal error: Cannot declare function Bazzle\bar because the name is already in use in %s on line %d
use const Foo\BAR;
const BAR = 24;
}
+?>
--EXPECTF--
Fatal error: Cannot declare const Bazzle\BAR because the name is already in use in %s on line %d
$y = new \test\ns1\Foo;
$y->bar();
\test\ns1\Foo::baz();
+?>
--EXPECT--
test\ns1\Foo
test\ns1\Foo
Bar::bar();
ns2\Foo::bar();
ns1\Foo::bar();
+?>
--EXPECT--
test\ns1\Foo
test\ns1\Foo
}
echo get_class(new Exception()),"\n";
+?>
--EXPECT--
test\ns1\Exception
namespace test\ns1;
echo get_class(new Exception()),"\n";
+?>
--EXPECTF--
Fatal error: Uncaught Error: Class "test\ns1\Exception" not found in %s:%d
Stack trace:
}
echo get_class(new \Exception()),"\n";
+?>
--EXPECT--
Exception
$x = "test\\ns1\\Exception";
echo get_class(new $x),"\n";
+?>
--EXPECT--
test\ns1\Exception
$x = "Exception";
echo get_class(new $x),"\n";
+?>
--EXPECT--
Exception
$x = __NAMESPACE__ . "\\foo";
echo get_class(new $x),"\n";
+?>
--EXPECT--
test\foo
$x = __NAMESPACE__ . "\\foo";
echo get_class(new $x),"\n";
+?>
--EXPECT--
foo
echo Foo::$var;
echo Y\Foo::$var;
echo \X\Foo::$var;
+?>
--EXPECT--
class ok
class ok
function bar() {
echo __FUNCTION__,"\n";
}
+?>
--EXPECT--
test\ns1\foo
test\ns1\foo
function bar() {
echo __FUNCTION__,"\n";
}
+?>
--EXPECT--
test\ns1\foo
test\ns1\bar
}
echo strlen("Hello"),"\n";
+?>
--EXPECT--
test\ns1\strlen
namespace test\ns1;
echo strlen("Hello"),"\n";
+?>
--EXPECT--
5
}
echo \strlen("Hello"),"\n";
+?>
--EXPECT--
5
$x = "test\\ns1\\strlen";
echo $x("Hello"),"\n";
+?>
--EXPECT--
test\ns1\strlen
$x = "strlen";
echo $x("Hello"),"\n";
+?>
--EXPECT--
5
$x = __NAMESPACE__ . "\\foo";
echo $x(),"\n";
+?>
--EXPECT--
test\foo
$x = __NAMESPACE__ . "\\foo";
echo $x(),"\n";
+?>
--EXPECT--
foo
\X\foo();
Y\foo();
\X\foo();
+?>
--EXPECT--
X\foo
X\foo
foo();
\test\foo();
\test\test::foo();
+?>
--EXPECT--
test\foo
test\foo
test\foo();
\test::foo();
+?>
--EXPECT--
a\b\c\foo
Test::foo
namespace test\foo;
var_dump(__NAMESPACE__);
+?>
--EXPECT--
string(8) "test\foo"
--FILE--
<?php
var_dump(__NAMESPACE__);
+?>
--EXPECT--
string(0) ""
Foo::Bar();
$x = new \Foo\Bar\Foo;
\Foo\Bar\Foo::Bar();
+?>
--EXPECT--
Foo\Bar\Foo
Foo\Bar\Foo
\Foo\Foo::Bar();
\Foo\Bar();
Foo\Bar();
+?>
--EXPECTF--
Method - Foo\Foo::__construct
Func - Foo\Bar
Foo::Bar();
$x = new Foo\Bar\Foo;
Foo\Bar\Foo::Bar();
+?>
--EXPECT--
Foo
Foo
$x = new Foo\Foo;
Foo\Foo::Bar();
\Foo\Bar();
+?>
--EXPECT--
Method - Foo::__construct
Func - Foo\Bar
}
new Foo();
+?>
--EXPECTF--
Fatal error: Cannot declare class Foo because the name is already in use in %sns_029.php on line 4
use A\B as Foo;
new Foo();
+?>
--EXPECTF--
Fatal error: Cannot use A\B as Foo because the name is already in use in %sns_030.php on line 5
call_user_func(__NAMESPACE__."\\foo");
call_user_func(__NAMESPACE__."\\test::foo");
+?>
--EXPECT--
test\foo
test\Test::foo
call_user_func(__NAMESPACE__."\\foo");
call_user_func(__NAMESPACE__."\\test::foo");
+?>
--EXPECT--
foo
Test::foo
<?php
use A;
use \B;
+?>
--EXPECTF--
Warning: The use statement with non-compound name 'A' has no effect in %sns_033.php on line 2
f1();
f2();
f3();
+?>
--EXPECT--
ok
ok
echo X::$var;
echo Y\X::$var;
echo \X\X::$var;
+?>
--EXPECT--
class ok
class ok
}
\Exception\foo();
\Exception::bar();
+?>
--EXPECTF--
ok
echo B . "\n";
foo();
bar();
+?>
--EXPECT--
ok
ok
f6();
f7();
f8();
+?>
--EXPECT--
ok
ok
echo(BAR);
const BAR = "ok\n";
+?>
--EXPECTF--
ok
ok
echo \test\ns1\FOO;
echo ns2\FOO;
echo ns3\ns1\FOO;
+?>
--EXPECT--
ok
ok
const INI_ALL = 0;
var_dump(INI_ALL);
+?>
--EXPECT--
int(0)
namespace test\ns1;
var_dump(INI_ALL);
+?>
--EXPECT--
int(7)
const INI_ALL = 0;
var_dump(\INI_ALL);
+?>
--EXPECT--
int(7)
const INI_ALL = 0;
var_dump(constant("test\\ns1\\INI_ALL"));
+?>
--EXPECT--
int(0)
const INI_ALL = 0;
var_dump(constant("INI_ALL"));
+?>
--EXPECT--
int(7)
const FOO = 0;
var_dump(constant(__NAMESPACE__ . "\\FOO"));
+?>
--EXPECT--
int(0)
const FOO = 0;
var_dump(constant(__NAMESPACE__ . "\\FOO"));
+?>
--EXPECT--
int(0)
var_dump($x);
}
foo();
+?>
--EXPECT--
int(0)
var_dump($x);
}
foo();
+?>
--EXPECT--
int(7)
var_dump($x);
}
foo();
+?>
--EXPECT--
int(7)
define(__NAMESPACE__ . '\\NAME', basename(__FILE__));
echo NAME."\n";
echo \test\ns1\NAME."\n";
+?>
--EXPECT--
ns_053.php
ns_053.php
<?php
const C = array();
var_dump(C);
+?>
--EXPECT--
array(0) {
}
echo get_class($a)."\n";
echo get_class($b)."\n";
class A {}
+?>
--EXPECT--
Bar\A
Foo\A
class A {}
use \A as B;
echo get_class(new B)."\n";
+?>
--EXPECT--
A
use \stdClass as A;
echo get_class(new stdClass)."\n";
echo get_class(new A)."\n";
+?>
--EXPECT--
stdClass
stdClass
test\foo();
test2\foo();
+?>
--EXPECT--
X\Y\foo
X\Z\foo
use Foo\Bar\Foo as stdClass;
new stdClass();
+?>
--EXPECT--
Foo\Bar\Foo
include __DIR__ . '/ns_022.inc';
include __DIR__ . '/ns_027.inc';
include __DIR__ . '/ns_067.inc';
+?>
--EXPECT--
Foo\Bar\Foo
const NULL = 1;
echo NULL;
+?>
--EXPECTF--
Fatal error: Cannot redeclare constant 'NULL' in %sns_075.php on line %d
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "unknown" in %s:%d
Stack trace:
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "unknown" in %s:%d
Stack trace:
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "foo\unknown" in %s:%d
Stack trace:
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "foo\unknown" in %s:%d
Stack trace:
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "unknown" in %s:%d
Stack trace:
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "unknown" in %s:%d
Stack trace:
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant "unknown" in %s:%d
Stack trace:
Bar::bar();
Foo2::bar();
Bar2::bar();
+?>
--EXPECT--
test\ns1\Foo
test\ns1\Foo
new foo;
echo "===DONE===\n";
}
+?>
--EXPECT--
foo::__construct
foo\bar::__construct
new foo;
echo "===DONE===\n";
}
+?>
--EXPECT--
foo::__construct
foo\bar::__construct
new foo;
echo "===DONE===\n";
}
+?>
--EXPECTF--
Fatal error: No code may exist outside of namespace {} in %s on line 10
var_dump(BOZ);
var_dump(BAR);
}
+?>
--EXPECT--
Foo\Bar\Baz\A::__construct
Foo\Bar\Baz\B::__construct
var_dump(BOZ);
var_dump(BAR);
}
+?>
--EXPECT--
Foo\Bar\Baz\A::__construct
Foo\Bar\Baz\B::__construct
new A;
new B;
}
+?>
--EXPECT--
Foo\Bar\A::__construct
Foo\Bar\Baz\B::__construct
boz();
A();
}
+?>
--EXPECTF--
==== MIXED ====
Foo\Bar\A::__construct
};
echo "\nDone\n";
+?>
--EXPECT--
Done
const B,
function C
};
+?>
--EXPECTF--
Parse error: syntax error, unexpected token "const", expecting "}" in %s on line %d
var_dump(_array_(null));
var_dump(_array_([]));
+?>
--EXPECT--
NULL
array(0) {
$b = new B();
$b->method(null);
+?>
--EXPECT--
interface B extends A {
function method(): ?int;
}
+?>
--EXPECTF--
Fatal error: Declaration of B::method(): ?int must be compatible with A::method(): int in %s on line %d
class B implements A {
function method(int $p) { }
}
+?>
--EXPECTF--
Fatal error: Declaration of B::method(int $p) must be compatible with A::method(?int $p) in %s on line %d
interface B extends A {
function method(): int;
}
+?>
--EXPECT--
var_dump(_float_(null));
var_dump(_float_(1.3));
+?>
--EXPECT--
NULL
float(1.3)
var_dump(_int_(null));
var_dump(_int_(1));
+?>
--EXPECT--
NULL
int(1)
$b = new B();
var_dump($b->method(null));
var_dump($b->method(1));
+?>
--EXPECT--
NULL
int(1)
function f(?callable $p) {}
f();
+?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
Stack trace:
var_dump(_string_(null));
var_dump(_string_("php"));
+?>
--EXPECT--
NULL
string(3) "php"
$foo = null;
$foo?->bar->baz = bar();
+?>
--EXPECTF--
Fatal error: Can't use nullsafe operator in write context in %s.php on line 12
[$foo?->bar->baz] = ['bar'];
var_dump($foo);
+?>
--EXPECTF--
Fatal error: Assignments can only happen to writable values in %s on line %d
$foo = null;
unset($foo?->bar->baz);
+?>
--EXPECTF--
Fatal error: Can't use nullsafe operator in write context in %s.php on line 4
$foo = null;
foreach ([1, 2, 3] as $foo?->bar) {}
+?>
--EXPECTF--
Fatal error: Can't use nullsafe operator in write context in %s.php on line 4
var_dump(0b01_0000_10 === 0b01000010);
var_dump(0137_041 === 0137041);
var_dump(0_124 === 0124);
+?>
--EXPECT--
bool(true)
bool(true)
--FILE--
<?php
100_;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "_" in %s on line %d
--FILE--
<?php
10__0;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "__0" in %s on line %d
--FILE--
<?php
100_.0;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "_" in %s on line %d
--FILE--
<?php
100._0;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "_0" in %s on line %d
--FILE--
<?php
0x_0123;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "x_0123" in %s on line %d
--FILE--
<?php
0b_0101;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "b_0101" in %s on line %d
--FILE--
<?php
1_e2;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "_e2" in %s on line %d
--FILE--
<?php
1e_2;
+?>
--EXPECTF--
Parse error: syntax error, unexpected identifier "e_2" in %s on line %d
class Two extends One {
public function a() {}
}
+?>
--EXPECTF--
Fatal error: Declaration of Two::a() must be compatible with One::a(): object in %s on line 8
interface Two extends One {
public function a();
}
+?>
--EXPECTF--
Fatal error: Declaration of Two::a() must be compatible with One::a(): object in %s on line %d
}
};
$three->a();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d
Stack trace:
return 12345;
}
a();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: a(): Return value must be of type object, int returned in %s:%d
Stack trace:
}
};
$three->a();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d
Stack trace:
}
};
$three->a();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d
Stack trace:
$returnTypea = (new ReflectionFunction('a'))->getReturnType();
var_dump($returnTypea->isBuiltin(), $returnTypea->getName());
+?>
--EXPECT--
bool(true)
string(6) "object"
$one = new One();
$one->a(new One());
$one->a(123);
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: One::a(): Argument #1 ($obj) must be of type object, int given, called in %s:%d
Stack trace:
a(new A());
a(123);
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: a(): Argument #1 ($obj) must be of type object, int given, called in %s:%d
Stack trace:
$typeHinta = (new ReflectionFunction('a'))->getParameters()[0]->getType();
var_dump($typeHinta->isBuiltin(), $typeHinta->getName());
+?>
--EXPECT--
bool(true)
string(6) "object"
var_dump($a < $b);
print_r($a, true);
var_dump($a < $b);
+?>
--EXPECT--
bool(false)
bool(false)
// "abc", ordinarily 'b' would be \142, but we'll deliberately overflow the value by \400
echo "\141\542\143\n";
+?>
--EXPECTF--
Warning: Octal escape sequence overflow \542 is greater than \377 in %s%eoct_overflow_char.php on line 4
abc
{
}
}
+?>
--EXPECTF--
Fatal error: Declaration of B::foo() must be compatible with A::foo($param1 = Foo\Bar::CONSTANT, $param2 = Foo\Bar::CONSTANT, $param3 = Foo\Bar::CONSTANT) in %s on line %d
{
}
}
+?>
--EXPECTF--
Fatal error: Declaration of B::foo() must be compatible with A::foo($param1 = Foo\CONSTANT, $param2 = Foo\CONSTANT, $param3 = Foo\CONSTANT) in %s on line %d
$x->prop;
$x->y;
echo "ok\n";
+?>
--EXPECTF--
Warning: Uninitialized string offset 3 in %s on line %d
ok
}
test1();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: test1(): Return value must be of type array, none returned in %s:%d
Stack trace:
}
test1();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: test1(): Return value must be of type array, null returned in %s:%d
Stack trace:
return 1;
}
test1();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: test1(): Return value must be of type array, int returned in %s:%d
Stack trace:
}
test1();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: test1(): Return value must be of type array, string returned in %s:%d
Stack trace:
$qux = new qux();
$qux->foo();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: qux::foo(): Return value must be of type foo, qux returned in %s:%d
Stack trace:
foreach ($comments as $comment) {
var_dump($comment);
}
+?>
--EXPECTF--
object(Comment)#%d (%d) {
}
$qux = new qux();
var_dump($qux->foo());
+?>
--EXPECTF--
object(qux)#%d (%d) {
}
return $this;
}
}
+?>
--EXPECTF--
Fatal error: Declaration of qux::bar(): biz must be compatible with foo::bar(): foo in %s on line %d
$array = [1, 2, 3];
var_dump(foo($array));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: foo(): Return value must be of type array, null returned in %s:%d
Stack trace:
}
var_dump(foo());
+?>
--EXPECTF--
object(Closure)#%d (%d) {
}
$baz = new foo();
var_dump($baz->bar());
+?>
--EXPECT--
object(Closure)#2 (2) {
["static"]=>
$baz = new foo();
var_dump($func=$baz->bar(), $func());
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: foo::{closure}(): Return value must be of type array, null returned in %s:%d
Stack trace:
class Foo {
function __construct() : Foo {}
}
+?>
--EXPECTF--
Fatal error: Method Foo::__construct() cannot declare a return type in %s on line %d
$v = new Vector;
var_dump($v->values());
+?>
--EXPECTF--
object(Collections\Vector)#%d (%d) {
}
$foo = new Foo;
var_dump($foo->foo(new \EmptyIterator()));
+?>
--EXPECTF--
object(EmptyIterator)#%d (0) {
}
$foo = new Foo;
var_dump($foo->foo([]));
+?>
--EXPECTF--
object(EmptyIterator)#%d (%d) {
}
class Foo {
function __destruct() : Foo {}
}
+?>
--EXPECTF--
Fatal error: Method Foo::__destruct() cannot declare a return type in %s on line %d
}
test();
+?>
--EXPECTF--
Fatal error: Uncaught Exception in %s:%d
Stack trace:
var_dump(Foo::getInstance());
var_dump(Bar::getInstance());
+?>
--EXPECTF--
object(Foo)#%d (%d) {
}
$callable = $test();
var_dump($callable());
+?>
--EXPECT--
string(3) "bar"
<?php
function test(): self {}
+?>
--EXPECTF--
Fatal error: Cannot use "self" when no class scope is active in %s on line 3
$c = function(): self { return $this; };
class Bar { }
var_dump($c->call(new Bar));
+?>
--EXPECT--
object(Bar)#2 (0) {
}
<?php
function test(): parent {}
+?>
--EXPECTF--
Fatal error: Cannot use "parent" when no class scope is active in %s on line %d
$c = function(parent $x): parent { return $x; };
var_dump($c->bindTo(null, 'B')(new A));
+?>
--EXPECTF--
object(A)#%d (0) {
}
test5(),
test6(),
);
+?>
--EXPECTF--
object(Generator)#%d (%d) {
}
function test1() : StdClass {
yield 1;
}
+?>
--EXPECTF--
Fatal error: Generator return type must be a supertype of Generator, StdClass given in %s on line %d
foreach($a() as $value) {
echo $value;
}
+?>
--EXPECT--
1
$some = new SomeCollection();
var_dump($some->getIterator());
+?>
--EXPECTF--
object(Generator)#%d (%d) {
}
function test1() : StdClass|ArrayObject|array {
yield 1;
}
+?>
--EXPECTF--
Fatal error: Generator return type must be a supertype of Generator, StdClass|ArrayObject|array given in %s on line %d
class B extends A {
function foo(): StdClass {}
}
+?>
--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d
class B extends A {
function foo(): StdClass {}
}
+?>
--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d
class B implements A {
function foo(): StdClass {}
}
+?>
--EXPECTF--
Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d
var_dump(Bar::test());
var_dump(Foo::test());
+?>
--EXPECTF--
object(Bar)#%d (0) {
}
var_dump(Bar::test());
var_dump(Foo::test());
+?>
--EXPECTF--
object(B)#%d (0) {
}
var_dump(Bar::test());
var_dump(Foo::test());
+?>
--EXPECTF--
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
}
get_config();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: get_config(): Return value must be of type array, int returned in %s:%d
Stack trace:
}
var_dump(answer());
+?>
--EXPECT--
int(42)
}
foo();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: foo(): Return value must be of type DateTime, null returned in %s:%d
Stack trace:
return new User;
}
}
+?>
--EXPECTF--
Fatal error: Declaration of UserGateway_MySql::find($id) must be compatible with UserGateway::find($id): User in %s on line 11
bar();
echo "OK!", PHP_EOL;
+?>
--EXPECT--
OK!
}
// Note the lack of function call: function validated at compile-time
+?>
--EXPECTF--
Fatal error: A void function must not return a value (did you mean "return;" instead of "return null;"?) in %s on line %d
}
// Note the lack of function call: function validated at compile-time
+?>
--EXPECTF--
Fatal error: A void function must not return a value in %s on line %d
<?php
function foobar(void $a) {}
+?>
--EXPECTF--
Fatal error: void cannot be used as a parameter type in %s on line %d
$a = 'foobar';
var_dump(strlen($t2));
var_dump($t2->something);
+?>
--EXPECT--
int(5)
string(5) "hello"
}
$x = new C;
$x->foo();
+?>
--EXPECT--
object(C)#1 (0) {
}
echo $e->getMessage() . "\n";
}
+?>
--EXPECT--
Not found
Static not found
public function b();
}
+?>
--EXPECTF--
Fatal error: Cannot use traits inside of interfaces. foo is used in MyInterface in %s on line %d
class C implements IFoo {
use TFoo;
}
+?>
--EXPECTF--
Fatal error: Declaration of C::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
nonExistent as barA;
}
}
+?>
--EXPECTF--
Fatal error: An alias (barA) was defined for method nonExistent(), but this method does not exist in %s on line %d
A::nonExistent as barA;
}
}
+?>
--EXPECTF--
Fatal error: An alias was defined for A::nonExistent but this method does not exist in %s on line %d
baz as foobar;
}
}
+?>
--EXPECTF--
Fatal error: An alias (foobar) was defined for method baz(), but this method does not exist in %s on line %d
A::bar insteadof B;
}
}
+?>
--EXPECTF--
Fatal error: A precedence rule was defined for A::bar but this method does not exist in %s on line %d
$rc = new ReflectionClass('foo');
$rc->newInstance();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot instantiate trait foo in %s:%d
Stack trace:
$o = new C;
$o->foo();
+?>
--EXPECT--
C::foo() works.
$o = new CBroken;
$o->foo(1);
+?>
--EXPECTF--
Fatal error: Declaration of CBroken::foo($a) must be compatible with TBroken2::foo($a, $b = 0) in %s on line %d
$o = new CBroken;
$o->foo(1);
+?>
--EXPECTF--
Fatal error: Declaration of CBroken::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d
$o = new HTMLHelper6;
echo 'Done';
}
+?>
--EXPECT--
Done
}
}
C::foo();
+?>
--EXPECTF--
Fatal error: Inconsistent insteadof definition. The method foo is to be used from T1, but T1 is also on the exclude list in %s on line %d
$b->newFunc2(); //from T2
$b->newFunc3(); //from T2
$b->func3(); //from Bar
+?>
--EXPECT--
From T1
From Foo
}
(new D)->a();
+?>
--EXPECT--
Done
}
new B();
+?>
--EXPECT--
Trait constructor
}
new B();
+?>
--EXPECT--
Parent constructor
Trait constructor
$b = new B();
$b->aa();
+?>
--EXPECT--
123
$c = new ChildClass();
$c->hello();
+?>
--EXPECT--
ChildClass
ParentClass
T2::foo insteadof T1;
}
}
+?>
--EXPECTF--
Fatal error: Required Trait T2 wasn't added to C in %slanguage015.php on line %d
T1::foo insteadof T2;
}
}
+?>
--EXPECTF--
Fatal error: Required Trait T2 wasn't added to C in %slanguage016.php on line %d
T2::foo as private;
}
}
+?>
--EXPECTF--
Fatal error: Required Trait T2 wasn't added to C in %slanguage017.php on line %d
} catch (Exception $e) {
echo "caught {$e->getMessage()}\n";
}
+?>
--EXPECT--
caught 1
} catch (Exception $e) { }
var_dump($var === $e);
+?>
--EXPECT--
bool(true)
}
foo();
+?>
--EXPECT--
12
echo "FAIL\n";
}
+?>
--EXPECT--
Exception
Exception
echo "6";
}
echo "\n";
+?>
--EXPECT--
123456
foo($closure);
foo(array("bar", "foo"));
foo(array("bar", "baz"));
+?>
--EXPECTF--
string(6) "strpos"
string(3) "foo"
} catch (Throwable $e) {
echo $e->getMessage();
}
+?>
--EXPECTF--
array(3) {
[0]=>
}
}
echo PHP_EOL . "Done";
+?>
--EXPECTF--
Testing int:
*** Caught Too few arguments to function {closure}(), 0 passed in %s on line %d and exactly 1 expected
<?php
class int {}
+?>
--EXPECTF--
Fatal error: Cannot use 'int' as class name as it is reserved in %s on line %d
class foobar {}
class_alias("foobar", "int");
+?>
--EXPECTF--
Fatal error: Cannot use 'int' as class name as it is reserved in %s on line %d
<?php
use foobar as int;
+?>
--EXPECTF--
Fatal error: Cannot use foobar as int because 'int' is a special class name in %s on line %d
<?php
class float {}
+?>
--EXPECTF--
Fatal error: Cannot use 'float' as class name as it is reserved in %s on line %d
class foobar {}
class_alias("foobar", "float");
+?>
--EXPECTF--
Fatal error: Cannot use 'float' as class name as it is reserved in %s on line %d
<?php
use foobar as float;
+?>
--EXPECTF--
Fatal error: Cannot use foobar as float because 'float' is a special class name in %s on line %d
<?php
class string {}
+?>
--EXPECTF--
Fatal error: Cannot use 'string' as class name as it is reserved in %s on line %d
class foobar {}
class_alias("foobar", "string");
+?>
--EXPECTF--
Fatal error: Cannot use 'string' as class name as it is reserved in %s on line %d
<?php
use foobar as string;
+?>
--EXPECTF--
Fatal error: Cannot use foobar as string because 'string' is a special class name in %s on line %d
<?php
class bool {}
+?>
--EXPECTF--
Fatal error: Cannot use 'bool' as class name as it is reserved in %s on line %d
class foobar {}
class_alias("foobar", "bool");
+?>
--EXPECTF--
Fatal error: Cannot use 'bool' as class name as it is reserved in %s on line %d
<?php
use foobar as bool;
+?>
--EXPECTF--
Fatal error: Cannot use foobar as bool because 'bool' is a special class name in %s on line %d
namespace foo;
class int {}
+?>
--EXPECTF--
Fatal error: Cannot use 'int' as class name as it is reserved in %s on line %d
namespace {
var_dump(Foo\add1(123));
}
+?>
--EXPECT--
int(124)
}
var_dump((new Baz)->get());
+?>
--EXPECTF--
Fatal error: Uncaught Error: Typed property Baz::$baz must not be accessed before initialization in %s:10
Stack trace:
$bar->setBar(100);
var_dump($bar->bar);
+?>
--EXPECT--
float(100)
};
var_dump($foo->method());
+?>
--EXPECT--
int(15)
class Baz extends Foo{
public int $bar = 33;
}
+?>
--EXPECTF--
Fatal error: Type of Baz::$bar must not be defined (as in class Foo) in %s on line 8
};
var_dump($foo);
+?>
--EXPECTF--
object(class@anonymous)#%d (1) {
["bar"]=>
}
var_dump($foo);
+?>
--EXPECTF--
string(82) "Cannot increment property class@anonymous::$bar of type int past its maximal value"
object(class@anonymous)#1 (1) {
echo $e->getMessage() . "\n";
}
}
+?>
--EXPECT--
Cannot assign string to property Foo::$bbb of type int
Cannot assign string to property Foo::$bbb of type int
$var67 = bcsqrt(0);
$var414 = bcadd(0,-1,10);
?>
-
--EXPECT--
bcscale(): Argument #1 ($scale) must be between 0 and 2147483647
print bzread($bz);
bzclose($bz);
unlink($filename);
+?>
--EXPECT--
This is a test string.
print bzread($bz);
bzclose($bz);
unlink($filename);
+?>
--EXPECT--
This is a test string.
TESTS;
include(__DIR__ . '/../../../tests/quicktester.inc');
+?>
--EXPECT--
OK
$x = 882858043;
var_dump(cal_from_jd($x, CAL_JULIAN));
+?>
--EXPECT--
array(9) {
["date"]=>
$x = 3315881921229094912;
var_dump(cal_from_jd($x, CAL_JULIAN));
+?>
--EXPECT--
array(9) {
["date"]=>
var_dump(cal_days_in_month(CAL_JEWISH, 11, 5772));
var_dump(cal_days_in_month(CAL_JEWISH, 12, 5772));
var_dump(cal_days_in_month(CAL_JEWISH, 13, 5772));
+?>
--EXPECT--
int(30)
int(30)
$x = 882858030;
var_dump(cal_from_jd($x, CAL_GREGORIAN));
+?>
--EXPECTF--
array(9) {
["date"]=>
$x = 9223372036854743639;
var_dump(cal_from_jd($x, CAL_GREGORIAN));
+?>
--EXPECTF--
array(9) {
["date"]=>
$a = array(38245310, 324542846, 324542847, 9223372036854743639);
foreach ($a as $x) var_dump(jdtojewish($x));
+?>
--EXPECT--
string(11) "2/22/103759"
string(12) "12/13/887605"
curl_exec($curl);
var_dump(curl_getinfo($curl, CURLINFO_PRIVATE));
+?>
--EXPECT--
string(3) "123"
curl_setopt($handle, CURLOPT_STDERR, $s);
echo "Done.";
+?>
--EXPECT--
Done.
// Clean the temporary file
@unlink($tempname);
+?>
--EXPECT--
array(2) {
["hello"]=>
// cleanup
unlink($test_file);
unlink($log_file);
-
?>
-
--EXPECT--
testtest
$interval = new DateInterval('P2Y4DT6H8M');
var_dump($interval->days);
+?>
--EXPECT--
bool(false)
echo date('D Y/m/d/H:i:s', strtotime('last saturday', 1112703348)). "\n";
echo date('D Y/m/d/H:i:s', strtotime("last sunday", 1112703348)). "\n";
echo date('D Y/m/d/H:i:s', strtotime('last monday', 1112703348)). "\n";
+?>
--EXPECT--
Sat 2005/04/02/00:00:00
Sun 2005/04/03/00:00:00
echo $d2->format(DATE_ISO8601), PHP_EOL;
echo PHP_EOL;
}
+?>
--EXPECT--
2008-01-01T12:00:00-0700
2008-01-01T12:00:00+0000
$diff = date_diff($date, $other);
var_dump($diff);
+?>
--EXPECTF--
object(DateInterval)#%d (16) {
["y"]=>
$now->setTime(0, 0, 0);
//date_time_set($now, 0, 0, 0);
echo $now->format("Y-m-d H:i:s") . PHP_EOL;
+?>
--EXPECT--
2008-10-10 01:02:03
2008-10-11 01:02:03
var_dump( $d );
echo $d->format( DATE_ISO8601 ), "\n\n";
echo $d->format( 'U' ), "\n\n";
+?>
--EXPECT--
object(DateTime)#1 (3) {
["date"]=>
--FILE--
<?php
var_dump(date("Y", 1245623227));
+?>
--EXPECT--
string(4) "2009"
print_r($x);
$y = unserialize(serialize($x));
print_r($y);
+?>
--EXPECT--
DateInterval Object
(
--FILE--
<?php
var_dump(date("d", strtotime("March 1 eighth day 2009")));
+?>
--EXPECT--
string(2) "09"
echo "\n\n";
}
+?>
--EXPECTF--
string(5) "Y-m-d"
string(19) "2001-11-29 13:20:01"
echo $I->unit."\n";
$I->d++;
print_r($I);
+?>
--EXPECT--
1
2
$dt = DateTime::createFromFormat('Y-m-d!', '2011-02-02');
var_dump($dt);
+?>
--EXPECT--
object(DateTime)#1 (3) {
["date"]=>
$dt->sub($interval);
var_dump($dt);
+?>
--EXPECT--
object(DateTime)#2 (3) {
["date"]=>
} catch (Exception $e) {
var_dump($e->getMessage());
}
+?>
--EXPECTF--
NULL
int(3)
try {
unserialize( $s1 );
} catch ( Exception $e ) {}
+?>
--EXPECTF--
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852.php:%d
Stack trace:
unserialize( $s2 );
} catch ( Exception $e ) {}
var_dump( $foo );
+?>
--EXPECTF--
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var2.php:%d
Stack trace:
unserialize( $s2 );
} catch ( Exception $e ) {}
var_dump( $foo );
+?>
--EXPECTF--
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var3.php:%d
Stack trace:
$date->modify('+0 days');
echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+?>
--EXPECT--
FROM TIMESTAMP, NO TZ:
2012-08-21 22:00:00 GMT+0000 (offset 0)
}
}
echo "Done";
+?>
--EXPECT--
Done
setlocale(LC_ALL, 'C');
p('あ');
+?>
--EXPECT--
あ
あ
--FILE--
<?php
var_dump(date_parse_from_format("\\","AAAABBBB"));
+?>
--EXPECT--
array(12) {
["year"]=>
<?php
$z = '';
var_dump(date_parse_from_format("aHa0", "0=G{$z}9UCNnF"));
+?>
--EXPECT--
array(12) {
["year"]=>
// New style.
var_dump(unserialize('O:8:"DateTime":3:{s:4:"date";s:26:"2005-07-14 22:30:41.123456";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/London";}'));
+?>
--EXPECTF--
object(DateTime)#%d (3) {
["date"]=>
var_dump($date1 < $date2);
var_dump($date2 > $date1);
var_dump($date2 == $date3);
+?>
--EXPECT--
bool(false)
bool(true)
var_dump($earlyDate1 > $earlyDate2);
var_dump($earlyDate2 < $earlyDate1);
var_dump($earlyDate2 == $earlyDate3);
+?>
--EXPECT--
bool(false)
bool(true)
else {
echo "no";
}
+?>
--EXPECT--
object(DateTimeZone)#4 (2) {
["timezone_type"]=>
date_default_timezone_set('America/Los_Angeles');
var_dump(DateTime::createFromFormat('Y/m/d H:i:s', '1995/06/08 12:34:56', null));
var_dump(DateTimeImmutable::createFromFormat('Y/m/d H:i:s', '1995/06/08 12:34:56', null));
+?>
--EXPECT--
object(DateTime)#1 (3) {
["date"]=>
var_dump($date->format(DateTime::RFC3339_EXTENDED));
var_dump($date->format('u'));
var_dump($date->format('v'));
+?>
--EXPECT--
string(29) "2009-09-28T09:45:31.918-03:00"
string(6) "918312"
$date->modify('first day of next month');
$date->setDate('2012', '1', '29');
var_dump($date);
+?>
--EXPECTF--
object(DateTime)#%d (3) {
["date"]=>
} catch (DOMException $e) {
echo $e->getMessage();
}
+?>
--EXPECT--
Not Found Error
} catch(TypeError $e) {
echo "OK! {$e->getMessage()}";
}
+?>
--EXPECT--
OK! DOMElement::append(): Argument #1 must be of type DOMNode|string, array given
} else {
echo "has no child nodes\n";
}
+?>
--EXPECT--
has no child nodes
has child nodes
$e = $e->item(0);
echo $d->saveXml($e),"\n";
echo $d->saveHtml($e),"\n";
+?>
--EXPECT--
<p>Hi.<br/>there</p>
<p>Hi.<br>there</p>
var_dump($result == $dom->saveXML());
unlink($filename);
+?>
--EXPECT--
int(181)
bool(true)
echo "node $index\n";
dumpcourse($children->item($index));
}
+?>
--EXPECT--
Start cloneNode test
node 0
$current = $children->item($index);
dumpcourse($current);
}
+?>
--EXPECT--
original has 5 nodes
node 4
echo 'namespace node prefix=' . $ns2->prefix . "\n";
echo 'namespace node namespaceURI=' . $ns2->namespaceURI . "\n";
}
+?>
--EXPECT--
namespace node prefix=ns2
namespace node namespaceURI=http://ns2
var_dump($attr);
print_r($attr);
+?>
--EXPECTF--
object(DOMAttr)#%d (%d) {
%A
$attr = $doc->documentElement;
var_dump($attr);
+?>
--EXPECTF--
object(DOMElement)#%d (%d) {%A
["nextSibling"]=>
return $return;
}
}
+?>
--EXPECT--
bool(true)
$dom = new domdocument;
$dom->load("compress.zlib://".__DIR__."/book.xml.gz");
print $dom->saveXML();
+?>
--EXPECT--
<?xml version="1.0"?>
<books>
function adjustDoctype($xml) {
return str_replace(array("DOCTYPE HTML",'<p>','</p>'),array("DOCTYPE html",'',''),$xml);
}
+?>
--EXPECT--
--- save as XML
<?xml version="1.0" standalone="yes"?>
$dom->load(__DIR__."/book.xml");
$dom->addBook("PHP de Luxe", "Richard Samar, Christian Stocker");
print $dom->saveXML();
+?>
--EXPECT--
<?xml version="1.0"?>
<books>
var_dump($node);
$node = $ents->getNamedItem('xxx');
var_dump($node);
+?>
--EXPECT--
Length: 1
Key GIF: GIF (image/gif) (-)
echo get_class($current), "\n";
var_dump($current->textContent);
}
+?>
--EXPECT--
bool(true)
--- child 0 ---
echo get_class($current), "\n";
var_dump($current->textContent);
}
+?>
--EXPECT--
bool(true)
--- child 0 ---
$d->dynamicProperty = new stdclass;
$d->loadXML($xml);
print_r($d);
+?>
--EXPECTF--
DOMDocument Object
(
<?php
$infile = __DIR__.'/bug50845.jpg';
var_dump(exif_read_data($infile));
+?>
--EXPECTF--
array(44) {
["FileName"]=>
$dlist->del(3);
$dlist->print();
echo "OK\n";
+?>
--EXPECT--
[1, 3, 5]
[1, 5]
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
+?>
--EXPECT--
finfo::__construct() expects at most 2 parameters, 3 given
var_dump(nl_langinfo(CODESET));
var_dump(mime_content_type(__DIR__ . '/resources/test.ppt'));
var_dump(nl_langinfo(CODESET));
+?>
--EXPECT--
string(11) "ru_RU.koi8r"
string(6) "KOI8-R"
var_dump($data);
var_dump(filter_var_array($data, array('bar' => array('filter' => FILTER_CALLBACK, 'options' => 'filter_cb'))));
var_dump($data);
+?>
--EXPECT--
array(1) {
["bar"]=>
var_dump(filter_input_array(INPUT_POST, $invalid));
var_dump(filter_var_array(array(), $invalid));
}
+?>
--EXPECT--
bool(false)
bool(false)
var_dump(filter_var('http://example.com/path', FILTER_VALIDATE_URL));
var_dump(filter_var('http://exa-mple.com/path', FILTER_VALIDATE_URL));
var_dump(filter_var('http://exa_mple.com/path', FILTER_VALIDATE_URL));
+?>
--EXPECT--
string(23) "http://example.com/path"
string(24) "http://exa-mple.com/path"
// An invalid address likely to crash PHP due to stack exhaustion if it goes to
// the validation regex.
var_dump(filter_var(str_repeat('x', 8000), FILTER_VALIDATE_EMAIL));
+?>
--EXPECT--
string(19) "valid@email.address"
bool(false)
<?php
var_dump(filter_var('http://example.com./', FILTER_VALIDATE_URL));
var_dump(filter_var('http://example.com/', FILTER_VALIDATE_URL));
+?>
--EXPECT--
string(20) "http://example.com./"
string(19) "http://example.com/"
FILTER_VALIDATE_BOOLEAN,
FILTER_NULL_ON_FAILURE
));
+?>
--EXPECT--
NULL
FILTER_VALIDATE_BOOLEAN,
FILTER_NULL_ON_FAILURE
));
+?>
--XFAIL--
Requires php_zval_filter to not use convert_to_string for all filters.
--EXPECT--
// Free image
imagedestroy($im);
?>
-
--EXPECT--
*** Testing imagecolorstotal() : basic functionality ***
Total colors in image: 128
<?php
chdir(__DIR__);
var_dump(bindtextdomain('example.org', 'foobar'));
+?>
--EXPECT--
bool(false)
--CREDITS--
var_dump(dcgettext('dngettextTest', 'item', LC_CTYPE));
var_dump(dcgettext('dngettextTest', 'item', LC_MESSAGES));
+?>
--EXPECT--
string(8) "cProdukt"
string(7) "Produkt"
var_dump(dngettext('dngettextTest', 'item', 'items', 1));
var_dump(dngettext('dngettextTest', 'item', 'items', 2));
+?>
--EXPECT--
string(7) "Produkt"
string(8) "Produkte"
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
bool(true)
gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
bool(true)
gmp_import(): Argument #2 ($word_size) must be greater than or equal to 1
<?php
print_r(hash_hmac_algos());
+?>
--EXPECTF--
Array
(
$algo = sprintf('haval%d,%d',$bits,$pass);
echo $algo . ': ' . hash($algo,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ0123456789') . "\n";
}
+?>
--EXPECT--
Empty String
haval128,3: c68f39913f901f3ddf44c707357a7d70
echo hash_final($ctx) . "\n";
echo hash_hmac('md5', str_repeat(chr(0xDD), 50), str_repeat(chr(0xAA), 16)) . "\n";
+?>
--EXPECT--
9294727a3638bb1c13f48ef8158bfc9d
750c783e6ab0b503eaa86e310a5db738
echo hash('md2', 'abcdefghijklmnopqrstuvwxyz') . "\n";
echo hash('md2', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
echo hash('md2', '12345678901234567890123456789012345678901234567890123456789012345678901234567890') . "\n";
+?>
--EXPECT--
8350e5a3e24c153df2275c9f80692773
32ec01ec4a6dac72c0ab96fb34c0b5d1
echo hash('md4', 'abcdefghijklmnopqrstuvwxyz') . "\n";
echo hash('md4', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
echo hash('md4', '12345678901234567890123456789012345678901234567890123456789012345678901234567890') . "\n";
+?>
--EXPECT--
31d6cfe0d16ae931b73c59d7e0c089c0
bde52cb31de33e46245e05fbdbd6fb24
echo hash('md5', 'a') . "\n";
echo hash('md5', '012345678901234567890123456789012345678901234567890123456789') . "\n";
echo hash('md5', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
d41d8cd98f00b204e9800998ecf8427e
0cc175b9c0f1b6a831c399e269772661
} catch (Error $e) {
echo "Exception: {$e->getMessage()}\n";
}
+?>
--EXPECT--
Exception: Call to private HashContext::__construct() from global scope
echo $e->getMessage() . "\n";
}
+?>
--EXPECT--
hash_update(): Argument #1 ($context) must be a valid Hash Context resource
echo hash('ripemd128', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
echo hash('ripemd128', '12345678901234567890123456789012345678901234567890123456789012345678901234567890') . "\n";
echo hash('ripemd128', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
cdf26213a150dc3ecb610f18f6b38b46
86be7afa339d0fc7cfc785e72f578d33
echo hash('ripemd160', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
echo hash('ripemd160', '12345678901234567890123456789012345678901234567890123456789012345678901234567890') . "\n";
echo hash('ripemd160', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
9c1185a5c5e9fc54612808977ee8f548b2258d31
0bdc9d2d256b3ee9daae347be6f4dc835a467ffe
echo hash('ripemd256', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
echo hash('ripemd256', '12345678901234567890123456789012345678901234567890123456789012345678901234567890') . "\n";
echo hash('ripemd256', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
02ba4c4e5f8ecd1877fc52d64d30e37a2d9774fb1e5d026380ae0168e3c5522d
f9333e45d857f5d90a91bab70a1eba0cfb1be4b0783c9acfcd883a9134692925
echo hash('ripemd320', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') . "\n";
echo hash('ripemd320', '12345678901234567890123456789012345678901234567890123456789012345678901234567890') . "\n";
echo hash('ripemd320', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
22d65d5661536cdc75c1fdf5c6de7b41b9f27325ebc61e8557177d705a0ec880151c3a32a00899b8
ce78850638f92658a5a585097579926dda667a5716562cfcf6fbe77f63542f99b04705d6970dff5d
echo hash('sha1', 'abc') . "\n";
echo hash('sha1', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
echo hash('sha1', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
da39a3ee5e6b4b0d3255bfef95601890afd80709
86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
echo hash('sha224', 'abc') . "\n";
echo hash('sha224', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
echo hash('sha224', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
abd37534c7d9a2efb9465de931cd7055ffdb8879563ae98078d6d6d5
echo hash('sha256', 'abc') . "\n";
echo hash('sha256', 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') . "\n";
echo hash('sha256', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
echo $bits, ': ', hash("sha3-$bits", $subject), "\n";
}
}
+?>
--EXPECT--
== ==
224: 6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7
echo hash('sha384', 'abc') . "\n";
echo hash('sha384', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu') . "\n";
echo hash('sha384', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b
54a59b9f22b0b80880d8427e548b7c23abd873486e1f035dce9cd697e85175033caa88e6d57bc35efae0b5afd3145f31
echo hash('sha512/224', '') . "\n";
echo hash('sha512/224', 'abc') . "\n";
echo hash('sha512/224', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu') . "\n";
+?>
--EXPECT--
6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4
4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa
echo hash('sha512/256', '') . "\n";
echo hash('sha512/256', 'abc') . "\n";
echo hash('sha512/256', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu') . "\n";
+?>
--EXPECT--
c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a
53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23
echo hash('sha512', 'abc') . "\n";
echo hash('sha512', 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu') . "\n";
echo hash('sha512', str_repeat('a', 1000000)) . "\n";
+?>
--EXPECT--
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75
);
echo iconv_mime_encode('Subject', $text, $options);
+?>
--EXPECT--
Subject: =?UTF-8?Q?=E3=83=86?=
=?UTF-8?Q?=E3=82=B9?=
var_dump(ini_get('iconv.internal_encoding'));
var_dump(ini_get('iconv.input_encoding'));
var_dump(ini_get('iconv.output_encoding'));
+?>
--EXPECT--
Getting INI
string(10) "ISO-8859-1"
do_regression_test();
$mode = ICONV_MIME_DECODE_STRICT | ICONV_MIME_DECODE_CONTINUE_ON_ERROR;
do_regression_test();
+?>
--EXPECT--
(31) "Subject: PrüfungPrüfungkůÔńÓlet"
(32) "Subject: Prüfung PrüfungkůÔńÓlet"
$header = "$s\n $s\n\t$s";
var_dump(imap_mime_header_decode($header));
+?>
--EXPECT--
array(3) {
[0]=>
ini_set("intl.error_level", E_WARNING);
new IntlBreakIterator();
+?>
--EXPECTF--
Fatal error: Uncaught Error: Call to private IntlBreakIterator::__construct() from global scope in %s:%d
Stack trace:
} catch (IntlException $e) {
print_exception($e);
}
+?>
--EXPECTF--
Exception: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d
$bi_clone = clone $bi;
var_dump(get_class($bi), get_class($bi_clone));
var_dump($bi == $bi_clone);
+?>
--EXPECT--
string(26) "IntlRuleBasedBreakIterator"
string(26) "IntlRuleBasedBreakIterator"
var_dump($o1 == $o2 && $o2 == $o3);
echo "\n";
}
+?>
--EXPECT--
===== createWordInstance =====
bool(true)
var_dump($bi->next());
var_dump($bi->first());
var_dump($bi->current());
+?>
--EXPECT--
int(0)
int(3)
var_dump($bi->getText());
$bi->setText('foo bar');
var_dump($bi->getText());
+?>
--EXPECT--
NULL
string(7) "foo bar"
var_dump($bi->current());
var_dump($bi->last());
var_dump($bi->current());
+?>
--EXPECT--
int(0)
int(13)
var_dump($bi->next());
var_dump($bi->setText('foo bar'));
var_dump($bi->current());
+?>
--EXPECT--
bool(true)
string(7) "foo bar"
grapheme_substr('FOK', 1, 20), // expected: OK
grapheme_substr('한국어', 1, 20) //expected: 국어
);
+?>
--EXPECT--
string(2) "OK"
string(6) "국어"
$c = new Collator2();
$a = $c->compare('h', 'H');
+?>
--EXPECTF--
Fatal error: Uncaught Error: Object not initialized in %s:%d
Stack trace:
$c = new Collator2();
$c->getLocale(Locale::ACTUAL_LOCALE);
+?>
--EXPECTF--
Fatal error: Uncaught Error: Object not initialized in %s:%d
Stack trace:
$c = new Collator2();
$c->getSortKey('h');
+?>
--EXPECTF--
Fatal error: Uncaught Error: Object not initialized in %s:%d
Stack trace:
$c = new Collator2();
$a = array('a', 'b');
$c->sort($a);
+?>
--EXPECTF--
Fatal error: Uncaught Error: Object not initialized in %s:%d
Stack trace:
$c = new Collator2();
$a = array('a', 'b');
$c->sortWithSortKeys($a);
+?>
--EXPECTF--
Fatal error: Uncaught Error: Object not initialized in %s:%d
Stack trace:
<?php
var_dump(grapheme_stripos(1,1,2147483648));
var_dump(grapheme_strpos(1,1,2147483648));
+?>
--EXPECT--
bool(false)
bool(false)
} catch (IntlException $e) {
echo PHP_EOL."Exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . PHP_EOL;
}
+?>
--EXPECTF--
Warning: datefmt_create(): datefmt_create: Time zone identifier given is not a valid UTF-8 string in %s on line %d
NULL
$res = collator_get_sort_key($coll, $s1);
echo urlencode($res);
+?>
--EXPECT--
5%2F%3D%3DC%01%09%01%8F%08
$res = collator_get_sort_key($coll, $s1);
echo urlencode($res);
+?>
--EXPECT--
71%3F%3FE%01%09%01%DC%08
$res = collator_get_sort_key($coll, $s1);
echo urlencode($res);
+?>
--EXPECT--
82%40%40F%01%09%01%DC%08
ini_set('intl.error_level', E_WARNING);
$x = new IntlDateFormatter('en', 1, 1);
var_dump($x->__construct('en', 1, 1));
+?>
--EXPECTF--
Fatal error: Uncaught IntlException: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %sbug62081.php:4
Stack trace:
var_dump(locale_get_display_name(str_repeat("a", 300), null));
var_dump(locale_get_display_name(str_repeat("a", 512), null));
var_dump(locale_get_display_name(str_repeat("a", 600), null));
+?>
--EXPECT--
bool(false)
bool(false)
<?php
$arr1 = array();
var_dump(grapheme_extract(-1, -1, -1,-1, $arr1));
+?>
--EXPECT--
bool(false)
$clone = clone $obj;
var_dump(get_class($clone));
}
+?>
--EXPECT--
string(1) "A"
string(1) "B"
} catch (Exception $e) {
var_dump($e->getMessage());
}
+?>
--EXPECT--
string(39) "Cannot clone unconstructed IntlTimeZone"
echo grapheme_extract($haiyore, 1, GRAPHEME_EXTR_MAXCHARS) . "\n";
echo grapheme_extract($haiyore, 2, GRAPHEME_EXTR_MAXCHARS) . "\n";
echo grapheme_extract($haiyore, 3, GRAPHEME_EXTR_MAXCHARS) . "\n";
+?>
--EXPECT--
葛󠄁
這󠄀
$out = locale_get_primary_language($var1);
echo strlen($out) . PHP_EOL;
echo unpack('H*', $out)[1] . PHP_EOL;
+?>
--EXPECT--
0
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_add(1, 2, 3));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_add(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
+?>
--EXPECT--
error: 0, IntlCalendar::after() expects exactly 1 parameter, 0 given
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
IntlCalendar::clear(): Argument #1 ($field) must be a valid field
intlcal_clear(): Argument #2 ($field) must be a valid field
--FILE--
<?php
var_dump(IntlCalendar::FIELD_FIELD_COUNT);
+?>
--EXPECTF--
int(%d)
}
var_dump(intlcal_create_instance(new X, NULL));
+?>
--EXPECTF--
Warning: intlcal_create_instance(): intlcal_create_instance: passed IntlTimeZone is not properly constructed in %s on line %d
NULL
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
+?>
--EXPECT--
error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given
echo $e->getMessage(), "\n";
}
var_dump(intlcal_field_difference(1, 0, 1));
+?>
--EXPECTF--
IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given
strtotime('2012-01-01 00:00:00 +03:40') * 1000.,
$cal->getTimeZone()->getID()
);
+?>
--EXPECTF--
float(1325372400000)
float(1325372400000)
$date = new DateTime('2012-01-01 00:00:00 WEST');
var_dump(IntlCalendar::fromDateTime($date));
+?>
--EXPECTF--
threw exception, OK
Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: DateTime object is unconstructed in %s on line %d
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
-
+?>
--EXPECT--
IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_get_day_of_week_type(): Argument #1 ($calendar) must be of type IntlCalendar, int given
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_error_code(null));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_error_code(): Argument #1 ($calendar) must be of type IntlCalendar, null given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_error_message(null));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_error_message(): Argument #1 ($calendar) must be of type IntlCalendar, null given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_first_day_of_week(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_first_day_of_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_locale(1));
+?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_minimal_days_in_first_week(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_minimal_days_in_first_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_skipped_wall_time_option(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_skipped_wall_time_option(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_time_zone(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_time(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_time(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_get_type(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_get_type(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_get_weekend_transition(): Argument #1 ($calendar) must be of type IntlCalendar, int given
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
ValueError: 0, IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field
ValueError: 0, IntlCalendar::getMaximum(): Argument #1 ($field) must be a valid field
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given
ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_in_daylight_time(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_in_daylight_time(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
+?>
--EXPECT--
error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_is_lenient(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_is_lenient(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
-
+?>
--EXPECT--
IntlCalendar::isSet(): Argument #1 ($field) must be a valid field
intlcal_is_set(): Argument #1 ($calendar) must be of type IntlCalendar, int given
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_is_weekend(1));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_is_weekend(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECTF--
IntlCalendar::roll(): Argument #1 ($field) must be a valid field
intlcal_roll(): Argument #1 ($calendar) must be of type IntlCalendar, int given
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_set_lenient(1, false));
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: intlcal_set_lenient(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
Stack trace:
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($numberOfDays) must be between 1 and 7
intlcal_set_minimal_days_in_first_week(): Argument #2 ($numberOfDays) must be between 1 and 7
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($wallTimeOption) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID
IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($wallTimeOption) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST
} catch (Error $ex) {
echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
}
+?>
--EXPECT--
error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given
$pstdate = new DateTime('2012-01-01 00:00:00 +24:00');
$intlcal->setTimeZone($pstdate->getTimeZone());
var_dump($intlcal->getTimeZone()->getID());
+?>
--EXPECTF--
Warning: IntlCalendar::setTimeZone(): intlcal_set_time_zone: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d
string(16) "Europe/Amsterdam"
$offsetdate = new DateTime('2012-01-01 00:00:00 -02:30');
$intlcal->setTimeZone($offsetdate->getTimeZone());
var_dump($intlcal->getTimeZone()->getID());
+?>
--EXPECTF--
string(12) "Europe/Paris"
string(13) "Europe/Madrid"
ini_set("intl.error_level", E_WARNING);
var_dump(intlcal_set_time(1));
+?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 parameters, 1 given in %s:%d
Stack trace:
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
IntlCalendar::set() expects at most 6 parameters, 7 given
IntlCalendar::set() has no variant with exactly 4 parameters
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECTF--
Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: DateTimeZone constructor threw exception in %s on line %d
string(77) "exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
} catch (Exception $e) {
var_dump($e->getMessage());
}
+?>
--EXPECTF--
string(%s) "Cannot clone unconstructed IntlDateFormatter"
return new DateTimeImmutable("2020-01-20 20:20:20", new DateTimeZone("UTC"));
}
+?>
--EXPECT--
yesterday
yesterday
} catch (\IntlException $e) {
echo $e->getMessage();
}
+?>
--EXPECT--
IntlDateFormatter::__construct(): Invalid date.timezone value 'Mars/Utopia_Planitia', we selected the timezone 'UTC' for now.
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
echo $df->format($ts), "\n";
+?>
--EXPECTF--
sábado%S 31 de diciembre de 2011 23:00:00 Hora%S de las Azores
domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa Central
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
echo $df->format($ts), "\n";
+?>
--EXPECTF--
sábado%S, 31 de diciembre de 2011 23:00:00 Hora estándar de las Azores
domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
echo $df->format($ts), "\n";
+?>
--EXPECTF--
sábado%S 31 de diciembre de 2011, 23:00:00 (Hora estándar de las Azores)
domingo%S 1 de enero de 2012, 1:00:00 (Hora estándar de Europa central)
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
echo $df->format($ts), "\n";
+?>
--EXPECT--
sábado, 31 de diciembre de 2011, 23:00:00 (hora estándar de las Azores)
domingo, 1 de enero de 2012, 1:00:00 (hora estándar de Europa central)
} catch (Exception $e) {
var_dump($e->getMessage());
}
+?>
--EXPECT--
string(42) "Cannot clone unconstructed NumberFormatter"
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
+?>
--EXPECT--
Too many arguments
Too many arguments
echo "reverse, ok, with details:", "\n";
var_dump(idn_to_utf8($asciiNonTrans, 0, INTL_IDNA_VARIANT_UTS46, $info));
var_dump($info);
+?>
--EXPECT--
all ok, no details:
string(22) "www.xn--fuball-cta.com"
ini_set("intl.use_exceptions", false);
ini_set("intl.error_level", E_NOTICE);
var_dump($t->transliterate('a', 3));
+?>
--EXPECTF--
string(130) "transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1)"
foreach ($funcs as $func) {
echo (new ReflectionFunction($func));
}
+?>
--EXPECT--
Function [ <internal:intl> function locale_get_display_language ] {
} catch (Exception $e) {
var_dump($e->getMessage());
}
+?>
--EXPECTF--
string(%d) "Cannot clone unconstructed MessageFormatter"
$mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array(7)));
+?>
--EXPECT--
string(5) "7 {1}"
$mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array(7)));
+?>
--EXPECTF--
Warning: MessageFormatter::format(): Inconsistent types declared for an argument in %s on line %d
bool(false)
$mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array("foo" => 7, -1 => "bar")));
+?>
--EXPECTF--
Warning: MessageFormatter::format(): Found negative or too large array key in %s on line %d
bool(false)
$mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array("foo" => new stdclass())));
+?>
--EXPECTF--
Warning: MessageFormatter::format(): msgfmt_format: invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted) in %s on line %d
$mf = new MessageFormatter('en_US', $fmt);
var_dump($mf->format(array("foo" => 'bar', 7 => fopen('php://memory', 'r+'))));
+?>
--EXPECTF--
Warning: MessageFormatter::format(): No strategy to convert the value given for the argument with key '7' is available in %s on line %d
bool(false)
}
}
}
+?>
--EXPECT--
** Gnomeregan
bool(false)
}
}
}
+?>
--EXPECT--
** Gnomeregan
bool(false)
ini_set("intl.error_level", E_WARNING);
var_dump(IntlTimeZone::countEquivalentIDs("foo\x80"));
+?>
--EXPECTF--
Warning: IntlTimeZone::countEquivalentIDs(): intltz_count_equivalent_ids: could not convert time zone id to UTF-16 in %s on line %d
bool(false)
ini_set("intl.error_level", E_WARNING);
var_dump(IntlTimeZone::createTimeZoneIDEnumeration(-1));
+?>
--EXPECTF--
Warning: IntlTimeZone::createTimeZoneIDEnumeration(): intltz_create_time_zone_id_enumeration: bad zone type in %s on line %d
bool(false)
var_dump($dtz->getName());
$tz = IntlTimeZone::fromDateTimeZone($dtz);
var_dump($tz->getID(), $tz->getRawOffset() /* (3*60+40)*60000 */);
+?>
--EXPECTF--
string(16) "Europe/Amsterdam"
int(3600000)
var_dump($tz->getDisplayName(false, -1));
var_dump(intltz_get_display_name(null, IntlTimeZone::DISPLAY_SHORT, false, 'pt_PT'));
+?>
--EXPECTF--
Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: wrong display type in %s on line %d
bool(false)
var_dump($ex->getCode(), $ex->getMessage());
echo "\n";
}
+?>
--EXPECT--
int(0)
string(101) "IntlTimeZone::hasSameRules(): Argument #1 ($otherTimeZone) must be of type IntlTimeZone, string given"
do_test(IntlTimeZone::createTimeZone('CET'));
do_test(IntlTimeZone::createTimeZone('Europe/Amsterdam'));
do_test(IntlTimeZone::createTimeZone('GMT+0405'), true);
+?>
--EXPECTF--
string(3) "CET"
int(3600000)
}
var_dump(intltz_to_date_time_zone(1));
+?>
--EXPECTF--
Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: DateTimeZone constructor threw exception in %s on line %d
string(66) "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
echo "Error: ", intl_get_error_message(), "\n";
}
}
+?>
--EXPECT--
string(24) "SA Pacific Standard Time"
string(21) "Eastern Standard Time"
echo "Error: ", intl_get_error_message(), "\n";
}
}
+?>
--EXPECT--
string(24) "SA Pacific Standard Time"
string(18) "Cuba Standard Time"
echo $u->id, ": ", $u->transliterate($str), "\n";
echo "Done.\n";
+?>
--EXPECT--
hex-any: a 万
hex-any: a 万
echo $t->id,"\n";
echo "Done.\n";
+?>
--EXPECT--
any-latin
any-latin
echo intl_get_error_message(), "\n";
echo "Done.\n";
+?>
--EXPECTF--
Warning: Transliterator::create(): transliterator_create: unable to open ICU transliterator with id "inexistent id" in %s on line %d
transliterator_create: unable to open ICU transliterator with id "inexistent id": U_INVALID_ID
echo $u->transliterate("``akk ``bkk ``aooy"), "\n";
echo "Done.\n";
+?>
--EXPECT--
RulesTransPHP
“akk ``bkk “aooy
$t = Transliterator::createFromRules($rules);
echo intl_get_error_message(),"\n";
echo "Done.\n";
+?>
--EXPECTF--
Warning: Transliterator::createFromRules(): String conversion of rules to UTF-16 failed in %s on line %d
String conversion of rules to UTF-16 failed: U_INVALID_CHAR_FOUND
var_dump($orstr === $recovstr2);
echo "Done.\n";
+?>
--EXPECT--
オーシャンビュー
ōshanbyū
echo $t->getErrorCode(), "\n";
echo "Done.\n";
+?>
--EXPECTF--
Warning: Transliterator::transliterate(): String conversion of string to UTF-16 failed in %s on line %d
bool(false)
echo $t->getErrorMessage(), "\n";
echo "Done.\n";
+?>
--EXPECTF--
Warning: Transliterator::transliterate(): String conversion of string to UTF-16 failed in %s on line %d
bool(false)
var_dump(count(Transliterator::listIDs()) > 100);
echo "Done.\n";
+?>
--EXPECT--
bool(true)
bool(true)
var_dump($revtr);
echo "Done.\n";
+?>
--EXPECTF--
Katakana-Latin
Latin-Katakana
echo $t->transliterate($s, 3, 4),"\n";
echo "Done.\n";
+?>
--EXPECT--
Kontogiannátos, Basílēs
Kontogiannátos, Basílēs
transliterator_transliterate($tr, "\x80\x03");
echo "Done.\n";
+?>
--EXPECTF--
Warning: transliterator_transliterate(): transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3) in %s on line %d
bool(false)
echo intl_get_error_message(), "\n";
echo "Done.\n";
+?>
--EXPECTF--
\u0020o
<?php
$c = new UConverter('utf-8', "\x80");
var_dump($c);
+?>
--EXPECTF--
Warning: UConverter::__construct(): ucnv_open() returned error 4: U_FILE_ACCESS_ERROR in %s on line %d
object(UConverter)#%d (0) {
$o = new UConverter(1, 1);
$o->toUCallback(1, 1, 1, $b);
var_dump($o->getErrorCode());
+?>
--EXPECT--
int(27)
$latin1 = UConverter::getAliases('latin1');
var_dump(in_array('ISO-8859-1', $latin1));
+?>
--EXPECT--
bool(true)
bool(true)
var_dump(urlencode(UConverter::transcode("Stra\xDFa", 'utf-8', 'latin1')));
var_dump(bin2hex(UConverter::transcode("\xE4", 'utf-8', 'koi8-r')));
+?>
--EXPECT--
string(23) "This is an ascii string"
string(12) "Espa%C3%B1ol"
var_dump($ret);
}
}
+?>
--EXPECT--
string(23) "This is an ascii string"
string(12) "Snowman: (?)"
<?php
$c = new UConverter('UTF-7', 'ascii');
var_dump($c->getDestinationEncoding());
+?>
--EXPECT--
string(5) "UTF-7"
<?php
$c = new UConverter('utf-32', 'ascii');
var_dump($c->getSourceEncoding());
+?>
--EXPECT--
string(8) "US-ASCII"
$c = new UConverter('koi8-r', 'utf-32be');
var_dump(UConverter::UTF32_BigEndian === $c->getSourceType());
var_dump(UConverter::SBCS === $c->getDestinationType());
+?>
--EXPECT--
bool(true)
bool(true)
$k = new UConverter('utf-8', 'koi8-r');
var_dump(bin2hex($k->convert("\xE4"))); // U+0414 CYRILLIC CAPITAL LETTER DE
+?>
--EXPECT--
string(23) "This is an ascii string"
string(12) "Espa%C3%B1ol"
foreach(array("regular", "irregul\xC1\xA1r", "\xC2\xA1unsupported!") as $word) {
$c->convert($word);
}
+?>
--EXPECT--
toUCallback(REASON_RESET, ...)
toUCallback(REASON_RESET, ...)
foreach(array("regular", "irregul\xC1\xA1r", "\xC2\xA1unsupported!") as $word) {
$c->convert($word);
}
+?>
--EXPECT--
toUCallback(REASON_RESET, ...)
toUCallback(REASON_RESET, ...)
var_dump($c->convert("\x80\x81\x82\x83"));
// This line will trigger fromUCallback
var_dump($c->convert("\xC3\xB1\xC3\xB2\xC3\xB3\xC3\xB4"));
+?>
--EXPECT--
string(3) "abc"
string(3) "ABC"
var_dump($c->convert("This is an ascii string"));
var_dump($c->convert("Snowman: (\xE2\x98\x83)"));
}
+?>
--EXPECT--
string(23) "This is an ascii string"
string(12) "Snowman: (?)"
var_dump($c->getSourceEncoding());
$c->setSourceEncoding('utf-7');
var_dump($c->getSourceEncoding());
+?>
--EXPECT--
string(8) "US-ASCII"
string(5) "UTF-7"
});
echo "RECYCLING SYMBOL FOR TYPE-1 PLASTICS => ";
var_dump(IntlChar::charFromName("RECYCLING SYMBOL FOR TYPE-1 PLASTICS"));
+?>
--EXPECT--
Codepoint range: 0000-10ffff
Codepoint U+0050
echo 'ERROR' . PHP_EOL;
break;
}
+?>
--EXPECT--
OK
ERROR
decode("\rtrue\r");
echo "Done\n";
+?>
--EXPECT--
bool(true)
bool(false)
echo PHP_EOL;
echo "Done\n";
+?>
--EXPECT--
bool(true)
SUCCESS
} catch (\Exception $e) {
echo $e->getMessage();
}
+?>
--EXPECT--
This error is expected
echo json_encode(new $class($ndata)), "\n";
echo json_encode(new $class($odata)), "\n";
}
+?>
--EXPECT--
==NonSerializingTest==
{"data":{"str":"foo","int":1,"float":2.3,"bool":false,"nil":null,"arr":[1,2,3],"obj":{}}}
libxml_set_streams_context($ctx2);
@simplexml_load_file('test://sdfsdf');
+?>
--EXPECT--
Array
(
}
echo "Done.\n";
+?>
--EXPECT--
bool(true)
Exception: Too few arguments to function {closure}(), 3 passed and exactly 4 expected
var_dump($dd->validate());
echo "Done.\n";
+?>
--EXPECTF--
string(10) "-//FOO/BAR"
string(25) "http://example.com/foobar"
var_dump($dd->validate());
echo "Done.\n";
+?>
--EXPECTF--
string(10) "-//FOO/BAR"
string(%d) "%sfoobar.dtd"
// not OK
test("\xE2\xB0\xB0"); // U+2C30 GLAGOLITIC SMALL LETTER AZU (added in 4.1.0, March 2005)
test("\xD4\xA5"); // U+0525 CYRILLIC SMALL LETTER PE WITH DESCENDER (added in 5.2.0, October 2009)
+?>
--EXPECT--
f0 90 90 90
e2 b0 80
echo $t[1];
}
echo "\n";
+?>
--EXPECT--
UTF-32LE:
Length: 12
$expected === mb_convert_encoding($str, 'UTF-8', 'UTF-8'),
$expected2 === mb_convert_encoding($str2, 'UTF-8', 'UTF-8')
);
+?>
--EXPECT--
bool(true)
bool(true)
var_dump(mb_internal_encoding());
var_dump(ini_get('mbstring.http_input'));
var_dump(ini_get('mbstring.http_output'));
+?>
--EXPECT--
Getting INI
string(9) "Shift_JIS"
var_dump(mb_internal_encoding());
var_dump(ini_get('mbstring.http_input'));
var_dump(ini_get('mbstring.http_output'));
+?>
--EXPECT--
Getting INI
string(0) ""
}
}
echo 'OK';
+?>
--EXPECT--
ERROR(55296)
ERROR(55297)
<?php
mb_regex_set_options('m');
var_dump(mb_split('^', "a\nb\nc"));
+?>
--EXPECT--
array(3) {
[0]=>
var_dump(bin2hex(mb_strcut("abc", 0, 32)));
mb_internal_encoding("ISO-8859-1");
var_dump(bin2hex(mb_strcut("abc", 0, 32)));
+?>
--EXPECT--
string(24) "610000006200000063000000"
string(24) "000000610000006200000063"
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
}
+?>
--EXPECT--
mysqli object is already closed
}
print "done!";
+?>
--EXPECT--
mysqli object is already closed
done!
}
print "done!";
+?>
--EXPECT--
my_mysqli object is already closed
my_mysqli object is already closed
}
print "done!";
+?>
--EXPECT--
mysqli object is already closed
done!
}
print "done!";
+?>
--EXPECT--
mysqli object is already closed
done!
}
print "done!";
+?>
--EXPECTF--
string(%d) "Table 'няма_такава_таблица' doesn't exist"
mysqli object is already closed
echo 'size of stream4a is ', strlen($stream4a), ' bytes, ', mb_strlen($stream4a), ' chars.', PHP_EOL;
echo 'beg of stream4a is ', $start4a, PHP_EOL;
echo 'end of stream4a is ', $ending4a, PHP_EOL;
+?>
--EXPECT--
Test 1: j
size of string1 is 1000006 bytes, 1000006 chars.
}
parseQuery();
echo "ok\n";
+?>
--EXPECT--
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
ok
return;
}
foo();foo1();foo2();
+?>
--EXPECT--
correct
correct
}
$a = array(PHP_VERSION => 1);
var_dump(foo(PHP_VERSION));
+?>
--EXPECT--
int(1)
} else {
var_dump(2);
}
+?>
--EXPECT--
int(2)
if(constant('PHP_BINARY')) {
echo "OK\n";
}
+?>
--EXPECT--
OK
--FILE--
<?php
echo "ok\n";
+?>
--EXPECT--
ok
}
foo();
echo "ok\n";
+?>
--EXPECT--
ok
$b = new B;
$b->test();
+?>
--EXPECT--
test
--CLEAN--
<?php
unlink(__DIR__ . "/bug74663.inc");
+?>
--EXPECT--
bool(true)
return '';
}
}
+?>
--EXPECT--
Done
--FILE--
<?php
var_dump(class_exists('_ZendTestClassAlias'));
+?>
--EXPECT--
bool(true)
}
buggy(42);
+?>
--EXPECT--
int(42)
$t = new Test();
var_dump ($t->run());
+?>
--EXPECT--
bool(true)
bool(true)
default:
break;
}
+?>
--EXPECT--
okey
var_dump($x, $b, $c);
}
foo();
+?>
--EXPECT--
int(1)
array(0) {
var_dump($x, $b, $c);
}
foo();
+?>
--EXPECT--
float(2.3)
array(0) {
var_dump($x);
}
foo();
+?>
--EXPECT--
int(1)
return $c;
}
var_dump(foo());
+?>
--EXPECT--
int(1)
return $c;
}
var_dump(foo());
+?>
--EXPECT--
int(1)
return $c;
}
var_dump(foo());
+?>
--EXPECT--
int(1)
var_dump($a);
}
foo();
+?>
--EXPECT--
int(1)
var_dump($a);
}
foo();
+?>
--EXPECT--
float(1)
}
foo();
echo "ok\n";
+?>
--EXPECT--
ok
}
foo();
echo "ok\n";
+?>
--EXPECT--
ok
var_dump($b, $c);
}
foo();
+?>
--EXPECT--
int(3)
int(2)
var_dump($b, $c);
}
foo();
+?>
--EXPECT--
int(3)
int(3)
var_dump($c);
}
foo();
+?>
--EXPECT--
int(2)
var_dump($c);
}
foo();
+?>
--EXPECT--
array(0) {
}
var_dump($c);
}
foo();
+?>
--EXPECT--
int(2)
return $c;
}
var_dump(foo());
+?>
--EXPECT--
int(2)
return $c;
}
var_dump(foo());
+?>
--EXPECT--
int(2)
var_dump($c, $d);
}
foo();
+?>
--EXPECT--
int(2)
array(0) {
var_dump($c, $d);
}
foo();
+?>
--EXPECT--
int(2)
int(2)
var_dump($c);
}
foo();
+?>
--EXPECT--
int(2)
var_dump($b, $d);
}
foo();
+?>
--EXPECT--
array(0) {
}
}
foo();
echo "ok\n";
+?>
--EXPECTF--
Warning: Undefined variable $undef in %s on line %d
ok
}
foo();
echo "ok\n";
+?>
--EXPECTF--
Warning: Undefined variable $undef in %s on line %d
ok
}
foo();
echo "ok\n";
+?>
--EXPECTF--
Warning: Undefined variable $undef in %s on line %d
ok
}
foo();
echo "ok\n";
+?>
--EXPECTF--
Warning: Undefined variable $ref in %s on line %d
ok
}
foo();
echo "ok\n";
+?>
--EXPECT--
ok
}
foo();
echo "ok\n";
+?>
--EXPECT--
ok
return $i;
}
var_dump(foo());
+?>
--EXPECT--
int(1)
int(1)
return $i;
}
var_dump(foo());
+?>
--EXPECT--
int(2)
int(2)
return $i;
}
var_dump(foo());
+?>
--EXPECT--
int(2)
int(2)
}
}
echo "ok\n";
+?>
--EXPECT--
ok
return $a;
}
var_dump(bar());
+?>
--EXPECT--
int(2)
}
var_dump(foo5());
+?>
--EXPECTF--
array(1) {
[0]=>
var_dump($a[$x . $y]);
}
foo();
+?>
--EXPECT--
int(1)
int(3)
$x=2;
$y="x";
foo($x.$y);
+?>
--EXPECT--
int(1)
int(3)
var_dump($a[$x . $y]);
}
foo();
+?>
--EXPECTF--
string(1) "A"
string(1) "C"
$x=2;
$y="x";
foo($x.$y);
+?>
--EXPECTF--
string(1) "A"
string(1) "C"
return $a[0];
}
var_dump(foo());
+?>
--EXPECTF--
Warning: Undefined variable $a in %s on line %d
var_dump($x);
}
foo();
+?>
--EXPECT--
int(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
int(2)
return $x;
}
var_dump(foo());
+?>
--EXPECT--
int(2)
return $x;
}
var_dump(foo());
+?>
--EXPECT--
int(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
int(2)
int(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
int(2)
int(2)
return ++$x; // mem -> reg, reg
}
var_dump(foo());
+?>
--EXPECT--
int(2)
return ++$x; // reg -> reg, reg
}
var_dump(foo());
+?>
--EXPECT--
int(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
float(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
float(2)
return $x;
}
var_dump(foo());
+?>
--EXPECT--
float(2)
return $x;
}
var_dump(foo());
+?>
--EXPECT--
float(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
float(2)
float(2)
var_dump($x);
}
foo();
+?>
--EXPECT--
float(2)
float(2)
return ++$x; // mem -> reg, reg
}
var_dump(foo());
+?>
--EXPECT--
float(2)
return ++$x; // reg -> reg, reg
}
var_dump(foo());
+?>
--EXPECT--
float(2)
return ++$x; // reg -> reg, reg
}
var_dump(foo());
+?>
--EXPECT--
bool(true)
return ++$x; // reg -> reg, reg
}
var_dump(foo());
+?>
--EXPECT--
bool(false)
return $a;
}
var_dump(bar(0));
+?>
--EXPECT--
int(2)
int(3)
}
}
var_dump(Foo::bar());
+?>
--EXPECT--
string(2) "ok"
test(array(), "d:e", 222, 3434);
+?>
--EXPECT--
okey
}
var_dump(foo("int"));
var_dump(foo(["int"]));
+?>
--EXPECT--
string(32) "253a948ecc9192cb47e492f692aa63a8"
string(32) "fa7153f7ed1cb6c0fcf2ffb2fac21748"
'webserver' =>$webserver);
header('Content-Type: application/json');
echo json_encode($info) . "\n";
+?>
--EXPECT--
{"arch":"64","webserver":"Apache"}
var_dump(test($char));
}
+?>
--EXPECTF--
$_main:
; (lines=15, args=0, vars=1, tmps=2)
}
test2();
+?>
--EXPECTF--
$_main:
; (lines=5, args=0, vars=0, tmps=0)
var_dump(test($char));
}
+?>
--EXPECTF--
$_main:
; (lines=15, args=0, vars=1, tmps=2)
var_dump(test((string) $number));
}
+?>
--EXPECTF--
$_main:
; (lines=22, args=0, vars=1, tmps=2)
; (after optimizer)
- ; %s.php:1-24
+ ; %s.php:1-25
0000 INIT_FCALL 2 %d string("range")
0001 SEND_VAL int(0) 1
0002 SEND_VAL int(6) 2
$a = $y;
return $a;
}
+?>
--EXPECTF--
$_main:
; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)
- ; %sdce_004.php:1-8
+ ; %sdce_004.php:1-9
0000 RETURN int(1)
foo:
$a = new A;
$a->foo = $x;
}
+?>
--EXPECTF--
$_main:
; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)
- ; %sdce_005.php:1-8
+ ; %sdce_005.php:1-9
0000 RETURN int(1)
foo:
$a = new A;
$a->foo = $x;
}
+?>
--EXPECTF--
$_main:
; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)
- ; %sdce_006.php:1-9
+ ; %sdce_006.php:1-10
0000 RETURN int(1)
foo:
$b = [$a];
return $a;
}
+?>
--EXPECTF--
$_main:
; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)
- ; %sdce_007.php:1-7
+ ; %sdce_007.php:1-8
0000 RETURN int(1)
esc:
$b[0] = $a;
return $a;
}
+?>
--EXPECTF--
$_main:
; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)
- ; %sdce_008.php:1-7
+ ; %sdce_008.php:1-8
0000 RETURN int(1)
esc:
$b = "changed";
return "ref";
}
+?>
--EXPECTF--
Array
(
if (!is_int($info = gc_collect_cycles()) || ($info < 100)) {
echo gettype($info)."\n";
}
+?>
--EXPECT--
integer
--FILE--
<?php
var_dump(openssl_decrypt('kzo w2RMExUTYQXW2Xzxmg==', 'aes-128-cbc', 'pass', false, 'pass'));
+?>
--EXPECTF--
Warning: openssl_decrypt(): IV passed is only 4 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in %s on line %d
bool(false)
--TEST--
pcntl_unshare() with CLONE_NEWUSER
--SKIPIF--
-<?php
+<?php
if (!extension_loaded("pcntl")) die("skip");
if (!extension_loaded("posix")) die("skip posix extension not available");
if (!function_exists("pcntl_unshare")) die("skip pcntl_unshare is not available");
pcntl_unshare(CLONE_NEWUSER);
$newuid = posix_getuid();
var_dump($olduid === $newuid);
+?>
--EXPECT--
bool(false)
--TEST--
pcntl_unshare() with CLONE_NEWPID
--SKIPIF--
-<?php
+<?php
if (!extension_loaded("pcntl")) die("skip");
if (!extension_loaded("posix")) die("skip posix extension not available");
if (!function_exists("pcntl_unshare")) die("skip pcntl_unshare is not available");
var_dump(getmypid());
exit();
}
+?>
--EXPECTF--
int(%d)
int(1)
--TEST--
pcntl_unshare() with CLONE_NEWNET
--SKIPIF--
-<?php
+<?php
if (!extension_loaded("pcntl")) die("skip");
if (!extension_loaded("posix")) die("skip posix extension not available");
if (!function_exists("pcntl_unshare")) die("skip pcntl_unshare is not available");
var_dump(gethostbyname('php.net'));
pcntl_unshare(CLONE_NEWNET);
var_dump(gethostbyname('php.net'));
+?>
--EXPECTF--
string(%d) %s
string(7) "php.net"
preg_match($regex, $subject, $matches);
var_dump($matches);
+?>
--EXPECTF--
bool(false)
$a = new test('sqlite::memory:');
$a->foo();
$a->bar();
+?>
--EXPECT--
Called foo in test
Called bar in test
<?php
var_dump(is_array(PDO::getAvailableDrivers()));
var_dump(is_array(pdo_drivers()));
+?>
--EXPECT--
bool(true)
bool(true)
foreach ($db->query("SELECT * FROM test")->fetchAll(PDO::FETCH_FUNC, 'heLLO') as $row) {
var_dump($row);
}
+?>
--EXPECT--
string(1) "1"
$stmt = $db->prepare('SELECT * FROM test WHERE id = ?');
$stmt->execute($values);
var_dump($values);
+?>
--EXPECT--
array(1) {
[0]=>
var_dump($a);
var_dump($b);
+?>
--EXPECTF--
bool(true)
bool(false)
print_r($db->query("INSERT INTO test (num) VALUES (451)"));
print_r($db->lastInsertId());
+?>
--EXPECT--
PDOStatement Object
(
$db->query('THIS IS NOT VALID SQL');
print "done!\n";
+?>
--EXPECTF--
[003] Maybe PDO could indicate that this is not a proper way of setting the ERRMODE...true
var_dump($db->getAttribute(PDO::ATTR_PREFETCH));
var_dump($db->setAttribute(PDO::ATTR_PREFETCH, true));
print "done!";
+?>
--EXPECTF--
Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
bool(false)
}
print "done!";
+?>
--EXPECT--
done!
}
print "done!";
+?>
--EXPECT--
done!
}
print "done!";
+?>
--EXPECT--
done!
$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
print_r($db->query('SHOW TABLES'));
+?>
--EXPECT--
PDOStatement Object
(
$stmt->execute();
$row = $stmt->fetch();
var_dump(strlen($row[0]) > 0);
+?>
--EXPECT--
bool(true)
print $e->getMessage();
}
$db = null;
+?>
--EXPECTF--
SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view does not exist
(%s%epdo_oci%eoci_statement.c:%d)
echo 'size of stream4 is ', strlen($stream4), ' bytes, ', mb_strlen($stream4), ' chars.', PHP_EOL;
echo 'beg of stream4 is ', $start4, PHP_EOL;
echo 'end of stream4 is ', $ending4, PHP_EOL;
+?>
--XFAIL--
Fails due to Bug 60994
--EXPECT--
$rs = $db->query('select blah from a_table_that_does_not_exist');
var_dump($rs);
var_dump($db->errorInfo());
+?>
--EXPECTF--
bool(false)
array(3) {
}
$db = null;
+?>
--EXPECT--
array(2) {
["DUMMY"]=>
}
print "done!";
+?>
--EXPECT--
done!
}
echo "Finished\n";
+?>
--EXPECT--
Passed on size 32
Passed on size 53
}
echo "Finished\n";
+?>
--EXPECT--
Finished
echo $e->getCode()."\n";
}
}
+?>
--EXPECT--
Test 1
42P18
}
var_dump($resp);
+?>
--EXPECT--
object(stdClass)#2 (1) {
["entries"]=>
} else {
print_r($res->fetchAll(PDO::FETCH_ASSOC));
}
+?>
--EXPECTF--
Array
(
$stmt->bindParam(':text', $name);
$name = 'test2';
var_dump($stmt->execute(), $stmt->rowCount());
+?>
--EXPECT--
bool(true)
int(1)
$connection->query('ALTER TABLE user ADD new_col VARCHAR(255)');
$stmt->execute(['id' => 10]);
var_dump($stmt->fetchAll(\PDO::FETCH_ASSOC));
+?>
--EXPECT--
array(1) {
[0]=>
$db2 = pg_connect($conn_str, PGSQL_CONNECT_FORCE_NEW);
pg_close($db1);
var_dump(pg_ping());
+?>
--EXPECT--
bool(true)
} catch(Exception $e) {
echo $e->getMessage();
}
+?>
--EXPECTF--
internal corruption of phar "%s" (truncated manifest entry)
echo $e;
}
?>
-
--EXPECTF--
UnexpectedValueException: phar error: corrupted central directory entry, no magic signature in zip-based phar "%sbug69441.phar" in %sbug69441.php:%d
Stack trace:
echo $e;
}
?>
-
--EXPECTF--
UnexpectedValueException: phar error: "%s%ebug69453.tar.phar" is a corrupted tar file (checksum mismatch of file "") in %s:%d
Stack trace:
<?php
$tarphar = new PharData(__DIR__.'/bug69958.tar');
$phar = $tarphar->convertToData(Phar::TAR);
+?>
--EXPECTF--
Fatal error: Uncaught BadMethodCallException: phar "%s/bug69958.tar" exists and must be unlinked prior to conversion in %s/bug69958.php:%d
Stack trace:
unlink('path/needle.php');
unlink('sample.phar');
rmdir('path');
+?>
--EXPECT--
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php'); ?>
-<?php unlink(__DIR__ . '/fopen_edgetest.phar');
+<?php unlink(__DIR__ . '/fopen_edgetest.phar'); ?>
--EXPECTF--
Warning: fopen(phar://%sfopen_edgecases.phar.php/b/c.php): Failed to open stream: phar error: open mode append not supported in %sfopen_edgecases.php on line %d
--CLEAN--
<?php
rmdir(__DIR__ . '/.phar');
+?>
--EXPECT--
bool(false)
bool(false)
include __DIR__."/files/bug67761.tar/bug67761.phar";
?>
-
--EXPECT--
Test
#!/usr/bin/env php
// We currently don't have any deprecated functions :/
$rc = new ReflectionFunction('var_dump');
var_dump($rc->isDeprecated());
+?>
--EXPECT--
bool(false)
$rrt = $rm->getReturnType();
unset($rm, $rp);
var_dump($rt->getName(), $rrt->getName());
+?>
--EXPECT--
string(4) "Test"
string(5) "Test2"
}
}
echo new ReflectionClass('Test');
+?>
--EXPECTF--
Class [ <user> class Test ] {
@@ %sbug33389.php 3-18
$rc = new ReflectionClass('Foo2');
print_r($rc->getConstant('B'));
+?>
--EXPECT--
Array
(
$method = new ReflectionMethod("A::call");
$method->invoke(null);
$method->invokeArgs(null, array());
+?>
--EXPECT--
BBAA
$x = (object)array("a", "oo" => "b");
$reflObj = new ReflectionObject($x);
print_r($reflObj->getProperties(ReflectionProperty::IS_PUBLIC));
+?>
--EXPECT--
Array
(
var_dump($rBar->isTrait());
echo $rFoo;
echo $rBar;
+?>
--EXPECTF--
bool(true)
bool(false)
var_dump($r->getTraits());
echo "\n";
}
+?>
--EXPECT--
class C1:
array(0) {
print session_encode()."\n";
session_destroy();
+?>
--EXPECT--
baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}
error_reporting(E_ALL);
session_unset();
print "ok\n";
+?>
--EXPECT--
ok
var_dump($_SESSION["baz"]);
var_dump($_SESSION["arr"]);
session_destroy();
+?>
--EXPECT--
object(foo)#1 (2) {
["bar"]=>
var_dump($baz);
var_dump($arr);
session_destroy();
+?>
--EXPECT--
object(foo)#1 (2) {
["bar"]=>
unlink($sessfile);
}
rmdir($sessdir);
+?>
--EXPECT--
hello world
string(6) "100777"
<?php
session_start();
print_r(ob_list_handlers());
+?>
--EXPECT--
Array
(
session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
session_start();
+?>
--EXPECT--
8
session_start();
var_dump($_SESSION);
+?>
--EXPECT--
array(1) {
["foo"]=>
session_start();
var_dump($_SESSION);
+?>
--EXPECT--
array(1) {
["foo"]=>
var_dump($session_id === session_id());
var_dump($_SESSION['cnt']); // Should be int(2)
session_write_close();
+?>
--EXPECT--
Testing file module
bool(true)
var_dump(session_name("foo"));
var_dump(session_name("bar"));
+?>
--EXPECT--
Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0
string(9) "PHPSESSID"
session_start();
var_dump(isset($_SESSION['init']) && $data == $_SESSION['init']);
+?>
--EXPECT--
bool(true)
bool(true)
<?php
(new SessionHandler)->create_sid();
+?>
--EXPECTF--
Warning: SessionHandler::create_sid(): Session is not active in %s on line %d
var_dump(session_gc());
session_write_close();
+?>
--EXPECTF--
*** Test session_set_save_handler() : session_gc() returns the number of deleted records. ***
Open
var_dump($_SESSION);
session_destroy();
+?>
--EXPECT--
array(0) {
}
<form action="" method="post">
</form>
';
+?>
--EXPECT--
*** Testing basic session functionality : variation4 use_trans_sid ***
*** Test trans sid ***
session_write_close();
session_unset();
var_dump($handler->i);
+?>
--EXPECTF--
*** Testing session_set_save_handler() : basic class wrapping existing handler ***
Open
session_write_close();
session_unset();
+?>
--EXPECTF--
*** Testing session_set_save_handler() : full handler implementation ***
string(%d) "%s"
session_unset();
var_dump(session_id(), $_SESSION, $handler->i);
+?>
--EXPECTF--
*** Testing session_set_save_handler() : inheritance ***
array(1) {
session_write_close();
session_unset();
+?>
--EXPECTF--
*** Testing session_set_save_handler() : default object ***
string(%d) "%s"
session_write_close();
session_unset();
+?>
--EXPECTF--
*** Testing session_set_save_handler() : incomplete implementation ***
}
var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION);
+?>
--EXPECTF--
*** Testing session_set_save_handler() : incorrect arguments for existing handler open ***
Open
session_set_save_handler($handler);
session_start();
+?>
--EXPECT--
Recoverable fatal error: PHP Startup: Cannot set 'user' save handler by ini_set() or session_module_name() in Unknown on line 0
*** Testing session_set_save_handler() : calling default handler when save_handler=user ***
echo "*** Testing session_set_save_handler() : register session handler but don't start ***\n";
session_set_save_handler(new SessionHandler);
+?>
--EXPECT--
*** Testing session_set_save_handler() : register session handler but don't start ***
session_write_close();
session_unset();
+?>
--EXPECTF--
*** Testing session_set_save_handler() function: class with create_sid ***
string(%d) "%s"
--CLEAN--
<?php
@unlink(session_save_path().'/u_sess_PHPSESSIDsession_set_save_handler_class_017');
+?>
--EXPECT--
*** Testing session_set_save_handler() function: class with create_sid ***
string(34) "session_set_save_handler_class_017"
--CLEAN--
<?php
@unlink(session_save_path().'/u_sess_PHPSESSIDsession_set_save_handler_class_018');
+?>
--EXPECT--
*** Testing session_set_save_handler() function: class with validate_sid ***
string(34) "session_set_save_handler_class_018"
session_write_close();
session_unset();
+?>
--EXPECTF--
*** Testing session_set_save_handler() function: interface ***
string(%d) "%s"
}
session_start();
+?>
--EXPECT--
*** Testing session_set_save_handler() function: interface wrong ***
bool(true)
--CLEAN--
<?php
@unlink(session_save_path().'/u_sess_PHPSESSIDsession_set_save_handler_iface_003');
+?>
--EXPECT--
*** Testing session_set_save_handler() function: id interface ***
string(34) "session_set_save_handler_iface_003"
--CLEAN--
<?php
@unlink(session_save_path().'/u_sess_PHPSESSIDsession_set_save_handler_sid_001');
+?>
--EXPECT--
*** Testing session_set_save_handler() function: create_sid ***
string(32) "session_set_save_handler_sid_001"
session_write_close();
session_unset();
+?>
--EXPECTF--
*** Testing session_set_save_handler() function: create_sid ***
var_dump((string) $xml);
var_dump($xml->__toString());
+?>
--EXPECT--
string(15) "stringification"
string(15) "stringification"
setlocale(LC_ALL,"en_US","en_US.ISO8859-1");
var_dump($x->test());
echo $x->__getLastResponse();
+?>
--EXPECT--
float(123.456)
<?xml version="1.0" encoding="UTF-8"?>
$server->handle($HTTP_RAW_POST_DATA);
echo "ok\n";
ob_flush();
+?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return SOAP-ENC:arrayType="SOAP-ENC:Struct[4]" xsi:type="SOAP-ENC:Array"><item xsi:type="SOAP-ENC:Struct" id="ref1"><sName xsi:type="xsd:string">newUser</sName></item><item href="#ref1"/><item href="#ref1"/><item href="#ref1"/></return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
$server->handle($req);
ob_end_clean();
echo "ok\n";
+?>
--EXPECT--
ok
var_dump($client->test(NAN));
var_dump($response = $client->test(INF));
var_dump($response = $client->test(-INF));
+?>
--EXPECT--
float(0.1)
float(NAN)
$result = $client->echoPerson($person, $person);
print($client->__getLastRequest());
+?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:service.EchoService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoPerson><p xsi:type="ns2:Person" id="ref1"><name xsi:type="SOAP-ENC:string">name</name></p><p2 href="#ref1"/></ns1:echoPerson></SOAP-ENV:Body></SOAP-ENV:Envelope>
} catch (Exception $e) {
echo "okey";
}
+?>
--EXPECT--
okey
--FILE--
<?php
var_dump(defined('SO_REUSEPORT'));
+?>
--EXPECT--
bool(true)
socket_set_nonblock($listenfd);
$connfd = @socket_accept($listenfd);
echo socket_last_error();
+?>
--EXPECT--
10035
"interface" => 0,
));
var_dump($so);
+?>
--EXPECT--
bool(true)
socket_close($senderSocket);
unlink($senderSocketPath);
}
+?>
--EXPECT--
Received 'Ping!'
Responded to sender with 'Pong!'
}
}
+?>
--EXPECTF--
creating send socket bound to 127.0.0.1
bool(true)
$r = socket_get_option($s, $level, IP_MULTICAST_IF);
var_dump($r);
echo "\n";
+?>
--EXPECT--
Setting IP_MULTICAST_TTL
bool(true)
$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
var_dump($r);
echo "\n";
+?>
--EXPECT--
Setting IP_MULTICAST_LOOP with 256
bool(true)
}
}
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
}
}
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
$r = socket_get_option($s, $level, IPV6_MULTICAST_IF);
var_dump($r);
echo "\n";
+?>
--EXPECT--
Setting IPV6_MULTICAST_TTL
bool(true)
));
var_dump(socket_addrinfo_bind($addrinfo[0]));
echo "Done";
+?>
--EXPECT--
object(Socket)#2 (0) {
}
));
var_dump(socket_addrinfo_connect($addrinfo[0]));
echo "Done";
+?>
--EXPECT--
object(Socket)#2 (0) {
}
unset($result['ai_canonname']);
var_dump($result);
echo "Done";
+?>
--EXPECTF--
array(5) {
["ai_flags"]=>
));
var_dump($addrinfo[0]);
echo "Done";
+?>
--EXPECTF--
Notice: socket_addrinfo_lookup(): Unknown hint invalid in %ssocket_addrinfo_lookup.php on line %d
object(AddressInfo)#%d (0) {
$pid = getmypid();
var_dump($data['control'][0]['data']['pid'] === $pid);
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
echo "FAIL CONTROL\n";
var_dump($data);
}
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
--FILE--
<?php
$sock = socket_create_listen(80);
+?>
--EXPECTF--
Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
--CREDITS--
$sock = socket_create_listen(31338);
socket_getsockname($sock, $addr, $port);
var_dump($addr, $port);
+?>
--EXPECT--
string(9) "127.0.0.1"
int(31338)
$sock = socket_create_listen(31338);
socket_getsockname($sock, $addr, $port);
var_dump($addr, $port);
+?>
--EXPECT--
string(7) "0.0.0.0"
int(31338)
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
bool(true)
socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET
}
socket_create_pair($domain, SOCK_STREAM, 0, $sockets);
var_dump($sockets);
+?>
--EXPECT--
array(2) {
[0]=>
socket_close($s1);
var_dump(stream_get_contents($stream));
+?>
--EXPECTF--
resource(%d) of type (stream)
string(12) "test message"
stream_set_blocking($stream, 0);
var_dump(fread($stream, strlen($m)));
echo "Done.\n";
+?>
--EXPECTF--
resource(%d) of type (stream)
bool(true)
$stream4 = socket_export_stream($sock4);
socket_close($sock4);
test($stream4, $sock4);
+?>
--EXPECTF--
normal
stream_set_blocking 1
test($stream4, $sock4);
echo "Done.\n";
+?>
--EXPECTF--
normal
stream_set_blocking 1
zend_leak_variable($sock1);
echo "Done.\n";
+?>
--EXPECT--
Done.
socket_close($sock);
var_dump(stream_get_contents($s1));
+?>
--EXPECTF--
object(Socket)#%d (0) {
}
stream_set_blocking($stream, 0);
var_dump(fread($stream, strlen($m)));
echo "Done.\n";
+?>
--EXPECTF--
object(Socket)#%d (0) {
}
$sock4 = socket_import_stream($stream4);
socket_close($sock4);
test($stream4, $sock4);
+?>
--EXPECTF--
normal
stream_set_blocking 1
test($stream4, $sock4);
echo "Done.\n";
+?>
--EXPECTF--
normal
stream_set_blocking 1
zend_leak_variable($sock1);
echo "Done.\n";
+?>
--EXPECT--
Done.
<?php
$socket = socket_create(AF_UNIX, SOCK_STREAM, 0);
var_dump(socket_listen($socket));
+?>
--EXPECTF--
Warning: socket_listen(): unable to listen on socket [%d]: Invalid argument in %s on line %d
bool(false)
];
if (!socket_recvmsg($s, $data, 0)) die("recvmsg");
print_r($data);
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
$except = null;
$time = -1;
var_dump(socket_select($sockets, $write, $except, $time));
+?>
--EXPECT--
int(0)
--CREDITS--
$except = null;
$time = -1;
var_dump(socket_select($sockets, $write, $except, $time));
+?>
--EXPECTF--
Warning: socket_select(): Unable to select [%d]: Invalid argument in %s on line %d
bool(false)
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
+?>
--EXPECTF--
socket_select(): At least one array argument must be passed
--CREDITS--
$time = 0;
$usec = 2000000;
var_dump(socket_select($sockets, $write, $except, $time, $usec));
+?>
--EXPECT--
int(0)
--CREDITS--
$except = null;
$ref =& $sockets[0]; // bug #78038
var_dump(socket_select($sockets, $write, $except, 0));
+?>
--EXPECT--
int(0)
--CREDITS--
];
if (!socket_recvmsg($s, $data, 0)) die("recvmsg");
print_r($data);
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
];
if (!socket_recvmsg($s, $data, 0)) die("recvmsg");
print_r($data);
+?>
--EXPECTF--
creating send socket
object(Socket)#%d (0) {
echo "Received $buf from remote address $from and remote port $port" . PHP_EOL;
socket_close($socket);
+?>
--EXPECTF--
Warning: socket_recvfrom(): unable to recvfrom [10022]: %s
in %s on line %d
//A work-around with is sort-of possible (with IPV6_2292PKTOPTIONS),
//but not worth it
//var_dump(socket_get_option($s, IPPROTO_IPV6, IPV6_PKTINFO));
+?>
--EXPECTF--
Warning: socket_set_option(): error converting user data (path: in6_pktinfo): The key 'addr' is required in %s on line %d
bool(false)
var_dump($r1);
$r2 = sodium_crypto_secretstream_xchacha20poly1305_pull($stream, $c2);
var_dump($r2);
+?>
--EXPECT--
secretstream_xchacha20poly1305:
bool(true)
var_dump(sodium_crypto_pwhash_str_verify($hash, $password));
}
}
+?>
--EXPECTF--
Argon2 provider: string(%d) "%s"
Using password: string(44) "%s"
var_dump(sodium_crypto_pwhash_str_verify($hash, $password));
}
}
+?>
--EXPECTF--
Argon2 provider: string(%d) "%s"
Using password: string(44) "%s"
var_dump(password_verify($password, $hash));
}
}
+?>
--EXPECTF--
Argon2 provider: string(%d) "%s"
Using password: string(44) "%s"
} catch(Exception $e) {
echo $e->getMessage() . "\n";
}
+?>
--EXPECT--
CallbackFilterIterator::__construct() expects exactly 2 parameters, 0 given
CallbackFilterIterator::__construct() expects exactly 2 parameters, 1 given
echo "=> $value\n";
}
}
+?>
--EXPECT--
= instance method =
1 / 0 / 1 / 1
echo "=> $value\n";
}
}
+?>
--EXPECT--
= instance method =
1 / 0 / 1 / 1
}
}
echo "DONE\n";
+?>
--EXPECTF--
Error at offset 6 of 34 bytes
Error at offset 46 of 89 bytes
$so1 = unserialize($s);
var_dump($so1);
+?>
--EXPECTF--
O:16:"SplObjectStorage":2:{i:0;a:4:{i:0;O:8:"stdClass":1:{s:1:"a";O:8:"stdClass":0:{}}i:1;i:1;i:2;r:4;i:3;i:2;}i:1;a:0:{}}
object(SplObjectStorage)#4 (1) {
$o['plop'] = $o;
var_dump($o);
+?>
--EXPECTF--
object(AO)#%d (1) {
["storage":"ArrayObject":private]=>
} catch (TypeError $e) { }
var_dump($x->getPathName());
+?>
--EXPECTF--
string(%d) "%sbug46051.php"
$x->seek(10);
$x->seek(0);
var_dump(trim($x->fgets()));
+?>
--EXPECTF--
string(%d) "<?php"
$it2 = new RecursiveDirectoryIterator(__DIR__);
$it2->rewind();
echo gettype($it2->current())."\n";
+?>
--EXPECT--
string
object
<?php
$dir = new DirectoryIterator("\x00/abc");
$dir->isFile();
+?>
--EXPECTF--
Fatal error: Uncaught TypeError: DirectoryIterator::__construct(): Argument #1 ($path) must be a valid path, string given in %s:%d
Stack trace:
unset($ao['prop']);
var_dump($c->prop, $ao['prop']);
}
+?>
--EXPECTF--
Warning: Undefined property: C::$prop in %s on line %d
echo $a,"\n";
}
} );
+?>
--EXPECT--
IteratorIterator... exception (expected)
FilterIterator... exception (expected)
$o = new SplTempFileObjectChild();
$o->count();
} );
+?>
--EXPECT--
->count()... ran normally (expected)
->rewind()... ran normally (expected)
$aobj3->foo = 'bar';
var_dump($aobj1 == $aobj3);
+?>
--EXPECT--
bool(false)
bool(true)
var_dump(isset($b['no_exists'])); //false
var_dump(empty($b['b'])); //true
var_dump(empty($b[37])); //true
+?>
--EXPECT--
bool(false)
bool(false)
$obj = new ObjB(new ArrayObject());
var_dump($obj == unserialize(serialize($obj)));
+?>
--EXPECT--
bool(true)
$z = clone $x;
echo "No crash.";
+?>
--EXPECT--
No crash.
var_dump($a[$fp]);
fclose($fp);
+?>
--EXPECTF--
Warning: Undefined array key "epic_magic" in %s on line %d
NULL
// Does not work - outputs parent::__toString()
echo $a . '', "\n";
+?>
--EXPECT--
-expected- -expected- -expected-
-expected-
$node1->addChild($node2);
print_r($tree->findAll(2)->offsetGet(0));
+?>
--EXPECTF--
Node Object
(
print_r(iterator_to_array($it2));
$it2 = new \RegexIterator($it, "/^ba/", \RegexIterator::MATCH, \RegexIterator::USE_KEY | \RegexIterator::INVERT_MATCH);
print_r(iterator_to_array($it2));
+?>
--EXPECT--
Array
(
}
$it->uksort('badsort');
+?>
--EXPECTF--
Warning: Modification of ArrayObject during sorting is prohibited in %sbug67539.php on line %d
}
return $out;
}
+?>
--EXPECTF--
array(5) {
[0]=>
var_dump($obj->getTest());
$obj2 = unserialize(serialize($obj));
var_dump($obj2->getTest());
+?>
--EXPECT--
string(4) "test"
string(4) "test"
$r=new ReflectionObject($x);
var_dump($r->isCloneable());
+?>
--EXPECT--
bool(false)
echo (int)spl_autoload_unregister($loader);
}
echo (int)count(spl_autoload_functions());
+?>
--EXPECT--
11110
$it->append(new ArrayIterator(['bar']));
}
}
+?>
--EXPECT--
string(3) "foo"
string(3) "bar"
$o3->unserialize($o->serialize());
$o3['xm']=456;
var_dump($o3);
+?>
--EXPECT--
object(ArrayObject)#2 (1) {
["storage":"ArrayObject":private]=>
$map[$a] = 'foo';
var_dump($map[$b] ?? null);
var_dump($map[$a] ?? null);
+?>
--EXPECT--
NULL
string(3) "foo"
}
}
?>
-
--EXPECT--
*** Testing array_chunk() : usage variations ***
var_dump(array_column($rows, null));
echo "Done\n";
+?>
--EXPECT--
-- pass null as second parameter to get back all columns indexed by third parameter --
array(2) {
var_dump(array_uintersect_assoc($arr1, $arr2, 'too_few_parameters'));
?>
-
--EXPECT--
*** Testing array_uintersect_assoc() : usage variation - differing comparison functions***
var_dump(array_uintersect($arr1, $arr2, 'too_few_parameters'));
?>
-
--EXPECT--
*** Testing array_uintersect() : usage variation - differing comparison functions***
}
myfunc($data);
var_dump($data);
+?>
--EXPECT--
array(2) {
["key1"]=>
foreach (range("90", "100", .1) as $i => $v){
echo $i, ' = ', $v, PHP_EOL;
}
+?>
--EXPECT--
0 = 90
1 = 90.1
print_r($myArray);
+?>
--EXPECT--
int(0)
int(3)
extract($hash);
var_dump($var === $ref);
+?>
--EXPECT--
bool(true)
echo $e->getMessage();
}
?>
-
--EXPECT--
Cannot call compact() dynamically
$foo = 'changed!';
var_dump($array['foo_reference']);
+?>
--EXPECT--
string(4) "okey"
$b = array_values($a);
$b[] = 4;
print_r($b);
+?>
--EXPECT--
Array
(
$a = array('bar' => 1);
var_dump(key_exists('bar', $a));
var_dump(key_exists('foo', $a));
+?>
--EXPECT--
*** test key_exists() by calling it with its expected arguments ***
bool(true)
$a = array('bar' => 1, 'foo' => array('bar' => 2, 'baz' => 3));
var_dump(key_exists('baz', $a));
var_dump(key_exists('baz', $a['foo']));
+?>
--EXPECT--
*** test key_exists() by calling it with its expected arguments ***
bool(false)
// stream resource has index = 0, netherless its position is the latest
$i = array('foo' => 'baz', $st);
var_dump(key_exists(0, $i));
+?>
--EXPECT--
*** test key_exists() by using mixed type of arrays ***
bool(false)
print_r(array_keys($input));
print_r(array_values($input));
}
+?>
--EXPECT--
Array
(
var_dump($r2 = assert(0));
var_dump($r2 = assert(1));
+?>
--EXPECT--
f1 called
bool(false)
var_dump($rao=assert_options(ASSERT_BAIL, 1));
var_dump($r2=assert(0 != 0));
echo "If this is printed BAIL hasn't worked";
+?>
--EXPECTF--
int(0)
f1 called
echo "Initial values: ini.get(\"assert.warning\") => [".ini_get("assert.warning")."]\n";
echo "Initial values: ini.get(\"assert.bail\") => [".ini_get("assert.bail")."]\n";
echo "Initial values: ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n\n";
+?>
--EXPECT--
Initial values: assert_options(ASSERT_ACTIVE) => [0]
Initial values: assert_options(ASSERT_WARNING) => [0]
//switch warning on and test return value
var_dump($rao=assert_options(ASSERT_WARNING, 0));
+?>
--EXPECTF--
int(0)
f1 called
var_dump($rao = assert_options(ASSERT_BAIL, 1));
var_dump($r2 = assert(0 != 0));
echo "If this is printed BAIL hasn't worked";
+?>
--EXPECTF--
int(0)
f1 called
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n\n";
var_dump($r2=assert(0 != 0));
echo"\n";
+?>
--EXPECT--
Initial values: assert_options(ASSERT_CALLBACK) => [f1]
Initial values: ini.get("assert.callback") => [f1]
}
echo "\n*** Done ***\n";
+?>
--EXPECTF--
*** Testing basic operations of fopen() and fclose() functions ***
var_dump($ini['ini']);
$ini = parse_ini_string("ini=\r\niniraw", null, INI_SCANNER_RAW);
var_dump($ini['ini']);
+?>
--EXPECT--
string(7) "ini;raw"
string(4) ""ini"
zend_leak_variable(do_stuff("php://memory"));
echo "\nDone.\n";
+?>
--EXPECTF--
temp stream (close after):
About to rewind!
d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW);
var_dump($array);
+?>
--EXPECT--
array(7) {
["int"]=>
fclose($pipes[3]);
proc_close($process);
+?>
--EXPECT--
read from pipe 0: string(5) "foo
"
echo $e->getMessage(), "\n";
}
echo "\nDone.\n";
+?>
--EXPECT--
fread(): supplied resource is not a valid stream resource
var_dump( fileinode(100) );
echo "\n*** Done ***";
+?>
--EXPECTF--
*** Testing error conditions of fileinode() ***
Warning: fileinode(): stat failed for /no/such/file/dir in %s on line %d
rmdir("$file_path/dir");
echo "\n*** Done ***";
+?>
--EXPECTF--
*** Testing fileinode() with files, links and directories ***
-- Testing with files --
}
echo "Done\n";
+?>
--EXPECTF--
*** Testing filesize(): usage variations ***
*** Checking filesize() with different size of files ***
echo $e->getMessage() . \PHP_EOL;
}
+?>
--EXPECT--
*** Testing error conditions ***
-- Testing fread() with invalid length arguments --
@include "test1://hello";
echo @file_get_contents("test2://hello"),"\n";
@include "test2://hello";
+?>
--EXPECT--
<?php echo "Hello World\n";?>
<?php echo "Hello World\n";?>
@include "test1://hello";
echo @file_get_contents("test2://hello"),"\n";
include "test2://hello";
+?>
--EXPECTF--
<?php echo "Hello World\n";?>
<?php echo "Hello World\n";?>
include "test1://hello";
echo file_get_contents("test2://hello"),"\n";
include "test2://hello";
+?>
--EXPECTF--
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
var_dump( is_executable(__DIR__."/is_executable") );
echo "Done\n";
+?>
--EXPECT--
*** Testing is_exceutable() on non-existent directory ***
bool(false)
fwrite($f, "hi!");
echo "\nDone.\n";
+?>
--EXPECT--
hi!
Done.
fwrite($f, "hi!");
echo "\nDone.\n";
+?>
--EXPECT--
hi!
Done.
fopen("php://fd/1/", "w");
echo "\nDone.\n";
+?>
--EXPECTF--
Warning: fopen(): Invalid php:// URL specified in %s on line %d
fopen("php://fd/1023", "w");
echo "\nDone.\n";
+?>
--EXPECTF--
Warning: fopen(php://fd/1023): Failed to open stream: Error duping file descriptor 1023; possibly it doesn't exist: [9]: %s in %s on line %d
zend_leak_variable($s);
zend_leak_variable($t);
+?>
--EXPECT--
echo $e->getMessage() . \PHP_EOL;
}
test("stream_truncate bad return", $fd3, 0);
+?>
--EXPECTF--
bool(true)
bool(true)
var_dump(stream_set_chunk_size($fd, 42));
var_dump(fwrite($fd, str_repeat('0', 70)));
+?>
--EXPECT--
bool(true)
option: 3, 2, 50
chgrp("test://testdir/chgrp", "test");
chgrp("test://testdir/chgrp", 42);
chmod("test://testdir/chmod", 0755);
+?>
--EXPECT--
bool(true)
metadata: test://testdir/touch, 1
}
+?>
--EXPECT--
ClassInGlobal
Demo\ClassInNamespace
$x = new stdClass();
$x->{'\'\\'} = 7;
echo var_export($x);
+?>
--EXPECT--
(object) array(
'\'\\' => 7,
echo PHP_EOL;
var_export(NAN);
echo PHP_EOL;
+?>
--EXPECT--
INF
-INF
}
do_test();
+?>
--EXPECTF--
Warning: file_get_contents(http://127.0.0.1:12342/): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
in %s on line %d
TESTS;
include(__DIR__ . '/../../../../tests/quicktester.inc');
+?>
--EXPECT--
1,1,0,0
OK
echo "On failure, please mail result to php-dev@lists.php.net\n";
include(__DIR__ . '/../../../../tests/quicktester.inc');
+?>
--EXPECT--
On failure, please mail result to php-dev@lists.php.net
OK
echo "On failure, please mail result to php-dev@lists.php.net\n";
include(__DIR__ . '/../../../../tests/quicktester.inc');
+?>
--EXPECT--
1,1,0,0
On failure, please mail result to php-dev@lists.php.net
TESTS;
include(__DIR__ . '/../../../../tests/quicktester.inc');
+?>
--EXPECT--
1,1,0,0
OK
// Extra diagnostics!
var_dump($ifaces);
}
+?>
--EXPECT--
bool(true)
<?php
echo PASSWORD_DEFAULT . "\n";
echo PASSWORD_BCRYPT . "\n";
+?>
--EXPECT--
2y
2y
var_dump(password_needs_rehash($hash, PASSWORD_ARGON2ID, ['time_cost' => PASSWORD_ARGON2_DEFAULT_TIME_COST + 1]));
echo "OK!";
+?>
--EXPECT--
bool(false)
bool(true)
$str='a:2:{i:0;O:4:"test":0:{}junk';
var_dump(unserialize($str));
+?>
--EXPECT--
bool(false)
$s = str_replace("Foo", "Bar", $s);
$y = unserialize($s);
var_dump($y);
+?>
--EXPECT--
array(2) {
[0]=>
$class = unserialize(base64_decode($serialized));
var_dump($class);
+?>
--EXPECT--
object(Foo)#1 (4) {
["public"]=>
$class = unserialize(base64_decode($serialized));
var_dump($class);
+?>
--EXPECT--
object(Foo)#1 (4) {
["public":protected]=>
$class = unserialize(base64_decode($serialized));
var_dump($class);
+?>
--EXPECT--
object(Foo)#1 (4) {
["public":"Foo":private]=>
$b = unserialize(serialize($a));
var_dump(serialize($b));
var_dump($b->{0});
+?>
--EXPECT--
string(51) "O:8:"stdClass":2:{s:1:"0";s:1:"X";s:1:"1";s:1:"Y";}"
string(1) "X"
$s = serialize($a);
$u = unserialize($s);
print_r($u);
+?>
--EXPECT--
Derived Object
(
else
echo "mismatch\n\twas: $ns\n\tbecame: $repr\n";
}
+?>
--EXPECT--
number: 0.00000000000000000e+0... OK
number: 2.00000000000000010e-4... OK
$data = unserialize($str);
var_dump($data);
+?>
--EXPECT--
bool(false)
var_dump(unserialize($s, ["allowed_classes" => ["bar"]]));
var_dump(unserialize($s, ["allowed_classes" => ["FOO"]]));
var_dump(unserialize($s, ["allowed_classes" => ["bar", "foO"]]));
+?>
--EXPECTF--
array(3) {
[0]=>
var_dump(unserialize($s, ["allowed_classes" => null]));
var_dump(unserialize($s, ["allowed_classes" => 0]));
var_dump(unserialize($s, ["allowed_classes" => 1]));
+?>
--EXPECTF--
Warning: unserialize(): allowed_classes option should be array or boolean in %s on line %d
bool(false)
var_dump(unserialize($c, ["allowed_classes" => ["D"]]));
var_dump(unserialize($d, ["allowed_classes" => ["C"]]));
var_dump(unserialize($d, ["allowed_classes" => ["D"]]));
+?>
--EXPECTF--
object(C)#%d (0) {
}
echo fread($fp, 5);
}
+?>
--EXPECT--
IS A LOWERCASE STRING.
stream_select($read, $write, $except, 0);
var_dump($read);
+?>
--EXPECTF--
array(2) {
[1]=>
$s[] = 1; // Cannot use a scalar value as an array
print_r($s);
+?>
--EXPECTF--
Warning: Undefined property: sw::$undefined in %s on line %d
Array
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
+?>
--EXPECTF--
int(%d)
int(%d)
$line = stream_get_line($f, 99, "\n");
var_dump($line);
}
+?>
--EXPECT--
string(1) "a"
$line = stream_get_line($f, 99, "\n");
var_dump($line);
}
+?>
--EXPECT--
string(1) "a"
bool(false)
$line = stream_get_line($f, 99, "\n");
var_dump($line);
}
+?>
--EXPECT--
string(1) "a"
string(1) "b"
$line = stream_get_line($f, 2, "\n");
var_dump($line);
}
+?>
--EXPECT--
string(1) "a"
bool(false)
$line = stream_get_line($f, 99, "\n");
var_dump($line);
}
+?>
--EXPECT--
Read done
string(1) "a"
foreach($codes as $code) {
echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1", false, $context);
}
+?>
--EXPECT--
HELLO!
default
$dummy =& $r[0];
print stream_select($r, $w, $e, 0.5);
+?>
--EXPECT--
0
rewind($fp);
stream_get_line($fp, 1024*1024*2, "aaaa");
echo "Done\n";
+?>
--EXPECT--
Done
stream_socket_get_name($c, false)
);
unlink($sock);
+?>
--EXPECT--
bool(false)
bool(false)
}
stream_wrapper_register('e0ploit','Stream00ploiter');
$s=fopen('e0ploit://',0);
+?>
--EXPECTF--
Warning: fopen(e0ploit://): Failed to open stream: operation failed in %s%ebug74951.php on line 7
fclose($fh);
echo strlen($out) . "\n";
+?>
--EXPECT--
3
fwrite($f, str_repeat('X', 1000));
fseek($f, 0);
var_dump(strlen(stream_get_contents($f, 1024)));
+?>
--EXPECT--
int(1000)
continue;
}
}
+?>
--EXPECTF--
** Opening %s
$f = fopen("test://", "r");
var_dump(stream_get_line($f, 100, "\0"));
+?>
--EXPECT--
string(1) "a"
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
+?>
--EXPECT--
bool(true)
should return previous chunk size (8192)
stream_wrapper_register('mystream', 'FailStream');
fopen('mystream://foo', 'r');
echo 'Done';
+?>
--EXPECTF--
Fatal error: Uncaught Error: Call to undefined function _some_undefined_function() in %s%euser-stream-error.php:%d
Stack trace:
$out = fwrite(STDOUT, "Goodbye\n");
var_dump($out);
+?>
--EXPECT--
Hello
int(6)
var_dump(bin2hex(basename("a\xffb")));
echo "Done\n";
+?>
--EXPECT--
string(2) "ff"
string(6) "61ff62"
var_dump(basename("\377"));
echo "Done\n";
+?>
--EXPECTF--
string(1) "%c"
Done
check_basename( $file_path_variations );
echo "Done\n";
+?>
--EXPECT--
*** Testing possible variations in path and suffix ***
echo bin2hex(utf8_decode($t)), "\n";
}
echo "Done.\n";
+?>
--EXPECT--
413f3e42
3f22
echo html_entity_decode("'", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("'", ENT_COMPAT, 'UTF-8'), "\n";
echo html_entity_decode("'"), "\n";
+?>
--EXPECT--
array(1) {
[1]=>
ini_set('precision', $i);
echo "$i: len=", strlen(strval(-1 * pow(2, -1074))), "\n";
}
+?>
--EXPECT--
495: len=502
496: len=503
$my_var = str_repeat('A', 40);
$out = substr_replace(array(&$my_var), array(new test3), 40, 0);
var_dump($out, $my_var);
+?>
--EXPECTF--
array(1) {
[0]=>
echo htmlspecialchars('"""""""""""""""""""""""""""""""""""""""""""""',
ENT_QUOTES, 'UTF-8', false), "\n";
echo "Done.\n";
+?>
--EXPECT--
"""""""""""""""""""""""""""""""""""""""""""""
Done.
--FILE--
<?php
echo html_entity_decode('Œ', 0, 'ISO-8859-1');
+?>
--EXPECT--
Œ
//expected -30000 mod 2^32 = 4294937296, and not -30000
//because we can represent 4294937296 with our PHP int type
print_r(unpack('I', pack('L', -30000)));
+?>
--EXPECT--
Array
(
crypt("foo", '$5$'.chr(0).'abc');
crypt("foo", '$6$'.chr(0).'abc');
echo "OK!";
+?>
--EXPECT--
OK!
<?php
echo quoted_printable_encode(str_repeat("\xc4\x85", 77));
?>
-
--EXPECT--
=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=
=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=C4=85=
test('english', 3.41);
test('french', 3.41);
test('german', 3.41);
+?>
--EXPECT--
German_Germany.1252
--------------------------
print "BUG";
else
print "OKEY";
+?>
--EXPECT--
OKEY
var_dump(base64_decode("\x00", true));
var_dump(base64_decode("\x00VVVV", true));
var_dump(base64_decode("VVVV\x00", true));
+?>
--EXPECT--
bool(false)
bool(false)
var_dump(base64_decode("=*", true));
var_dump(base64_decode("VVV=", true));
var_dump(base64_decode("VVV=*", true));
+?>
--EXPECT--
bool(false)
bool(false)
--FILE--
<?php
var_dump(base64_decode("VV= =", true));
+?>
--EXPECT--
string(1) "U"
var_dump(crypt("À9234abcd", "99"));
var_dump(crypt("À1234abcd", "_01234567"));
var_dump(crypt("À9234abcd", "_01234567"));
+?>
--EXPECT--
string(13) "99PxawtsTfX56"
string(13) "99jcVcGxUZOWk"
echo html_entity_decode($ent, ENT_QUOTES, 'UTF-8'), "\n";
}
echo "Done.\n";
+?>
--EXPECT--
&
&&
echo html_entity_decode("'", ENT_QUOTES | ENT_XML1, "UTF-8"), "\n";
echo "Done.\n";
+?>
--EXPECT--
*** HTML 4.01 implicit (shouldn't decode) ***
'
}
echo "\nDone.\n";
+?>
--EXPECT--
*** HTML 4.01 ***
� NOT DECODED
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
CYRILLIC CAPITAL LETTER A: А => 80
€ => €
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
NO-BREAK SPACE:   => a0
  => a0
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
NO-BREAK SPACE:   => a0
  => a0
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
BOX DRAWINGS LIGHT HORIZONTAL: ─ => 80
€ => €
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
Special test for  (shouldn't decode):

$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
Special test for ˜ (shouldn't decode):
˜
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
+?>
--EXPECT--
Special test for  (shouldn't decode):

}
}
echo "Done.\n";
+?>
--EXPECT--
Done.
unpack("Z2", "AB\0"),
unpack("Z2", "ABC")
);
+?>
--EXPECTF--
Warning: unpack(): Type Z: not enough input, need 2, have 1 in %s on line %d
string(0) ""
var_dump(str_replace(array_keys($data), $data, "a numeric"));
var_dump($numeric);
var_dump($data['numeric']);
+?>
--EXPECT--
string(3) "b 1"
int(1)
$array = ['x' => 'property'];
$array = $closure($array, ['x'], 'a');
var_dump(str_replace(array_keys($array), $array, "x property"));
+?>
--EXPECT--
string(10) "a property"
string(10) "a property"
}
echo "Done";
+?>
--EXPECT--
*** Testing strip_tags() : usage variations ***
-- Iteration 1 --
}
echo "Done";
+?>
--EXPECT--
*** Testing strip_tags() : usage variations ***
-- Iteration 1 --
TESTS;
include(__DIR__ . '/../../../../tests/quicktester.inc');
+?>
--EXPECT--
OK
} catch (\ValueError $e) {
echo $e->getMessage() . "\n";
}
+?>
--EXPECT--
OK
wordwrap(): Argument #3 ($break) cannot be empty
--FILE--
<?php
var_dump(parse_url('//example.org'));
+?>
--EXPECT--
array(1) {
["host"]=>
<?php
var_dump(php_sapi_name());
+?>
--EXPECTF--
string(3) "c%ci"
shm_remove($s);
var_dump($s = shm_attach($key, 1024));
shm_remove($s);
+?>
--EXPECT--
object(SysvSharedMemory)#1 (0) {
}
$var4=[];
xml_parse_into_struct($var1, $var2, $var3, $var4);
var_dump($var3);
+?>
--EXPECT--
array(0) {
}
//this segfaulted before
print $dom->documentElement->firstChild->nextSibling->nodeName;
+?>
--EXPECT--
HERE
ROW
$proc->importStylesheet($xsl);
$proc->setParameter('', '', '"\'');
$proc->transformToXml($dom);
+?>
--EXPECTF--
Warning: XSLTProcessor::transformToXml(): Cannot create XPath expression (string contains both quote and double-quotes) in %s on line %d
--CREDITS--
} else {
print "OK, no file created\n";
}
+?>
--EXPECTF--
Warning: XSLTProcessor::transformToXml(): runtime error: file %s line %s element output in %s on line %d
print "\n";
print $proc->transformToXml($dom);
print "\n";
+?>
--EXPECT--
Test 4: Checking UTF8 Output
<?xml version="1.0" encoding="utf-8"?>
$proc->importStylesheet($xsl);
print "\n";
print $proc->transformToXML($dom);
+?>
--EXPECT--
Test 9: Stream Wrapper XPath-Document()
<?xml version="1.0" encoding="iso-8859-1"?>
$xml->load(__DIR__."/exslt.xml");
print $proc->transformToXml($xml);
+?>
--EXPECT--
Test 10: EXSLT Support
$xml->load(__DIR__."/exslt.xml");
print $proc->transformToXml($xml);
+?>
--EXPECT--
Test 10: EXSLT Support
return $id;
}
}
+?>
--EXPECTF--
Test 11: php:function Support
<?php
include __DIR__ .'/prepare.inc';
var_dump($proc->getParameter('', 'doesnotexist'));
+?>
--EXPECT--
bool(false)
--CREDITS--
$proc->importStylesheet($xsl);
$proc->setParameter('', 'key', 'value');
var_dump($proc->getParameter('', 'key'));
+?>
--EXPECT--
string(5) "value"
--CREDITS--
//var_dump($proc->registerPHPFunctions(array()));
//var_dump($proc->transformToXml($dom));
+?>
--EXPECT--
NULL
string(18) "This Is An Example"
var_dump($proc->registerPHPFunctions(array('strrev', 'array_key_exists')));
var_dump($proc->registerPHPFunctions(array()));
var_dump($proc->transformToXml($dom));
+?>
--EXPECT--
NULL
NULL
$proc->importStylesheet($phpfuncxsl);
var_dump($proc->registerPHPFunctions(array()));
var_dump($proc->transformToXml($dom));
+?>
--EXPECTF--
NULL
$proc->importStylesheet($phpfuncxsl);
var_dump($proc->registerPHPFunctions(array('ucwords')));
var_dump($proc->transformToXml($dom));
+?>
--EXPECT--
NULL
string(18) "This Is An Example"
$proc->importStylesheet($phpfuncxsl);
var_dump($proc->registerPHPFunctions());
var_dump($proc->transformToXml($dom));
+?>
--EXPECTF--
NULL
$proc->importStylesheet($phpfuncxsl);
var_dump($proc->registerPHPFunctions());
var_dump($proc->transformToXml($dom));
+?>
--EXPECTF--
NULL
var_dump($proc->registerPHPFunctions('ucwords'));
var_dump($proc->registerPHPFunctions(null));
var_dump($proc->transformToXml($dom));
+?>
--EXPECT--
NULL
NULL
var_dump($proc->registerPHPFunctions('ucwords'));
var_dump($proc->registerPHPFunctions('strpos'));
var_dump($proc->transformToXml($dom));
+?>
--EXPECT--
NULL
NULL
$proc->importStylesheet($phpfuncxsl);
var_dump($proc->registerPHPFunctions('strpos'));
var_dump($proc->transformToXml($dom));
+?>
--EXPECTF--
NULL
$proc->importStylesheet($phpfuncxsl);
var_dump($proc->registerPHPFunctions('ucwords'));
var_dump($proc->transformToXml($dom));
+?>
--EXPECT--
NULL
string(18) "This Is An Example"
include __DIR__ .'/prepare.inc';
$proc->importStylesheet($xsl);
var_dump($proc->removeParameter('', 'doesnotexist'));
+?>
--EXPECT--
bool(false)
--CREDITS--
$proc->setParameter('', 'key', 'value');
$proc->removeParameter('', 'key');
var_dump($proc->getParameter('', 'key'));
+?>
--EXPECT--
bool(false)
--CREDITS--
$proc->importStylesheet($xsl);
$proc->setParameter('', '', '"\'');
$proc->transformToXml($dom);
+?>
--EXPECTF--
Warning: XSLTProcessor::transformToXml(): Cannot create XPath expression (string contains both quote and double-quotes) in %s on line %d
--CREDITS--
$proc->importStylesheet($xsl);
var_dump($proc->setParameter('', array(4, 'abc')));
$proc->transformToXml($dom);
+?>
--EXPECTF--
Warning: XSLTProcessor::setParameter(): Invalid parameter array in %s on line %d
bool(false)
$zip->close();
unlink($filename);
+?>
--EXPECT--
files: 1
unlink($f);
}
rmdir("$base_path/51353_unpack");
+?>
--EXPECT--
100000
OK
$a = $zip->extractTo('teststream://test');
var_dump($a);
+?>
--EXPECTF--
Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" call failed in %s on line %d
bool(false)
var_dump(ZipArchive::CM_LZ77);
var_dump(ZipArchive::CM_WAVPACK);
var_dump(ZipArchive::CM_PPMD);
+?>
--EXPECT--
int(-1)
int(0)
<?php
@unlink(__DIR__ . '/bug64342.zip');
+?>
--EXPECTF--
%s.txt
add failed
unlink($filename);
echo "status: " . $zip->status . "\n";
echo "\n";
+?>
--EXPECT--
status: 0
$zip->close();
echo "status: " . $zip->status . "\n";
echo "\n";
+?>
--EXPECT--
status: 0
var_dump($size1);
var_dump($size9);
var_dump($size9 < $size1);
+?>
--EXPECTF--
int(%d)
int(%d)
print_r($headers1);
print_r($headers2);
print_r($headers3);
+?>
--EXPECTF--
Array
(
var_dump(getenv('TEST_PHP_EXECUTABLE'));
var_dump(PHP_BINARY);
}
+?>
--EXPECT--
done
<?php
print_r($_GET);
print_r($_POST);
+?>
--EXPECT--
Array
(
var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
+?>
--EXPECT--
string(4) "PASS"
string(4) "PASS"
var_dump(bin2hex(html_entity_decode("£", ENT_HTML5)));
var_dump(bin2hex(html_entity_decode("£", ENT_HTML5, 'cp1252')));
+?>
--EXPECT--
string(6) "cp1252"
string(0) ""
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
var_dump($_POST);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
echo join(' ', $v).PHP_EOL;
var_dump(serialize($v));
var_export($v);echo PHP_EOL;
+?>
--EXPECT--
INI
-1
<?php
header("Content-length: 200");
echo str_repeat("a", 200);
+?>
--EXPECT--
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
private const BAR = 1;
}
echo (int)defined('Foo::BAR');
+?>
--EXPECT--
0
class B extends A {
protected const publicConst = 1;
}
+?>
--EXPECTF--
Fatal error: Access level to B::publicConst must be public (as in class A) in %s on line 9
class B extends A {
private const protectedConst = 1;
}
+?>
--EXPECTF--
Fatal error: Access level to B::protectedConst must be protected (as in class A) or weaker in %s on line 9
$bar1->c = 12;
$bar1->display();
echo $bar1->mul()."\n";
+?>
--EXPECT--
This is class foo
a = 2
interface A {
protected const FOO = 10;
}
+?>
--EXPECTF--
Fatal error: Access type for interface constant A::FOO must be public in %s on line 3
interface A {
private const FOO = 10;
}
+?>
--EXPECTF--
Fatal error: Access type for interface constant A::FOO must be public in %s on line 3
if (isset($hey) || isset($yo)) {
echo "Local variables became global :(\n";
}
+?>
--EXPECT--
hey=0, 0
hey=1, -1
}
andi (3,10);
+?>
--EXPECT--
hey
blah
eval($message);
echo $i."\n";
}
+?>
--EXPECT--
hey
0
}
eval('-');
+?>
--EXPECTF--
hey, this is a regular echo'd eval()
hey, this is a function inside an eval()!
break;
endswitch;
?>
-
--EXPECT--
If: 11
While: 12346789
TESTS;
include(__DIR__ . '/../quicktester.inc');
+?>
--EXPECT--
1,1,0,0
OK
echo foo($b);
}
?>
-
--EXPECT--
1
eval("echo 'Hello'; // comment");
echo " World";
//last line comment
+?>
--EXPECT--
Hello World
}
MyClass::loadCode('file-which-does-not-exist-on-purpose.php');
+?>
--EXPECTF--
Warning: include(file-which-does-not-exist-on-purpose.php): Failed to open stream: No such file or directory in %sbug43958.php on line 5
}
print_r($arr);
+?>
--EXPECT--
Array
(
<?php
$x = 08;
+?>
--EXPECTF--
Parse error: Invalid numeric literal in %s on line 3
var_dump(0 <= $nan);
var_dump(0 > $nan);
var_dump(0 >= $nan);
+?>
--EXPECT--
** CONST
bool(false)
$a = [[$n]];
$b = [&$a];
var_dump($a === $b);
+?>
--EXPECT--
bool(false)
echo "\n---> 2. Return a value by reference -> Warning:\n";
var_dump (testReturnValByRef());
+?>
--EXPECTF--
---> 1. Return a variable by reference -> No warning:
int(1)
var_dump("\u{2603}"); // Unicode snowman
var_dump("\u{1F602}"); // FACE WITH TEARS OF JOY emoji
var_dump("\u{0000001F602}"); // Leading zeroes permitted
+?>
--EXPECT--
string(1) "a"
string(2) "ÿ"
<?php
var_dump("\u{}");
+?>
--EXPECTF--
Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d
<?php
var_dump("\u{blah");
+?>
--EXPECTF--
Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d
<?php
var_dump("\u{110000}"); // U+10FFFF + 1
+?>
--EXPECTF--
Parse error: Invalid UTF-8 codepoint escape sequence: Codepoint too large in %s on line %d
var_dump("\u");
var_dump("\u202e");
var_dump("\ufoobar");
+?>
--EXPECT--
string(2) "\u"
string(6) "\u202e"
<?php
var_dump("\u{+1F602}");
+?>
--EXPECTF--
Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d
<?php
var_dump("\u{-1F602}");
+?>
--EXPECTF--
Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d
var_dump(bin2hex("\u{D801}"));
var_dump(bin2hex("\u{DC00}"));
var_dump(bin2hex("\u{D801}\u{DC00}")); // CESU-8 encoding of U+10400
+?>
--EXPECT--
string(6) "eda081"
string(6) "edb080"
<?php
var_dump("\u{1F602 }");
+?>
--EXPECTF--
Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d
ob_start();
ob_start('ob_gzhandler');
echo "done";
+?>
--EXPECT--
done
<?php
$return = ob_get_status(true);
var_dump($return);
+?>
--EXPECT--
array(0) {
}
ob_start();
while(@ob_end_clean());
var_dump(ob_get_clean());
+?>
--EXPECT--
bool(false)
ob_start($a);
echo 'function via variable', "\n";
ob_end_flush();
+?>
--EXPECT--
CLOSURE IN VARIABLE
OBJECT IN VARIABLE
nonexistentsharedmodule
--FILE--
<?php
+?>
--EXPECTF--
Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A
--FILE--
<?php
var_dump(extension_loaded('openssl'));
+?>
--EXPECT--
bool(true)