ru_php/ext/uri/tests/018.phpt

92 lines
1.3 KiB
PHP

--TEST--
Test property mutation
--EXTENSIONS--
uri
--FILE--
<?php
$uri1 = Uri\Rfc3986\Uri::parse("https://example.com");
$uri2 = clone $uri1;
var_dump($uri1);
var_dump($uri2);
$url3 = Uri\WhatWg\Url::parse("https://example.com");
$url4 = clone $url3;
var_dump($url3);
var_dump($url4);
?>
--EXPECTF--
object(Uri\Rfc3986\Uri)#1 (%d) {
["scheme"]=>
string(5) "https"
["username"]=>
NULL
["password"]=>
NULL
["host"]=>
string(11) "example.com"
["port"]=>
NULL
["path"]=>
string(0) ""
["query"]=>
NULL
["fragment"]=>
NULL
}
object(Uri\Rfc3986\Uri)#2 (%d) {
["scheme"]=>
string(5) "https"
["username"]=>
NULL
["password"]=>
NULL
["host"]=>
string(11) "example.com"
["port"]=>
NULL
["path"]=>
string(0) ""
["query"]=>
NULL
["fragment"]=>
NULL
}
object(Uri\WhatWg\Url)#3 (%d) {
["scheme"]=>
string(5) "https"
["username"]=>
NULL
["password"]=>
NULL
["host"]=>
string(11) "example.com"
["port"]=>
NULL
["path"]=>
string(1) "/"
["query"]=>
NULL
["fragment"]=>
NULL
}
object(Uri\WhatWg\Url)#4 (%d) {
["scheme"]=>
string(5) "https"
["username"]=>
NULL
["password"]=>
NULL
["host"]=>
string(11) "example.com"
["port"]=>
NULL
["path"]=>
string(1) "/"
["query"]=>
NULL
["fragment"]=>
NULL
}