diff --git a/NEWS b/NEWS index 3d76a45011bce..c4926322db961 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,11 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.0.0RC1 +- CLI: + . Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara) +- Core: + . Fixed bug #80109 (Cannot skip arguments when extended debug is enabled). + (Nikita) 17 Sep 2020, PHP 8.0.0beta4 diff --git a/UPGRADING b/UPGRADING index 632c50618f95d..58a29ec81ccc1 100644 --- a/UPGRADING +++ b/UPGRADING @@ -598,6 +598,8 @@ PHP 8.0 UPGRADE NOTES . sem_get() will now return an SysvSemaphore object rather than a resource. Return value checks using is_resource() should be replaced with checks for `false`. + . The $auto_release parameter of sem_get() was changed to accept bool values + rather than int. - Sysvshm: . shm_attach() will now return an SysvSharedMemory object rather than a resource. @@ -786,6 +788,8 @@ PHP 8.0 UPGRADE NOTES array_diff($array, ...$excludes); // OK even if $arrays only contains a single array. array_intersect(...$arrays); + . The $flag parameter of ob_implicit_flush() was changed to accept bool + values rather than int. - Zip: . Extension updated to version 1.19.0 @@ -1029,7 +1033,7 @@ PHP 8.0 UPGRADE NOTES - MySQLi / PDO MySQL: . When mysqlnd is not used (which is the default and recommended option), - the minimum supported libmysqlclient version is now 5.1. + the minimum supported libmysqlclient version is now 5.5. . mysqli_result now implements IteratorAggregate (instead of Traversable). - PGSQL / PDO PGSQL: diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 249cd553bab53..ebced18ff3279 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -23,6 +23,8 @@ PHP 8.0 INTERNALS UPGRADE NOTES t. Signature changes u. Error Notification callbacks to replace zend_error_cb overwrite use-cases v. Removed Zend APIs + w. Renamed Zend APIs + x. ZEND_EXT_NOP no longer emitted 2. Build system changes a. Abstract @@ -367,6 +369,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES - zend_stack_is_empty() - zend_ts_hash_exists() - zend_ts_hash_index_exists() + 9. Argument void to const char* in Zend Engine 4.0: + - zend_get_op_array_extension_handle() + 10. Argument zend_extension to const char* in Zend Engine 4.0: + - zend_get_resource_handle() u. Instead of overwriting zend_error_cb extensions with debugging, monitoring use-cases catching Errors/Exceptions are strongly encouraged to use @@ -395,6 +401,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES w. The following APIs have been renamed: - _zend_ts_hash_init() to zend_ts_hash_init() + x. In COMPILE_EXTENDED_STMT mode, a ZEND_EXT_NOP opcode will no longer be + generated at the start of a function. Use the new observer APIs or hook + into zend_execute_ex instead. + ======================== 2. Build system changes ======================== diff --git a/Zend/tests/attributes/001_placement.phpt b/Zend/tests/attributes/001_placement.phpt index 7de2210460e52..518c890ef2c4a 100644 --- a/Zend/tests/attributes/001_placement.phpt +++ b/Zend/tests/attributes/001_placement.phpt @@ -41,8 +41,8 @@ $sources = [ ]; foreach ($sources as $r) { - $attr = $r->getAttributes(); - var_dump(get_class($r), count($attr)); + $attr = $r->getAttributes(); + var_dump(get_class($r), count($attr)); foreach ($attr as $a) { var_dump($a->getName(), $a->getArguments()); diff --git a/Zend/tests/attributes/003_ast_nodes.phpt b/Zend/tests/attributes/003_ast_nodes.phpt index 0177804dcc85a..854edf3d63c15 100644 --- a/Zend/tests/attributes/003_ast_nodes.phpt +++ b/Zend/tests/attributes/003_ast_nodes.phpt @@ -8,7 +8,7 @@ define('V1', strtoupper(php_sapi_name())); #[A1([V1 => V1])] class C1 { - public const BAR = 'bar'; + public const BAR = 'bar'; } $ref = new \ReflectionClass(C1::class); @@ -38,7 +38,7 @@ echo "\n"; #[A1(self::FOO, C1::BAR)] class C3 { - private const FOO = 'foo'; + private const FOO = 'foo'; } $ref = new \ReflectionClass(C3::class); @@ -62,7 +62,7 @@ echo "\n"; #[Attribute] class C5 { - public function __construct() { } + public function __construct() { } } $ref = new \ReflectionFunction(#[C5(MissingClass::SOME_CONST)] function () { }); @@ -70,15 +70,15 @@ $attr = $ref->getAttributes(); var_dump(count($attr)); try { - $attr[0]->getArguments(); + $attr[0]->getArguments(); } catch (\Error $e) { - var_dump($e->getMessage()); + var_dump($e->getMessage()); } try { - $attr[0]->newInstance(); + $attr[0]->newInstance(); } catch (\Error $e) { - var_dump($e->getMessage()); + var_dump($e->getMessage()); } ?> diff --git a/Zend/tests/attributes/005_objects.phpt b/Zend/tests/attributes/005_objects.phpt index 206d89fa10ab7..62b14181efd2e 100644 --- a/Zend/tests/attributes/005_objects.phpt +++ b/Zend/tests/attributes/005_objects.phpt @@ -6,22 +6,22 @@ Attributes can be converted into objects. #[Attribute(Attribute::TARGET_FUNCTION)] class A1 { - public string $name; - public int $ttl; - - public function __construct(string $name, int $ttl = 50) - { - $this->name = $name; - $this->ttl = $ttl; - } + public string $name; + public int $ttl; + + public function __construct(string $name, int $ttl = 50) + { + $this->name = $name; + $this->ttl = $ttl; + } } $ref = new \ReflectionFunction(#[A1('test')] function () { }); foreach ($ref->getAttributes() as $attr) { - $obj = $attr->newInstance(); + $obj = $attr->newInstance(); - var_dump(get_class($obj), $obj->name, $obj->ttl); + var_dump(get_class($obj), $obj->name, $obj->ttl); } echo "\n"; @@ -29,9 +29,9 @@ echo "\n"; $ref = new \ReflectionFunction(#[A1] function () { }); try { - $ref->getAttributes()[0]->newInstance(); + $ref->getAttributes()[0]->newInstance(); } catch (\ArgumentCountError $e) { - var_dump('ERROR 1', $e->getMessage()); + var_dump('ERROR 1', $e->getMessage()); } echo "\n"; @@ -39,9 +39,9 @@ echo "\n"; $ref = new \ReflectionFunction(#[A1([])] function () { }); try { - $ref->getAttributes()[0]->newInstance(); + $ref->getAttributes()[0]->newInstance(); } catch (\TypeError $e) { - var_dump('ERROR 2', $e->getMessage()); + var_dump('ERROR 2', $e->getMessage()); } echo "\n"; @@ -49,9 +49,9 @@ echo "\n"; $ref = new \ReflectionFunction(#[A2] function () { }); try { - $ref->getAttributes()[0]->newInstance(); + $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 3', $e->getMessage()); + var_dump('ERROR 3', $e->getMessage()); } echo "\n"; @@ -59,15 +59,15 @@ echo "\n"; #[Attribute] class A3 { - private function __construct() { } + private function __construct() { } } $ref = new \ReflectionFunction(#[A3] function () { }); try { - $ref->getAttributes()[0]->newInstance(); + $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 4', $e->getMessage()); + var_dump('ERROR 4', $e->getMessage()); } echo "\n"; @@ -78,9 +78,9 @@ class A4 { } $ref = new \ReflectionFunction(#[A4(1)] function () { }); try { - $ref->getAttributes()[0]->newInstance(); + $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 5', $e->getMessage()); + var_dump('ERROR 5', $e->getMessage()); } echo "\n"; @@ -90,9 +90,9 @@ class A5 { } $ref = new \ReflectionFunction(#[A5] function () { }); try { - $ref->getAttributes()[0]->newInstance(); + $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 6', $e->getMessage()); + var_dump('ERROR 6', $e->getMessage()); } ?> diff --git a/Zend/tests/attributes/006_filter.phpt b/Zend/tests/attributes/006_filter.phpt index 8da1ec9bde1e1..2924e6ed79826 100644 --- a/Zend/tests/attributes/006_filter.phpt +++ b/Zend/tests/attributes/006_filter.phpt @@ -55,17 +55,17 @@ echo "\n"; $ref = new \ReflectionFunction(function () { }); try { - $ref->getAttributes(A1::class, 3); + $ref->getAttributes(A1::class, 3); } catch (\Error $e) { - var_dump('ERROR 1', $e->getMessage()); + var_dump('ERROR 1', $e->getMessage()); } $ref = new \ReflectionFunction(function () { }); try { - $ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF); + $ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF); } catch (\Error $e) { - var_dump('ERROR 2', $e->getMessage()); + var_dump('ERROR 2', $e->getMessage()); } ?> diff --git a/Zend/tests/attributes/011_inheritance.phpt b/Zend/tests/attributes/011_inheritance.phpt index 36ee3fa47addf..6a589b9253d08 100644 --- a/Zend/tests/attributes/011_inheritance.phpt +++ b/Zend/tests/attributes/011_inheritance.phpt @@ -6,19 +6,19 @@ Attributes comply with inheritance rules. #[A2] class C1 { - #[A1] - public function foo() { } + #[A1] + public function foo() { } } class C2 extends C1 { - public function foo() { } + public function foo() { } } class C3 extends C1 { - #[A1] - public function bar() { } + #[A1] + public function bar() { } } $ref = new \ReflectionClass(C1::class); @@ -37,20 +37,20 @@ echo "\n"; trait T1 { - #[A2] - public $a; + #[A2] + public $a; } class C4 { - use T1; + use T1; } class C5 { - use T1; + use T1; - public $a; + public $a; } $ref = new \ReflectionClass(T1::class); diff --git a/Zend/tests/attributes/012_ast_export.phpt b/Zend/tests/attributes/012_ast_export.phpt index a9131f92d0c0b..347d1befe7f48 100644 --- a/Zend/tests/attributes/012_ast_export.phpt +++ b/Zend/tests/attributes/012_ast_export.phpt @@ -12,15 +12,15 @@ assert(0 && ($a = #[A1] #[A2] function ($a, #[A3(1)] $b) { })); assert(0 && ($a = #[A1(1, 2, 1 + 2)] fn () => 1)); assert(0 && ($a = new #[A1] class() { - #[A1]#[A2] const FOO = 'foo'; - #[A2] public $x; - #[A3] function a() { } + #[A1]#[A2] const FOO = 'foo'; + #[A2] public $x; + #[A3] function a() { } })); assert(0 && ($a = function () { - #[A1] class Test1 { } - #[A2] interface Test2 { } - #[A3] trait Test3 { } + #[A1] class Test1 { } + #[A2] interface Test2 { } + #[A3] trait Test3 { } })); ?> diff --git a/Zend/tests/attributes/013_class_scope.phpt b/Zend/tests/attributes/013_class_scope.phpt index 61dd9f594c708..ff16bb7b82258 100644 --- a/Zend/tests/attributes/013_class_scope.phpt +++ b/Zend/tests/attributes/013_class_scope.phpt @@ -6,14 +6,14 @@ Attributes make use of class scope. #[A1(self::class, self::FOO)] class C1 { - #[A1(self::class, self::FOO)] - private const FOO = 'foo'; + #[A1(self::class, self::FOO)] + private const FOO = 'foo'; - #[A1(self::class, self::FOO)] - public $a; + #[A1(self::class, self::FOO)] + public $a; - #[A1(self::class, self::FOO)] - public function bar(#[A1(self::class, self::FOO)] $p) { } + #[A1(self::class, self::FOO)] + public function bar(#[A1(self::class, self::FOO)] $p) { } } $ref = new \ReflectionClass(C1::class); @@ -27,15 +27,15 @@ echo "\n"; trait T1 { - #[A1(self::class, self::FOO)] - public function foo() { } + #[A1(self::class, self::FOO)] + public function foo() { } } class C2 { - use T1; + use T1; - private const FOO = 'bar'; + private const FOO = 'bar'; } $ref = new \ReflectionClass(C2::class); @@ -45,7 +45,7 @@ $ref = new \ReflectionClass(T1::class); $attr = $ref->getMethod('foo')->getAttributes()[0]; try { - $attr->getArguments(); + $attr->getArguments(); } catch (\Error $e) { var_dump('ERROR 1', $e->getMessage()); } @@ -54,17 +54,17 @@ echo "\n"; class C3 { - private const FOO = 'foo'; + private const FOO = 'foo'; - public static function foo() - { - return new #[A1(self::class, self::FOO)] class() { - private const FOO = 'bar'; + public static function foo() + { + return new #[A1(self::class, self::FOO)] class() { + private const FOO = 'bar'; - #[A1(self::class, self::FOO)] - public function bar() { } - }; - } + #[A1(self::class, self::FOO)] + public function bar() { } + }; + } } $ref = new \ReflectionObject(C3::foo()); diff --git a/Zend/tests/attributes/014_class_const_group.phpt b/Zend/tests/attributes/014_class_const_group.phpt index a53ed09c0abd2..9f01d013a7de1 100644 --- a/Zend/tests/attributes/014_class_const_group.phpt +++ b/Zend/tests/attributes/014_class_const_group.phpt @@ -5,8 +5,8 @@ Attributes cannot be applied to groups of class constants. class C1 { - #[A1] - public const A = 1, B = 2; + #[A1] + public const A = 1, B = 2; } ?> diff --git a/Zend/tests/attributes/015_property_group.phpt b/Zend/tests/attributes/015_property_group.phpt index 484d4154cf3a6..b84ded8c38d6d 100644 --- a/Zend/tests/attributes/015_property_group.phpt +++ b/Zend/tests/attributes/015_property_group.phpt @@ -5,8 +5,8 @@ Attributes cannot be applied to groups of properties. class C1 { - #[A1] - public $x, $y; + #[A1] + public $x, $y; } ?> diff --git a/Zend/tests/attributes/017_closure_scope.phpt b/Zend/tests/attributes/017_closure_scope.phpt index af7de8e2e828b..8c39ceede9e61 100644 --- a/Zend/tests/attributes/017_closure_scope.phpt +++ b/Zend/tests/attributes/017_closure_scope.phpt @@ -5,17 +5,17 @@ Attributes make use of closure scope. class Test1 { - private const FOO = 'bar'; + private const FOO = 'bar'; } class C1 { - private const FOO = 'foo'; + private const FOO = 'foo'; - public static function foo() - { - return #[A1(self::class, self::FOO)] function (#[A1(self::class, self::FOO)] $p) { }; - } + public static function foo() + { + return #[A1(self::class, self::FOO)] function (#[A1(self::class, self::FOO)] $p) { }; + } } $ref = new \ReflectionFunction(C1::foo()); diff --git a/Zend/tests/attributes/020_userland_attribute_validation.phpt b/Zend/tests/attributes/020_userland_attribute_validation.phpt index 14a10c39b288b..ce2acb26db161 100644 --- a/Zend/tests/attributes/020_userland_attribute_validation.phpt +++ b/Zend/tests/attributes/020_userland_attribute_validation.phpt @@ -18,9 +18,9 @@ $attr = $ref->getAttributes()[0]; var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_CLASS, $attr->isRepeated()); try { - $attr->newInstance(); + $attr->newInstance(); } catch (\Throwable $e) { - var_dump('ERROR 1', $e->getMessage()); + var_dump('ERROR 1', $e->getMessage()); } echo "\n"; @@ -30,9 +30,9 @@ $attr = $ref->getAttributes()[0]; var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_FUNCTION, $attr->isRepeated()); try { - $attr->newInstance(); + $attr->newInstance(); } catch (\Throwable $e) { - var_dump('ERROR 2', $e->getMessage()); + var_dump('ERROR 2', $e->getMessage()); } echo "\n"; diff --git a/Zend/tests/attributes/027_trailing_comma_args.phpt b/Zend/tests/attributes/027_trailing_comma_args.phpt index 226025f359c2c..96966c364de66 100644 --- a/Zend/tests/attributes/027_trailing_comma_args.phpt +++ b/Zend/tests/attributes/027_trailing_comma_args.phpt @@ -4,10 +4,10 @@ Trailing comma in attribute argument list --FILE-- diff --git a/Zend/tests/bug54268.phpt b/Zend/tests/bug54268.phpt index 1680f4ceedb8f..e4ce5c0e3a774 100644 --- a/Zend/tests/bug54268.phpt +++ b/Zend/tests/bug54268.phpt @@ -6,7 +6,7 @@ memory_limit=8M --FILE-- diff --git a/Zend/tests/bug54547.phpt b/Zend/tests/bug54547.phpt index 7cb0cf06647a4..2f6387ca26c1d 100644 --- a/Zend/tests/bug54547.phpt +++ b/Zend/tests/bug54547.phpt @@ -3,7 +3,7 @@ Bug #54547: wrong equality of string numbers near LONG_MAX with 64-bit longs --SKIPIF-- --FILE-- diff --git a/Zend/tests/bug70914.phpt b/Zend/tests/bug70914.phpt index 2ea1b91241919..b8a1c91d36338 100644 --- a/Zend/tests/bug70914.phpt +++ b/Zend/tests/bug70914.phpt @@ -3,7 +3,7 @@ Bug #70914 zend_throw_or_error() format string vulnerability --SKIPIF-- --FILE-- diff --git a/Zend/tests/bug76846.phpt b/Zend/tests/bug76846.phpt index fbef2010338cf..cd837bd860973 100644 --- a/Zend/tests/bug76846.phpt +++ b/Zend/tests/bug76846.phpt @@ -6,7 +6,7 @@ memory_limit=33M --FILE-- diff --git a/Zend/tests/bug79599.phpt b/Zend/tests/bug79599.phpt index b333f153a8cb1..57e5332431f53 100644 --- a/Zend/tests/bug79599.phpt +++ b/Zend/tests/bug79599.phpt @@ -3,23 +3,23 @@ Bug #79599 (coredump in set_error_handler) --FILE-- getMessage()); + var_dump($e->getMessage()); } try{ - test2(); + test2(); }catch(\Exception $e){ - var_dump($e->getMessage()); + var_dump($e->getMessage()); } ?> --EXPECT-- diff --git a/Zend/tests/bug80037.phpt b/Zend/tests/bug80037.phpt index 7bbe6128b3669..d6e057546b381 100644 --- a/Zend/tests/bug80037.phpt +++ b/Zend/tests/bug80037.phpt @@ -5,21 +5,21 @@ Bug #80037: Typed property must not be accessed before initialization when __get final class A { - public string $a; + public string $a; - public static function fromArray(array $props): self - { - $me = new static; - foreach ($props as $k => &$v) { - $me->{$k} = &$v; # try to remove & - } - return $me; - } + public static function fromArray(array $props): self + { + $me = new static; + foreach ($props as $k => &$v) { + $me->{$k} = &$v; # try to remove & + } + return $me; + } - public function __get($name) - { - throw new \LogicException("Property '$name' is not defined."); - } + public function __get($name) + { + throw new \LogicException("Property '$name' is not defined."); + } } var_dump(A::fromArray(['a' => 'foo'])); diff --git a/Zend/tests/dval_to_lval_32.phpt b/Zend/tests/dval_to_lval_32.phpt index 9aeea650605e5..89acf9076ad75 100644 --- a/Zend/tests/dval_to_lval_32.phpt +++ b/Zend/tests/dval_to_lval_32.phpt @@ -3,7 +3,7 @@ zend_dval_to_lval preserves low bits (32 bit long) --SKIPIF-- --FILE-- --FILE-- current()); diff --git a/Zend/tests/magic_methods_011.phpt b/Zend/tests/magic_methods_011.phpt index 5ce536ae403cb..7cd4d4bee1d26 100644 --- a/Zend/tests/magic_methods_011.phpt +++ b/Zend/tests/magic_methods_011.phpt @@ -3,7 +3,7 @@ __set first parameter should be a string when typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_012.phpt b/Zend/tests/magic_methods_012.phpt index 4ac3952c4d872..450c7b229577a 100644 --- a/Zend/tests/magic_methods_012.phpt +++ b/Zend/tests/magic_methods_012.phpt @@ -3,7 +3,7 @@ __get first parameter should be a string when typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_013.phpt b/Zend/tests/magic_methods_013.phpt index 03a4fb7ea7ffd..95614779d5666 100644 --- a/Zend/tests/magic_methods_013.phpt +++ b/Zend/tests/magic_methods_013.phpt @@ -3,7 +3,7 @@ __isset first parameter should be a string when typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_014.phpt b/Zend/tests/magic_methods_014.phpt index 783b6003dc846..8a1aa6388d851 100644 --- a/Zend/tests/magic_methods_014.phpt +++ b/Zend/tests/magic_methods_014.phpt @@ -3,7 +3,7 @@ __unset first parameter should be a string when typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_015.phpt b/Zend/tests/magic_methods_015.phpt index d5e93c9ef074e..3b7cf696182d5 100644 --- a/Zend/tests/magic_methods_015.phpt +++ b/Zend/tests/magic_methods_015.phpt @@ -3,7 +3,7 @@ __call first parameter should be a string typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_016.phpt b/Zend/tests/magic_methods_016.phpt index a0ac45e42aebf..c456afa12783e 100644 --- a/Zend/tests/magic_methods_016.phpt +++ b/Zend/tests/magic_methods_016.phpt @@ -3,7 +3,7 @@ __call second parameter should be an array when typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_017.phpt b/Zend/tests/magic_methods_017.phpt index 9afb089f311c0..0ce622712364b 100644 --- a/Zend/tests/magic_methods_017.phpt +++ b/Zend/tests/magic_methods_017.phpt @@ -3,7 +3,7 @@ __callStatic first parameter should be a string typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_018.phpt b/Zend/tests/magic_methods_018.phpt index faddd3cca11d5..914a8898082c8 100644 --- a/Zend/tests/magic_methods_018.phpt +++ b/Zend/tests/magic_methods_018.phpt @@ -3,7 +3,7 @@ __callStatic second parameter should be an array typed --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_019.phpt b/Zend/tests/magic_methods_019.phpt index 85823e6c40291..f0a5fabff29d7 100644 --- a/Zend/tests/magic_methods_019.phpt +++ b/Zend/tests/magic_methods_019.phpt @@ -3,7 +3,7 @@ __unserialize first parameter must be an array --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_020.phpt b/Zend/tests/magic_methods_020.phpt index 45e144cac793c..4efaf6fb18a82 100644 --- a/Zend/tests/magic_methods_020.phpt +++ b/Zend/tests/magic_methods_020.phpt @@ -4,7 +4,7 @@ __set_state first parameter must be an array diff --git a/Zend/tests/magic_methods_inheritance_rules.phpt b/Zend/tests/magic_methods_inheritance_rules.phpt index e91fdc7848097..6bdcafb1bfb5a 100644 --- a/Zend/tests/magic_methods_inheritance_rules.phpt +++ b/Zend/tests/magic_methods_inheritance_rules.phpt @@ -3,65 +3,65 @@ Magic Methods inheritance rules --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_inheritance_rules_non_trivial_02.phpt b/Zend/tests/magic_methods_inheritance_rules_non_trivial_02.phpt index 72c20a788532d..2835b46830952 100644 --- a/Zend/tests/magic_methods_inheritance_rules_non_trivial_02.phpt +++ b/Zend/tests/magic_methods_inheritance_rules_non_trivial_02.phpt @@ -3,15 +3,15 @@ Magic Methods inheritance rules on a non-trivial class hierarchy --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_sleep.phpt b/Zend/tests/magic_methods_sleep.phpt index 593d8fc037bf4..89baac4699d13 100644 --- a/Zend/tests/magic_methods_sleep.phpt +++ b/Zend/tests/magic_methods_sleep.phpt @@ -3,7 +3,7 @@ __sleep cannot take arguments --FILE-- --EXPECTF-- diff --git a/Zend/tests/magic_methods_wakeup.phpt b/Zend/tests/magic_methods_wakeup.phpt index f4edb33576bc5..8d72b6be866ad 100644 --- a/Zend/tests/magic_methods_wakeup.phpt +++ b/Zend/tests/magic_methods_wakeup.phpt @@ -3,7 +3,7 @@ __wakeup cannot take arguments --FILE-- --EXPECTF-- diff --git a/Zend/tests/return_types/033.phpt b/Zend/tests/return_types/033.phpt index e725465253fda..1eb5171cb08ef 100644 --- a/Zend/tests/return_types/033.phpt +++ b/Zend/tests/return_types/033.phpt @@ -3,7 +3,7 @@ __set can only declare void return --FILE-- --EXPECTF-- diff --git a/Zend/tests/return_types/034.phpt b/Zend/tests/return_types/034.phpt index 50324208cbc9a..80a57cf1e8cd2 100644 --- a/Zend/tests/return_types/034.phpt +++ b/Zend/tests/return_types/034.phpt @@ -3,7 +3,7 @@ __isset can only declare a boolean return type --FILE-- --EXPECTF-- diff --git a/Zend/tests/return_types/035.phpt b/Zend/tests/return_types/035.phpt index fa2d331f55e6e..359790b82eab8 100644 --- a/Zend/tests/return_types/035.phpt +++ b/Zend/tests/return_types/035.phpt @@ -3,7 +3,7 @@ __unset can only declare void return --FILE-- --EXPECTF-- diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 630857f26c1df..86cabf0a10d84 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -192,18 +192,10 @@ ZEND_METHOD(Closure, call) } /* }}} */ -/* {{{ Create a closure from another one and bind to another object and scope */ -ZEND_METHOD(Closure, bind) +static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, zval *scope_arg) { - zval *newthis, *zclosure, *scope_arg = NULL; - zend_closure *closure; zend_class_entry *ce, *called_scope; - - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) { - RETURN_THROWS(); - } - - closure = (zend_closure *)Z_OBJ_P(zclosure); + zend_closure *closure = (zend_closure *) Z_OBJ_P(zclosure); if (scope_arg != NULL) { /* scope argument was given */ if (Z_TYPE_P(scope_arg) == IS_OBJECT) { @@ -238,7 +230,30 @@ ZEND_METHOD(Closure, bind) zend_create_closure(return_value, &closure->func, ce, called_scope, newthis); } -/* }}} */ + +/* {{{ Create a closure from another one and bind to another object and scope */ +ZEND_METHOD(Closure, bind) +{ + zval *newthis, *zclosure, *scope_arg = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) { + RETURN_THROWS(); + } + + do_closure_bind(return_value, zclosure, newthis, scope_arg); +} + +/* {{{ Create a closure from another one and bind to another object and scope */ +ZEND_METHOD(Closure, bindTo) +{ + zval *newthis, *scope_arg = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!|z", &newthis, &scope_arg) == FAILURE) { + RETURN_THROWS(); + } + + do_closure_bind(return_value, getThis(), newthis, scope_arg); +} static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ { zend_fcall_info fci; diff --git a/Zend/zend_closures.stub.php b/Zend/zend_closures.stub.php index b7df588fe9d5a..70e555bff2dc4 100644 --- a/Zend/zend_closures.stub.php +++ b/Zend/zend_closures.stub.php @@ -9,10 +9,7 @@ private function __construct() {} /** @param object|string|null $newScope */ public static function bind(Closure $closure, ?object $newThis, $newScope = UNKNOWN): ?Closure {} - /** - * @param object|string|null $newScope - * @alias Closure::bind - */ + /** @param object|string|null $newScope */ public function bindTo(?object $newThis, $newScope = UNKNOWN): ?Closure {} public function call(object $newThis, mixed ...$arguments): mixed {} diff --git a/Zend/zend_closures_arginfo.h b/Zend/zend_closures_arginfo.h index fe3407232b84e..f09023b132d0f 100644 --- a/Zend/zend_closures_arginfo.h +++ b/Zend/zend_closures_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 124654da4652ea828875f471a2ddcc4afae147ae */ + * Stub hash: abbbe7b04323dc44b0675ad58700e996a6d7c43b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -27,6 +27,7 @@ ZEND_END_ARG_INFO() ZEND_METHOD(Closure, __construct); ZEND_METHOD(Closure, bind); +ZEND_METHOD(Closure, bindTo); ZEND_METHOD(Closure, call); ZEND_METHOD(Closure, fromCallable); @@ -34,7 +35,7 @@ ZEND_METHOD(Closure, fromCallable); static const zend_function_entry class_Closure_methods[] = { ZEND_ME(Closure, __construct, arginfo_class_Closure___construct, ZEND_ACC_PRIVATE) ZEND_ME(Closure, bind, arginfo_class_Closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_MALIAS(Closure, bindTo, bind, arginfo_class_Closure_bindTo, ZEND_ACC_PUBLIC) + ZEND_ME(Closure, bindTo, arginfo_class_Closure_bindTo, ZEND_ACC_PUBLIC) ZEND_ME(Closure, call, arginfo_class_Closure_call, ZEND_ACC_PUBLIC) ZEND_ME(Closure, fromCallable, arginfo_class_Closure_fromCallable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ZEND_FE_END diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 719e7aaffeff0..f42542c6b2611 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6936,11 +6936,6 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /* zend_oparray_context_begin(&orig_oparray_context); - if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) { - zend_op *opline_ext = zend_emit_op(NULL, ZEND_EXT_NOP, NULL, NULL); - opline_ext->lineno = decl->start_lineno; - } - { /* Push a separator to the loop variable stack */ zend_loop_var dummy_var; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 3c1931109463d..ab231f952f0ca 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -41,6 +41,7 @@ #include "zend_type_info.h" #include "zend_smart_str.h" #include "zend_observer.h" +#include "zend_system_id.h" /* Virtual current working directory support */ #include "zend_virtual_cwd.h" @@ -4452,6 +4453,7 @@ static void end_fake_frame(zend_execute_data *call, zend_execute_data *old_prev_ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *call) { zend_function *fbc = call->func; if (fbc->type == ZEND_USER_FUNCTION) { + zend_op_array *op_array = &fbc->op_array; uint32_t num_args = ZEND_CALL_NUM_ARGS(call); for (uint32_t i = 0; i < num_args; i++) { zval *arg = ZEND_CALL_VAR_NUM(call, i); @@ -4459,7 +4461,6 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal continue; } - zend_op_array *op_array = &fbc->op_array; zend_op *opline = &op_array->opcodes[i]; if (EXPECTED(opline->opcode == ZEND_RECV_INIT)) { zval *default_value = RT_CONSTANT(opline, opline->op2); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 030455a94e3a1..7572a0d8900c6 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -891,9 +891,7 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ uint32_t orig_jit_trace_num = EG(jit_trace_num); zend_init_func_execute_data(call, &func->op_array, fci->retval); - if (ZEND_OBSERVER_ENABLED) { - zend_observer_maybe_fcall_call_begin(call); - } + ZEND_OBSERVER_FCALL_BEGIN(call); zend_execute_ex(call); EG(jit_trace_num) = orig_jit_trace_num; EG(opline_before_exception) = current_opline_before_exception; diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index c44a2f3093752..1741182ba3be0 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -18,6 +18,7 @@ */ #include "zend_extensions.h" +#include "zend_system_id.h" ZEND_API zend_llist zend_extensions; ZEND_API uint32_t zend_extension_flags = 0; @@ -247,18 +248,19 @@ ZEND_API void zend_extension_dispatch_message(int message, void *arg) } -ZEND_API int zend_get_resource_handle(zend_extension *extension) +ZEND_API int zend_get_resource_handle(const char *module_name) { if (last_resource_numberresource_number = last_resource_number; + zend_add_system_entropy(module_name, "zend_get_resource_handle", &last_resource_number, sizeof(int)); return last_resource_number++; } else { return -1; } } -ZEND_API int zend_get_op_array_extension_handle(void) +ZEND_API int zend_get_op_array_extension_handle(const char *module_name) { + zend_add_system_entropy(module_name, "zend_get_op_array_extension_handle", &zend_op_array_extension_handles, sizeof(int)); return zend_op_array_extension_handles++; } diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index a26a6f9fc7e25..708a1fe02a465 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -113,8 +113,8 @@ struct _zend_extension { BEGIN_EXTERN_C() extern ZEND_API int zend_op_array_extension_handles; -ZEND_API int zend_get_resource_handle(zend_extension *extension); -ZEND_API int zend_get_op_array_extension_handle(void); +ZEND_API int zend_get_resource_handle(const char *module_name); +ZEND_API int zend_get_op_array_extension_handle(const char *module_name); ZEND_API void zend_extension_dispatch_message(int message, void *arg); END_EXTERN_C() diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index baca12f66b56d..177cf5c75d199 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -262,7 +262,7 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */ OBJ_RELEASE(&parent->std); /* Reset for resuming in finally */ generator->node.parent = NULL; - generator->node.ptr.root = generator; + generator->node.ptr.root = generator; } } @@ -859,20 +859,11 @@ ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */ if (!ZEND_OBSERVER_ENABLED) { zend_execute_ex(generator->execute_data); } else { - zend_op_array *op_array = &generator->execute_data->func->op_array; - void *observer_handlers = ZEND_OBSERVER_HANDLERS(op_array); - if (!observer_handlers) { - zend_observer_fcall_install((zend_function *)op_array); - observer_handlers = ZEND_OBSERVER_HANDLERS(op_array); - } - ZEND_ASSERT(observer_handlers); - if (observer_handlers != ZEND_OBSERVER_NOT_OBSERVED) { - zend_observe_fcall_begin(observer_handlers, generator->execute_data); - } + zend_observer_generator_resume(generator->execute_data); zend_execute_ex(generator->execute_data); if (generator->execute_data) { /* On the final return, this will be called from ZEND_GENERATOR_RETURN */ - zend_observer_maybe_fcall_call_end(generator->execute_data, &generator->value); + zend_observer_fcall_end(generator->execute_data, &generator->value); } } generator->flags &= ~ZEND_GENERATOR_CURRENTLY_RUNNING; diff --git a/Zend/zend_observer.c b/Zend/zend_observer.c index b124de5cc3699..68cf43ce66248 100644 --- a/Zend/zend_observer.c +++ b/Zend/zend_observer.c @@ -23,6 +23,21 @@ #include "zend_llist.h" #include "zend_vm.h" +#define ZEND_OBSERVER_DATA(op_array) \ + ZEND_OP_ARRAY_EXTENSION(op_array, zend_observer_fcall_op_array_extension) + +#define ZEND_OBSERVER_NOT_OBSERVED ((void *) 2) + +#define ZEND_OBSERVABLE_FN(fn_flags) \ + (!(fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE | ZEND_ACC_FAKE_CLOSURE))) + +typedef struct _zend_observer_fcall_data { + // points after the last handler + zend_observer_fcall_handlers *end; + // a variadic array using "struct hack" + zend_observer_fcall_handlers handlers[1]; +} zend_observer_fcall_data; + zend_llist zend_observers_fcall_list; zend_llist zend_observer_error_callbacks; @@ -30,18 +45,12 @@ int zend_observer_fcall_op_array_extension = -1; ZEND_TLS zend_arena *fcall_handlers_arena = NULL; -ZEND_API extern inline void zend_observer_maybe_fcall_call_begin( - zend_execute_data *execute_data); -ZEND_API extern inline void zend_observer_maybe_fcall_call_end( - zend_execute_data *execute_data, - zval *return_value); - // Call during minit/startup ONLY ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init init) { /* We don't want to get an extension handle unless an ext installs an observer */ if (!ZEND_OBSERVER_ENABLED) { zend_observer_fcall_op_array_extension = - zend_get_op_array_extension_handle(); + zend_get_op_array_extension_handle("Zend Observer"); /* ZEND_CALL_TRAMPOLINE has SPEC(OBSERVER) but zend_init_call_trampoline_op() * is called before any extensions have registered as an observer. So we @@ -80,7 +89,7 @@ ZEND_API void zend_observer_shutdown(void) { zend_llist_destroy(&zend_observer_error_callbacks); } -ZEND_API void zend_observer_fcall_install(zend_function *function) { +static void zend_observer_fcall_install(zend_function *function) { zend_llist_element *element; zend_llist *list = &zend_observers_fcall_list; zend_op_array *op_array = &function->op_array; @@ -92,11 +101,11 @@ ZEND_API void zend_observer_fcall_install(zend_function *function) { ZEND_ASSERT(function->type != ZEND_INTERNAL_FUNCTION); zend_llist handlers_list; - zend_llist_init(&handlers_list, sizeof(zend_observer_fcall), NULL, 0); + zend_llist_init(&handlers_list, sizeof(zend_observer_fcall_handlers), NULL, 0); for (element = list->head; element; element = element->next) { zend_observer_fcall_init init; memcpy(&init, element->data, sizeof init); - zend_observer_fcall handlers = init(function); + zend_observer_fcall_handlers handlers = init(function); if (handlers.begin || handlers.end) { zend_llist_add_element(&handlers_list, &handlers); } @@ -105,58 +114,97 @@ ZEND_API void zend_observer_fcall_install(zend_function *function) { ZEND_ASSERT(RUN_TIME_CACHE(op_array)); void *ext; if (handlers_list.count) { - size_t size = sizeof(zend_observer_fcall_cache) + (handlers_list.count - 1) * sizeof(zend_observer_fcall); - zend_observer_fcall_cache *cache = zend_arena_alloc(&fcall_handlers_arena, size); - zend_observer_fcall *handler = cache->handlers; + size_t size = sizeof(zend_observer_fcall_data) + (handlers_list.count - 1) * sizeof(zend_observer_fcall_handlers); + zend_observer_fcall_data *fcall_data = zend_arena_alloc(&fcall_handlers_arena, size); + zend_observer_fcall_handlers *handlers = fcall_data->handlers; for (element = handlers_list.head; element; element = element->next) { - memcpy(handler++, element->data, sizeof *handler); + memcpy(handlers++, element->data, sizeof *handlers); } - cache->end = handler; - ext = cache; + fcall_data->end = handlers; + ext = fcall_data; } else { ext = ZEND_OBSERVER_NOT_OBSERVED; } - ZEND_OBSERVER_HANDLERS(op_array) = ext; + ZEND_OBSERVER_DATA(op_array) = ext; zend_llist_destroy(&handlers_list); } -ZEND_API void zend_observe_fcall_begin( - zend_observer_fcall_cache *cache, - zend_execute_data *execute_data) +static void ZEND_FASTCALL _zend_observe_fcall_begin(zend_execute_data *execute_data) { - zend_observer_fcall *handler, *end = cache->end; - for (handler = cache->handlers; handler != end; ++handler) { - if (handler->begin) { - handler->begin(execute_data); + zend_op_array *op_array; + uint32_t fn_flags; + zend_observer_fcall_data *fcall_data; + zend_observer_fcall_handlers *handlers, *end; + + if (!ZEND_OBSERVER_ENABLED) { + return; + } + + op_array = &execute_data->func->op_array; + fn_flags = op_array->fn_flags; + + if (!ZEND_OBSERVABLE_FN(fn_flags)) { + return; + } + + fcall_data = ZEND_OBSERVER_DATA(op_array); + if (!fcall_data) { + zend_observer_fcall_install((zend_function *)op_array); + fcall_data = ZEND_OBSERVER_DATA(op_array); + } + + ZEND_ASSERT(fcall_data); + if (fcall_data == ZEND_OBSERVER_NOT_OBSERVED) { + return; + } + + end = fcall_data->end; + for (handlers = fcall_data->handlers; handlers != end; ++handlers) { + if (handlers->begin) { + handlers->begin(execute_data); } } } -ZEND_API void zend_observer_fcall_call_end_helper( - zend_execute_data *execute_data, - zval *return_value) +ZEND_API void ZEND_FASTCALL zend_observer_generator_resume(zend_execute_data *execute_data) { - zend_function *func = execute_data->func; - ZEND_ASSUME(ZEND_OBSERVABLE_FN(func->common.fn_flags)); - void *observer_handlers = ZEND_OBSERVER_HANDLERS(&func->op_array); - // TODO: Fix exceptions from generators - // ZEND_ASSERT(observer_handlers); - if (observer_handlers && observer_handlers != ZEND_OBSERVER_NOT_OBSERVED) { - zend_observer_fcall_cache *cache = observer_handlers; - zend_observe_fcall_end(cache, execute_data, return_value); + _zend_observe_fcall_begin(execute_data); +} + +ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin(zend_execute_data *execute_data) +{ + ZEND_ASSUME(execute_data->func); + if (!(execute_data->func->common.fn_flags & ZEND_ACC_GENERATOR)) { + _zend_observe_fcall_begin(execute_data); } } -ZEND_API void zend_observe_fcall_end( - zend_observer_fcall_cache *cache, +ZEND_API void ZEND_FASTCALL zend_observer_fcall_end( zend_execute_data *execute_data, zval *return_value) { - zend_observer_fcall *handler = cache->end, *end = cache->handlers; - while (handler-- != end) { - if (handler->end) { - handler->end(execute_data, return_value); + zend_function *func = execute_data->func; + zend_observer_fcall_data *fcall_data; + zend_observer_fcall_handlers *handlers, *end; + + if (!ZEND_OBSERVER_ENABLED + || !ZEND_OBSERVABLE_FN(func->common.fn_flags)) { + return; + } + + fcall_data = (zend_observer_fcall_data*)ZEND_OBSERVER_DATA(&func->op_array); + // TODO: Fix exceptions from generators + // ZEND_ASSERT(fcall_data); + if (!fcall_data || fcall_data == ZEND_OBSERVER_NOT_OBSERVED) { + return; + } + + handlers = fcall_data->end; + end = fcall_data->handlers; + while (handlers-- != end) { + if (handlers->end) { + handlers->end(execute_data, return_value); } } } diff --git a/Zend/zend_observer.h b/Zend/zend_observer.h index 0603591c53957..246a3a61be379 100644 --- a/Zend/zend_observer.h +++ b/Zend/zend_observer.h @@ -29,87 +29,47 @@ extern ZEND_API int zend_observer_fcall_op_array_extension; #define ZEND_OBSERVER_ENABLED (zend_observer_fcall_op_array_extension != -1) -#define ZEND_OBSERVER_HANDLERS(op_array) \ - ZEND_OP_ARRAY_EXTENSION(op_array, zend_observer_fcall_op_array_extension) - -#define ZEND_OBSERVER_NOT_OBSERVED ((void *) 2) - -#define ZEND_OBSERVABLE_FN(fn_flags) \ - (ZEND_OBSERVER_ENABLED && \ - !(fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE | ZEND_ACC_FAKE_CLOSURE))) - -struct zend_observer_fcall { - void (*begin)(zend_execute_data *execute_data); - void (*end)(zend_execute_data *execute_data, zval *retval); -}; -typedef struct zend_observer_fcall zend_observer_fcall; - -struct zend_observer_fcall_cache { - // points after the last handler - zend_observer_fcall *end; - // a variadic array using "struct hack" - zend_observer_fcall handlers[1]; -}; -typedef struct zend_observer_fcall_cache zend_observer_fcall_cache; +#define ZEND_OBSERVER_FCALL_BEGIN(execute_data) do { \ + if (ZEND_OBSERVER_ENABLED) { \ + zend_observer_fcall_begin(execute_data); \ + } \ + } while (0) + +#define ZEND_OBSERVER_FCALL_END(execute_data, return_value) do { \ + if (ZEND_OBSERVER_ENABLED) { \ + zend_observer_fcall_end(execute_data, return_value); \ + } \ + } while (0) + +typedef void (*zend_observer_fcall_begin_handler)(zend_execute_data *execute_data); +typedef void (*zend_observer_fcall_end_handler)(zend_execute_data *execute_data, zval *retval); + +typedef struct _zend_observer_fcall_handlers { + zend_observer_fcall_begin_handler begin; + zend_observer_fcall_end_handler end; +} zend_observer_fcall_handlers; /* If the fn should not be observed then return {NULL, NULL} */ -typedef zend_observer_fcall(*zend_observer_fcall_init)(zend_function *func); +typedef zend_observer_fcall_handlers (*zend_observer_fcall_init)(zend_function *func); // Call during minit/startup ONLY -ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init init); +ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init); ZEND_API void zend_observer_startup(void); // Called by engine before MINITs ZEND_API void zend_observer_activate(void); ZEND_API void zend_observer_deactivate(void); ZEND_API void zend_observer_shutdown(void); -ZEND_API void zend_observer_fcall_install(zend_function *function); - -ZEND_API void zend_observe_fcall_begin( - zend_observer_fcall_cache *cache, +ZEND_API void ZEND_FASTCALL zend_observer_fcall_begin( zend_execute_data *execute_data); -ZEND_API void zend_observe_fcall_end( - zend_observer_fcall_cache *cache, - zend_execute_data *execute_data, - zval *return_value); +ZEND_API void ZEND_FASTCALL zend_observer_generator_resume( + zend_execute_data *execute_data); -ZEND_API void zend_observer_fcall_call_end_helper( +ZEND_API void ZEND_FASTCALL zend_observer_fcall_end( zend_execute_data *execute_data, zval *return_value); -ZEND_API zend_always_inline void zend_observer_maybe_fcall_call_begin( - zend_execute_data *execute_data) -{ - ZEND_ASSUME(execute_data->func); - zend_op_array *op_array = &execute_data->func->op_array; - uint32_t fn_flags = op_array->fn_flags; - if (ZEND_OBSERVABLE_FN(fn_flags) && !(fn_flags & ZEND_ACC_GENERATOR)) { - void *observer_handlers = ZEND_OBSERVER_HANDLERS(op_array); - if (!observer_handlers) { - zend_observer_fcall_install((zend_function *)op_array); - observer_handlers = ZEND_OBSERVER_HANDLERS(op_array); - } - - ZEND_ASSERT(observer_handlers); - if (observer_handlers != ZEND_OBSERVER_NOT_OBSERVED) { - zend_observe_fcall_begin( - (zend_observer_fcall_cache *)observer_handlers, - execute_data); - } - } -} - -ZEND_API zend_always_inline void zend_observer_maybe_fcall_call_end( - zend_execute_data *execute_data, - zval *return_value) -{ - zend_function *func = execute_data->func; - if (ZEND_OBSERVABLE_FN(func->common.fn_flags)) { - zend_observer_fcall_call_end_helper(execute_data, return_value); - } -} - typedef void (*zend_observer_error_cb)(int type, const char *error_filename, uint32_t error_lineno, zend_string *message); ZEND_API void zend_observer_error_register(zend_observer_error_cb callback); diff --git a/Zend/zend_system_id.c b/Zend/zend_system_id.c new file mode 100644 index 0000000000000..93bca57b0c0e9 --- /dev/null +++ b/Zend/zend_system_id.c @@ -0,0 +1,91 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Sammy Kaye Powers | + | Dmitry Stogov | + +----------------------------------------------------------------------+ + */ + +#include "php.h" +#include "zend_system_id.h" +#include "zend_extensions.h" +#include "ext/standard/md5.h" +#include "ext/hash/php_hash.h" + +ZEND_API char zend_system_id[32]; + +static PHP_MD5_CTX context; +static int finalized = 0; + +ZEND_API ZEND_RESULT_CODE zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size) +{ + if (finalized == 0) { + PHP_MD5Update(&context, module_name, strlen(module_name)); + PHP_MD5Update(&context, hook_name, strlen(hook_name)); + if (size) { + PHP_MD5Update(&context, data, size); + } + return SUCCESS; + } + return FAILURE; +} + +#define ZEND_BIN_ID "BIN_" ZEND_TOSTR(SIZEOF_INT) ZEND_TOSTR(SIZEOF_LONG) ZEND_TOSTR(SIZEOF_SIZE_T) ZEND_TOSTR(SIZEOF_ZEND_LONG) ZEND_TOSTR(ZEND_MM_ALIGNMENT) + +void zend_startup_system_id(void) +{ + PHP_MD5Init(&context); + PHP_MD5Update(&context, PHP_VERSION, sizeof(PHP_VERSION)-1); + PHP_MD5Update(&context, ZEND_EXTENSION_BUILD_ID, sizeof(ZEND_EXTENSION_BUILD_ID)-1); + PHP_MD5Update(&context, ZEND_BIN_ID, sizeof(ZEND_BIN_ID)-1); + if (strstr(PHP_VERSION, "-dev") != 0) { + /* Development versions may be changed from build to build */ + PHP_MD5Update(&context, __DATE__, sizeof(__DATE__)-1); + PHP_MD5Update(&context, __TIME__, sizeof(__TIME__)-1); + } + zend_system_id[0] = '\0'; +} + +#define ZEND_HOOK_AST_PROCESS (1 << 0) +#define ZEND_HOOK_COMPILE_FILE (1 << 1) +#define ZEND_HOOK_EXECUTE_EX (1 << 2) +#define ZEND_HOOK_EXECUTE_INTERNAL (1 << 3) + +void zend_finalize_system_id(void) +{ + unsigned char digest[16]; + zend_uchar hooks = 0; + + if (zend_ast_process) { + hooks |= ZEND_HOOK_AST_PROCESS; + } + if (zend_compile_file != compile_file) { + hooks |= ZEND_HOOK_COMPILE_FILE; + } + if (zend_execute_ex != execute_ex) { + hooks |= ZEND_HOOK_EXECUTE_EX; + } + if (zend_execute_internal) { + hooks |= ZEND_HOOK_EXECUTE_INTERNAL; + } + PHP_MD5Update(&context, &hooks, sizeof hooks); + + for (int16_t i = 0; i < 256; i++) { + if (zend_get_user_opcode_handler((zend_uchar) i) != NULL) { + PHP_MD5Update(&context, &i, sizeof i); + } + } + + PHP_MD5Final(digest, &context); + php_hash_bin2hex(zend_system_id, digest, sizeof digest); + finalized = 1; +} diff --git a/Zend/zend_system_id.h b/Zend/zend_system_id.h new file mode 100644 index 0000000000000..cea111e6234e2 --- /dev/null +++ b/Zend/zend_system_id.h @@ -0,0 +1,30 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Sammy Kaye Powers | + +----------------------------------------------------------------------+ +*/ + +#ifndef ZEND_SYSTEM_ID_H +#define ZEND_SYSTEM_ID_H + +BEGIN_EXTERN_C() +/* True global; Write-only during MINIT/startup */ +extern ZEND_API char zend_system_id[32]; + +ZEND_API ZEND_RESULT_CODE zend_add_system_entropy(const char *module_name, const char *hook_name, const void *data, size_t size); +END_EXTERN_C() + +void zend_startup_system_id(void); +void zend_finalize_system_id(void); + +#endif /* ZEND_SYSTEM_ID_H */ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 59a49cb4131ab..510595b7c8668 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3956,7 +3956,7 @@ ZEND_VM_HOT_HANDLER(130, ZEND_DO_UCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) call->prev_execute_data = execute_data; execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - OBSERVER_FCALL_BEGIN_HANDLERS(execute_data); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); LOAD_OPLINE_EX(); ZEND_VM_ENTER_EX(); @@ -3981,13 +3981,16 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL,OBSERVER)) call->prev_execute_data = execute_data; execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - OBSERVER_FCALL_BEGIN_HANDLERS(execute_data); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); LOAD_OPLINE_EX(); ZEND_VM_ENTER_EX(); } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (ZEND_OBSERVER_ENABLED) { + ret = NULL; + } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); @@ -4072,7 +4075,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) call->prev_execute_data = execute_data; execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); - OBSERVER_FCALL_BEGIN_HANDLERS(execute_data); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); if (EXPECTED(zend_execute_ex == execute_ex)) { LOAD_OPLINE_EX(); @@ -4087,6 +4090,9 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER)) } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (ZEND_OBSERVER_ENABLED) { + ret = NULL; + } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); @@ -4290,7 +4296,7 @@ ZEND_VM_INLINE_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY, SPEC(OBSERVER)) } } } - OBSERVER_FCALL_END_HANDLERS(execute_data, return_value); + ZEND_OBSERVER_FCALL_END(execute_data, return_value); ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } @@ -4351,7 +4357,7 @@ ZEND_VM_COLD_CONST_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY, SRC, FREE_OP1_VAR_PTR(); } while (0); - OBSERVER_FCALL_END_HANDLERS(execute_data, EX(return_value)); + ZEND_OBSERVER_FCALL_END(execute_data, EX(return_value)); ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } @@ -4467,7 +4473,7 @@ ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, CONST|TMP|VAR|CV, ANY, SPEC(OBSERVER } } - OBSERVER_FCALL_END_HANDLERS(generator->execute_data, &generator->retval); + ZEND_OBSERVER_FCALL_END(generator->execute_data, &generator->retval); /* Close the generator to free up resources */ zend_generator_close(generator, 1); @@ -6185,7 +6191,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY, EVAL, SPEC(OBSER call->prev_execute_data = execute_data; i_init_code_execute_data(call, new_op_array, return_value); - OBSERVER_FCALL_BEGIN_HANDLERS(call); + ZEND_OBSERVER_FCALL_BEGIN(call); if (EXPECTED(zend_execute_ex == execute_ex)) { FREE_OP1(); ZEND_VM_ENTER(); @@ -7725,7 +7731,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY, SPEC(OBSERVER)) } } - OBSERVER_FCALL_END_HANDLERS(execute_data, EX(return_value)); + ZEND_OBSERVER_FCALL_END(execute_data, EX(return_value)); cleanup_unfinished_calls(execute_data, throw_op_num); if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) { @@ -8487,7 +8493,7 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY, SPEC(OBSERVER)) } execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - OBSERVER_FCALL_BEGIN_HANDLERS(execute_data); + ZEND_OBSERVER_FCALL_BEGIN(execute_data); if (EXPECTED(zend_execute_ex == execute_ex)) { LOAD_OPLINE_EX(); ZEND_VM_ENTER_EX(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0b1795f3eee30..f59c923bd1613 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1380,7 +1380,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETV ZEND_VM_ENTER_EX(); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_execute_data *call = EX(call); @@ -1391,38 +1391,14 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RET EX(call) = call->prev_execute_data; ret = NULL; - if (0) { - ret = EX_VAR(opline->result.var); - } - - call->prev_execute_data = execute_data; - execute_data = call; - i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); - LOAD_OPLINE_EX(); - - ZEND_VM_ENTER_EX(); -} - -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_execute_data *call = EX(call); - zend_function *fbc = call->func; - zval *ret; - - SAVE_OPLINE(); - EX(call) = call->prev_execute_data; - - ret = NULL; - if (1) { + if (RETURN_VALUE_USED(opline)) { ret = EX_VAR(opline->result.var); } call->prev_execute_data = execute_data; execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); + zend_observer_fcall_begin(execute_data); LOAD_OPLINE_EX(); ZEND_VM_ENTER_EX(); @@ -1454,6 +1430,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); @@ -1545,6 +1524,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); @@ -1610,7 +1592,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S ZEND_VM_CONTINUE(); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_execute_data *call = EX(call); @@ -1622,117 +1604,29 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_ if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { ret = NULL; - if (0) { + if (RETURN_VALUE_USED(opline)) { ret = EX_VAR(opline->result.var); } call->prev_execute_data = execute_data; execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); + zend_observer_fcall_begin(execute_data); LOAD_OPLINE_EX(); ZEND_VM_ENTER_EX(); } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); - - if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { - zend_deprecated_function(fbc); - if (UNEXPECTED(EG(exception) != NULL)) { - UNDEF_RESULT(); - if (!0) { - ret = &retval; - ZVAL_UNDEF(ret); - } - goto fcall_by_name_end; - } - } - - call->prev_execute_data = execute_data; - EG(current_execute_data) = call; - -#if ZEND_DEBUG - zend_bool should_throw = zend_internal_call_should_throw(fbc, call); -#endif - - ret = 0 ? EX_VAR(opline->result.var) : &retval; - ZVAL_NULL(ret); - - fbc->internal_function.handler(call, ret); - -#if ZEND_DEBUG - if (!EG(exception) && call->func) { - if (should_throw) { - zend_internal_call_arginfo_violation(call->func); - } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); - ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) - ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); - } -#endif - - EG(current_execute_data) = execute_data; - -fcall_by_name_end: - zend_vm_stack_free_args(call); - - uint32_t call_info = ZEND_CALL_INFO(call); - if (UNEXPECTED(call_info & (ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_ALLOCATED))) { - if (call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) { - zend_free_extra_named_params(call->extra_named_params); - } - zend_vm_stack_free_call_frame_ex(call_info, call); - } else { - EG(vm_stack_top) = (zval*)call; - } - - if (!0) { - i_zval_ptr_dtor(ret); - } - } - - if (UNEXPECTED(EG(exception) != NULL)) { - zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); - } - ZEND_VM_SET_OPCODE(opline + 1); - ZEND_VM_CONTINUE(); -} - -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_execute_data *call = EX(call); - zend_function *fbc = call->func; - zval *ret; - - SAVE_OPLINE(); - EX(call) = call->prev_execute_data; - - if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { - ret = NULL; if (1) { - ret = EX_VAR(opline->result.var); + ret = NULL; } - call->prev_execute_data = execute_data; - execute_data = call; - i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); - LOAD_OPLINE_EX(); - - ZEND_VM_ENTER_EX(); - } else { - zval retval; - ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); - if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); if (UNEXPECTED(EG(exception) != NULL)) { UNDEF_RESULT(); - if (!1) { + if (!RETURN_VALUE_USED(opline)) { ret = &retval; ZVAL_UNDEF(ret); } @@ -1747,7 +1641,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_ zend_bool should_throw = zend_internal_call_should_throw(fbc, call); #endif - ret = 1 ? EX_VAR(opline->result.var) : &retval; + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; ZVAL_NULL(ret); fbc->internal_function.handler(call, ret); @@ -1779,7 +1673,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_ EG(vm_stack_top) = (zval*)call; } - if (!1) { + if (!RETURN_VALUE_USED(opline)) { i_zval_ptr_dtor(ret); } } @@ -1825,6 +1719,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); @@ -1927,6 +1824,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); + if (0) { + ret = NULL; + } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); @@ -1996,7 +1896,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV ZEND_VM_CONTINUE(); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_execute_data *call = EX(call); @@ -2008,14 +1908,14 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RET if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { ret = NULL; - if (0) { + if (RETURN_VALUE_USED(opline)) { ret = EX_VAR(opline->result.var); } call->prev_execute_data = execute_data; execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); + zend_observer_fcall_begin(execute_data); if (EXPECTED(zend_execute_ex == execute_ex)) { LOAD_OPLINE_EX(); @@ -2030,115 +1930,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RET } else { zval retval; ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); - - if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { - zend_deprecated_function(fbc); - if (UNEXPECTED(EG(exception) != NULL)) { - UNDEF_RESULT(); - if (!0) { - ret = &retval; - ZVAL_UNDEF(ret); - } - goto fcall_end; - } - } - - call->prev_execute_data = execute_data; - EG(current_execute_data) = call; - -#if ZEND_DEBUG - zend_bool should_throw = zend_internal_call_should_throw(fbc, call); -#endif - - ret = 0 ? EX_VAR(opline->result.var) : &retval; - ZVAL_NULL(ret); - - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(call, ret); - } else { - zend_execute_internal(call, ret); - } - -#if ZEND_DEBUG - if (!EG(exception) && call->func) { - if (should_throw) { - zend_internal_call_arginfo_violation(call->func); - } - ZEND_ASSERT(!(call->func->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - zend_verify_internal_return_type(call->func, ret)); - ZEND_ASSERT((call->func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) - ? Z_ISREF_P(ret) : !Z_ISREF_P(ret)); - } -#endif - - EG(current_execute_data) = execute_data; - -fcall_end: - zend_vm_stack_free_args(call); - if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) { - zend_free_extra_named_params(call->extra_named_params); - } - - if (!0) { - i_zval_ptr_dtor(ret); - } - } - - if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS)) { - OBJ_RELEASE(Z_OBJ(call->This)); - } - - zend_vm_stack_free_call_frame(call); - if (UNEXPECTED(EG(exception) != NULL)) { - zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); - } - - ZEND_VM_SET_OPCODE(opline + 1); - ZEND_VM_CONTINUE(); -} - -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_execute_data *call = EX(call); - zend_function *fbc = call->func; - zval *ret; - - SAVE_OPLINE(); - EX(call) = call->prev_execute_data; - - if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { - ret = NULL; if (1) { - ret = EX_VAR(opline->result.var); - } - - call->prev_execute_data = execute_data; - execute_data = call; - i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); - - if (EXPECTED(zend_execute_ex == execute_ex)) { - LOAD_OPLINE_EX(); - ZEND_VM_ENTER_EX(); - } else { - SAVE_OPLINE_EX(); - execute_data = EX(prev_execute_data); - LOAD_OPLINE(); - ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); - zend_execute_ex(call); + ret = NULL; } - } else { - zval retval; - ZEND_ASSERT(fbc->type == ZEND_INTERNAL_FUNCTION); if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_deprecated_function(fbc); if (UNEXPECTED(EG(exception) != NULL)) { UNDEF_RESULT(); - if (!1) { + if (!RETURN_VALUE_USED(opline)) { ret = &retval; ZVAL_UNDEF(ret); } @@ -2153,7 +1953,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RET zend_bool should_throw = zend_internal_call_should_throw(fbc, call); #endif - ret = 1 ? EX_VAR(opline->result.var) : &retval; + ret = RETURN_VALUE_USED(opline) ? EX_VAR(opline->result.var) : &retval; ZVAL_NULL(ret); if (!zend_execute_internal) { @@ -2183,7 +1983,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RET zend_free_extra_named_params(call->extra_named_params); } - if (!1) { + if (!RETURN_VALUE_USED(opline)) { i_zval_ptr_dtor(ret); } } @@ -3191,7 +2991,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_OBSERVER } } - zend_observer_maybe_fcall_call_end(execute_data, EX(return_value)); + zend_observer_fcall_end(execute_data, EX(return_value)); cleanup_unfinished_calls(execute_data, throw_op_num); if (throw_op->result_type & (IS_VAR | IS_TMP_VAR)) { @@ -3522,7 +3322,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER_ } execute_data = call; i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); - zend_observer_maybe_fcall_call_begin(execute_data); + zend_observer_fcall_begin(execute_data); if (EXPECTED(zend_execute_ex == execute_ex)) { LOAD_OPLINE_EX(); ZEND_VM_ENTER_EX(); @@ -4324,36 +4124,36 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_ ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zval *retval_ptr; zval *return_value; - retval_ptr = RT_CONSTANT(opline, opline->op1); + retval_ptr = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R); return_value = EX(return_value); - if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { SAVE_OPLINE(); retval_ptr = ZVAL_UNDEFINED_OP1(); if (return_value) { ZVAL_NULL(return_value); } } else if (!return_value) { - if (IS_CONST & (IS_VAR|IS_TMP_VAR)) { + if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { SAVE_OPLINE(); rc_dtor_func(Z_COUNTED_P(retval_ptr)); } } } else { - if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_CONST == IS_CONST) { + if (opline->op1_type == IS_CONST) { if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { Z_ADDREF_P(return_value); } } - } else if (IS_CONST == IS_CV) { + } else if (opline->op1_type == IS_CV) { do { if (Z_OPT_REFCOUNTED_P(retval_ptr)) { if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { @@ -4377,7 +4177,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST } ZVAL_COPY_VALUE(return_value, retval_ptr); } while (0); - } else /* if (IS_CONST == IS_VAR) */ { + } else /* if (opline->op1_type == IS_VAR) */ { if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { zend_refcounted *ref = Z_COUNTED_P(retval_ptr); @@ -4393,7 +4193,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST } } } - zend_observer_maybe_fcall_call_end(execute_data, return_value); + zend_observer_fcall_end(execute_data, return_value); ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } @@ -4456,7 +4256,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zval *retval_ptr; @@ -4464,38 +4264,38 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE SAVE_OPLINE(); do { - if ((IS_CONST & (IS_CONST|IS_TMP_VAR)) || - (IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR)) || + (opline->op1_type == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); - retval_ptr = RT_CONSTANT(opline, opline->op1); + retval_ptr = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); if (!EX(return_value)) { - + FREE_OP(opline->op1_type, opline->op1.var); } else { - if (IS_CONST == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { + if (opline->op1_type == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { ZVAL_COPY_VALUE(EX(return_value), retval_ptr); break; } ZVAL_NEW_REF(EX(return_value), retval_ptr); - if (IS_CONST == IS_CONST) { + if (opline->op1_type == IS_CONST) { Z_TRY_ADDREF_P(retval_ptr); } } break; } - retval_ptr = NULL; + retval_ptr = get_zval_ptr_ptr(opline->op1_type, opline->op1, BP_VAR_W); - if (IS_CONST == IS_VAR) { + if (opline->op1_type == IS_VAR) { ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { zend_error(E_NOTICE, "Only variable references should be returned by reference"); if (EX(return_value)) { ZVAL_NEW_REF(EX(return_value), retval_ptr); } else { - + if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));}; } break; } @@ -4510,9 +4310,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPE ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr)); } + if (opline->op1_type == IS_VAR) {zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));}; } while (0); - zend_observer_maybe_fcall_call_end(execute_data, EX(return_value)); + zend_observer_fcall_end(execute_data, EX(return_value)); ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } @@ -4559,7 +4360,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HA ZEND_VM_RETURN(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zval *retval; @@ -4567,19 +4368,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_OB zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); SAVE_OPLINE(); - retval = RT_CONSTANT(opline, opline->op1); + retval = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); /* Copy return value into generator->retval */ - if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR))) { ZVAL_COPY_VALUE(&generator->retval, retval); - if (IS_CONST == IS_CONST) { + if (opline->op1_type == IS_CONST) { if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { Z_ADDREF(generator->retval); } } - } else if (IS_CONST == IS_CV) { + } else if (opline->op1_type == IS_CV) { ZVAL_COPY_DEREF(&generator->retval, retval); - } else /* if (IS_CONST == IS_VAR) */ { + } else /* if (opline->op1_type == IS_VAR) */ { if (UNEXPECTED(Z_ISREF_P(retval))) { zend_refcounted *ref = Z_COUNTED_P(retval); @@ -4595,7 +4396,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_OB } } - zend_observer_maybe_fcall_call_end(generator->execute_data, &generator->retval); + zend_observer_fcall_end(generator->execute_data, &generator->retval); /* Close the generator to free up resources */ zend_generator_close(generator, 1); @@ -4955,17 +4756,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HAN ZEND_VM_NEXT_OPCODE(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE zend_op_array *new_op_array; zval *inc_filename; SAVE_OPLINE(); - inc_filename = RT_CONSTANT(opline, opline->op1); + inc_filename = get_zval_ptr(opline->op1_type, opline->op1, BP_VAR_R); new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); if (UNEXPECTED(EG(exception) != NULL)) { - + FREE_OP(opline->op1_type, opline->op1.var); if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { destroy_op_array(new_op_array); efree_size(new_op_array, sizeof(zend_op_array)); @@ -4999,9 +4800,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBS call->prev_execute_data = execute_data; i_init_code_execute_data(call, new_op_array, return_value); - zend_observer_maybe_fcall_call_begin(call); + zend_observer_fcall_begin(call); if (EXPECTED(zend_execute_ex == execute_ex)) { - + FREE_OP(opline->op1_type, opline->op1.var); ZEND_VM_ENTER(); } else { ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); @@ -5013,14 +4814,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBS efree_size(new_op_array, sizeof(zend_op_array)); if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - + FREE_OP(opline->op1_type, opline->op1.var); UNDEF_RESULT(); HANDLE_EXCEPTION(); } } else if (RETURN_VALUE_USED(opline)) { ZVAL_FALSE(EX_VAR(opline->result.var)); } - + FREE_OP(opline->op1_type, opline->op1.var); ZEND_VM_NEXT_OPCODE(); } @@ -14514,75 +14315,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HA ZEND_VM_NEXT_OPCODE(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_op_array *new_op_array; - zval *inc_filename; - - SAVE_OPLINE(); - inc_filename = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); - new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); - if (UNEXPECTED(EG(exception) != NULL)) { - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { - destroy_op_array(new_op_array); - efree_size(new_op_array, sizeof(zend_op_array)); - } - UNDEF_RESULT(); - HANDLE_EXCEPTION(); - } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { - if (RETURN_VALUE_USED(opline)) { - ZVAL_TRUE(EX_VAR(opline->result.var)); - } - } else if (EXPECTED(new_op_array != NULL)) { - zval *return_value = NULL; - zend_execute_data *call; - - if (RETURN_VALUE_USED(opline)) { - return_value = EX_VAR(opline->result.var); - } - - new_op_array->scope = EX(func)->op_array.scope; - - call = zend_vm_stack_push_call_frame( - (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, - (zend_function*)new_op_array, 0, - Z_PTR(EX(This))); - - if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { - call->symbol_table = EX(symbol_table); - } else { - call->symbol_table = zend_rebuild_symbol_table(); - } - - call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value); - zend_observer_maybe_fcall_call_begin(call); - if (EXPECTED(zend_execute_ex == execute_ex)) { - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - ZEND_VM_ENTER(); - } else { - ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); - zend_execute_ex(call); - zend_vm_stack_free_call_frame(call); - } - - destroy_op_array(new_op_array); - efree_size(new_op_array, sizeof(zend_op_array)); - if (UNEXPECTED(EG(exception) != NULL)) { - zend_rethrow_exception(execute_data); - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - UNDEF_RESULT(); - HANDLE_EXCEPTION(); - } - } else if (RETURN_VALUE_USED(opline)) { - ZVAL_FALSE(EX_VAR(opline->result.var)); - } - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - ZEND_VM_NEXT_OPCODE(); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -18887,79 +18619,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); - return_value = EX(return_value); - if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_TMP_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_TMP_VAR == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_TMP_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); - ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -19019,66 +18678,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval_ptr; - - SAVE_OPLINE(); - - do { - if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR)) || - (IS_TMP_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - - retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); - if (!EX(return_value)) { - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - } else { - if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { - ZVAL_COPY_VALUE(EX(return_value), retval_ptr); - break; - } - - ZVAL_NEW_REF(EX(return_value), retval_ptr); - if (IS_TMP_VAR == IS_CONST) { - Z_TRY_ADDREF_P(retval_ptr); - } - } - break; - } - - retval_ptr = NULL; - - if (IS_TMP_VAR == IS_VAR) { - ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); - if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - if (EX(return_value)) { - ZVAL_NEW_REF(EX(return_value), retval_ptr); - } else { - - } - break; - } - } - - if (EX(return_value)) { - if (Z_ISREF_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } else { - ZVAL_MAKE_REF_EX(retval_ptr, 2); - } - ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr)); - } - - } while (0); - - zend_observer_maybe_fcall_call_end(execute_data, EX(return_value)); - ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -19122,51 +18721,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_HAND ZEND_VM_RETURN(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval; - - zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); - - SAVE_OPLINE(); - retval = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); - - /* Copy return value into generator->retval */ - if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(&generator->retval, retval); - if (IS_TMP_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { - Z_ADDREF(generator->retval); - } - } - } else if (IS_TMP_VAR == IS_CV) { - ZVAL_COPY_DEREF(&generator->retval, retval); - } else /* if (IS_TMP_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_refcounted *ref = Z_COUNTED_P(retval); - - retval = Z_REFVAL_P(retval); - ZVAL_COPY_VALUE(&generator->retval, retval); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval)) { - Z_ADDREF_P(retval); - } - } else { - ZVAL_COPY_VALUE(&generator->retval, retval); - } - } - - zend_observer_maybe_fcall_call_end(generator->execute_data, &generator->retval); - - /* Close the generator to free up resources */ - zend_generator_close(generator, 1); - - /* Pass execution back to handling code */ - ZEND_VM_RETURN(); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -21612,79 +21166,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); - return_value = EX(return_value); - if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_VAR & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_VAR == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); - ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -21745,67 +21226,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval_ptr; - - SAVE_OPLINE(); - - do { - if ((IS_VAR & (IS_CONST|IS_TMP_VAR)) || - (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - - retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); - if (!EX(return_value)) { - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - } else { - if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { - ZVAL_COPY_VALUE(EX(return_value), retval_ptr); - break; - } - - ZVAL_NEW_REF(EX(return_value), retval_ptr); - if (IS_VAR == IS_CONST) { - Z_TRY_ADDREF_P(retval_ptr); - } - } - break; - } - - retval_ptr = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); - - if (IS_VAR == IS_VAR) { - ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); - if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - if (EX(return_value)) { - ZVAL_NEW_REF(EX(return_value), retval_ptr); - } else { - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - } - break; - } - } - - if (EX(return_value)) { - if (Z_ISREF_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } else { - ZVAL_MAKE_REF_EX(retval_ptr, 2); - } - ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr)); - } - - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - } while (0); - - zend_observer_maybe_fcall_call_end(execute_data, EX(return_value)); - ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -21849,51 +21269,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_HAND ZEND_VM_RETURN(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval; - - zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); - - SAVE_OPLINE(); - retval = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); - - /* Copy return value into generator->retval */ - if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(&generator->retval, retval); - if (IS_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { - Z_ADDREF(generator->retval); - } - } - } else if (IS_VAR == IS_CV) { - ZVAL_COPY_DEREF(&generator->retval, retval); - } else /* if (IS_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_refcounted *ref = Z_COUNTED_P(retval); - - retval = Z_REFVAL_P(retval); - ZVAL_COPY_VALUE(&generator->retval, retval); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval)) { - Z_ADDREF_P(retval); - } - } else { - ZVAL_COPY_VALUE(&generator->retval, retval); - } - } - - zend_observer_maybe_fcall_call_end(generator->execute_data, &generator->retval); - - /* Close the generator to free up resources */ - zend_generator_close(generator, 1); - - /* Pass execution back to handling code */ - ZEND_VM_RETURN(); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -38304,79 +37679,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = EX_VAR(opline->op1.var); - return_value = EX(return_value); - if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_CV & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_CV == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_CV == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_CV == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); - ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -38436,66 +37738,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER( ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); } -static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval_ptr; - - SAVE_OPLINE(); - - do { - if ((IS_CV & (IS_CONST|IS_TMP_VAR)) || - (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - - retval_ptr = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); - if (!EX(return_value)) { - - } else { - if (IS_CV == IS_VAR && UNEXPECTED(Z_ISREF_P(retval_ptr))) { - ZVAL_COPY_VALUE(EX(return_value), retval_ptr); - break; - } - - ZVAL_NEW_REF(EX(return_value), retval_ptr); - if (IS_CV == IS_CONST) { - Z_TRY_ADDREF_P(retval_ptr); - } - } - break; - } - - retval_ptr = _get_zval_ptr_cv_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC); - - if (IS_CV == IS_VAR) { - ZEND_ASSERT(retval_ptr != &EG(uninitialized_zval)); - if (opline->extended_value == ZEND_RETURNS_FUNCTION && !Z_ISREF_P(retval_ptr)) { - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - if (EX(return_value)) { - ZVAL_NEW_REF(EX(return_value), retval_ptr); - } else { - - } - break; - } - } - - if (EX(return_value)) { - if (Z_ISREF_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } else { - ZVAL_MAKE_REF_EX(retval_ptr, 2); - } - ZVAL_REF(EX(return_value), Z_REF_P(retval_ptr)); - } - - } while (0); - - zend_observer_maybe_fcall_call_end(execute_data, EX(return_value)); - ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -38539,51 +37781,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_HANDL ZEND_VM_RETURN(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zval *retval; - - zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C); - - SAVE_OPLINE(); - retval = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); - - /* Copy return value into generator->retval */ - if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(&generator->retval, retval); - if (IS_CV == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->retval))) { - Z_ADDREF(generator->retval); - } - } - } else if (IS_CV == IS_CV) { - ZVAL_COPY_DEREF(&generator->retval, retval); - } else /* if (IS_CV == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_refcounted *ref = Z_COUNTED_P(retval); - - retval = Z_REFVAL_P(retval); - ZVAL_COPY_VALUE(&generator->retval, retval); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval)) { - Z_ADDREF_P(retval); - } - } else { - ZVAL_COPY_VALUE(&generator->retval, retval); - } - } - - zend_observer_maybe_fcall_call_end(generator->execute_data, &generator->retval); - - /* Close the generator to free up resources */ - zend_generator_close(generator, 1); - - /* Pass execution back to handling code */ - ZEND_VM_RETURN(); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -38884,75 +38081,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLE ZEND_VM_NEXT_OPCODE(); } -static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_op_array *new_op_array; - zval *inc_filename; - - SAVE_OPLINE(); - inc_filename = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC); - new_op_array = zend_include_or_eval(inc_filename, opline->extended_value); - if (UNEXPECTED(EG(exception) != NULL)) { - - if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) { - destroy_op_array(new_op_array); - efree_size(new_op_array, sizeof(zend_op_array)); - } - UNDEF_RESULT(); - HANDLE_EXCEPTION(); - } else if (new_op_array == ZEND_FAKE_OP_ARRAY) { - if (RETURN_VALUE_USED(opline)) { - ZVAL_TRUE(EX_VAR(opline->result.var)); - } - } else if (EXPECTED(new_op_array != NULL)) { - zval *return_value = NULL; - zend_execute_data *call; - - if (RETURN_VALUE_USED(opline)) { - return_value = EX_VAR(opline->result.var); - } - - new_op_array->scope = EX(func)->op_array.scope; - - call = zend_vm_stack_push_call_frame( - (Z_TYPE_INFO(EX(This)) & ZEND_CALL_HAS_THIS) | ZEND_CALL_NESTED_CODE | ZEND_CALL_HAS_SYMBOL_TABLE, - (zend_function*)new_op_array, 0, - Z_PTR(EX(This))); - - if (EX_CALL_INFO() & ZEND_CALL_HAS_SYMBOL_TABLE) { - call->symbol_table = EX(symbol_table); - } else { - call->symbol_table = zend_rebuild_symbol_table(); - } - - call->prev_execute_data = execute_data; - i_init_code_execute_data(call, new_op_array, return_value); - zend_observer_maybe_fcall_call_begin(call); - if (EXPECTED(zend_execute_ex == execute_ex)) { - - ZEND_VM_ENTER(); - } else { - ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); - zend_execute_ex(call); - zend_vm_stack_free_call_frame(call); - } - - destroy_op_array(new_op_array); - efree_size(new_op_array, sizeof(zend_op_array)); - if (UNEXPECTED(EG(exception) != NULL)) { - zend_rethrow_exception(execute_data); - - UNDEF_RESULT(); - HANDLE_EXCEPTION(); - } - } else if (RETURN_VALUE_USED(opline)) { - ZVAL_FALSE(EX_VAR(opline->result.var)); - } - - ZEND_VM_NEXT_OPCODE(); -} - static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -53004,19 +52132,19 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_LABEL, (void*)&&ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_LABEL, (void*)&&ZEND_DO_FCALL_SPEC_RETVAL_USED_LABEL, - (void*)&&ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER_LABEL, - (void*)&&ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_SPEC_OBSERVER_LABEL, (void*)&&ZEND_INIT_FCALL_SPEC_CONST_LABEL, (void*)&&ZEND_RETURN_SPEC_CONST_LABEL, - (void*)&&ZEND_RETURN_SPEC_CONST_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_RETURN_SPEC_TMP_LABEL, - (void*)&&ZEND_RETURN_SPEC_TMP_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_RETURN_SPEC_VAR_LABEL, - (void*)&&ZEND_RETURN_SPEC_VAR_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_RETURN_SPEC_CV_LABEL, - (void*)&&ZEND_RETURN_SPEC_CV_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_RECV_SPEC_UNUSED_LABEL, (void*)&&ZEND_RECV_INIT_SPEC_CONST_LABEL, (void*)&&ZEND_SEND_VAL_SPEC_CONST_CONST_LABEL, @@ -53177,15 +52305,15 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_LABEL, (void*)&&ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_LABEL, (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_CONST_LABEL, - (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_LABEL, - (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_LABEL, - (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_CV_LABEL, - (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER_LABEL, + (void*)&&ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_LABEL, (void*)&&ZEND_UNSET_VAR_SPEC_CONST_UNUSED_LABEL, (void*)&&ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_LABEL, (void*)&&ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_LABEL, @@ -53641,15 +52769,15 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_CLONE_SPEC_UNUSED_LABEL, (void*)&&ZEND_CLONE_SPEC_CV_LABEL, (void*)&&ZEND_RETURN_BY_REF_SPEC_CONST_LABEL, - (void*)&&ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, (void*)&&ZEND_RETURN_BY_REF_SPEC_TMP_LABEL, - (void*)&&ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, (void*)&&ZEND_RETURN_BY_REF_SPEC_VAR_LABEL, - (void*)&&ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_RETURN_BY_REF_SPEC_CV_LABEL, - (void*)&&ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER_LABEL, + (void*)&&ZEND_RETURN_BY_REF_SPEC_OBSERVER_LABEL, (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_LABEL, (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_LABEL, (void*)&&ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_LABEL, @@ -53848,12 +52976,12 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_DO_ICALL_SPEC_RETVAL_USED_LABEL, (void*)&&ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_LABEL, (void*)&&ZEND_DO_UCALL_SPEC_RETVAL_USED_LABEL, - (void*)&&ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER_LABEL, - (void*)&&ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER_LABEL, + (void*)&&ZEND_DO_UCALL_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_UCALL_SPEC_OBSERVER_LABEL, (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_LABEL, (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_LABEL, - (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER_LABEL, - (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_LABEL, + (void*)&&ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, @@ -54025,15 +53153,15 @@ ZEND_API void execute_ex(zend_execute_data *ex) (void*)&&ZEND_YIELD_SPEC_CV_UNUSED_LABEL, (void*)&&ZEND_YIELD_SPEC_CV_CV_LABEL, (void*)&&ZEND_GENERATOR_RETURN_SPEC_CONST_LABEL, - (void*)&&ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_GENERATOR_RETURN_SPEC_TMP_LABEL, - (void*)&&ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_GENERATOR_RETURN_SPEC_VAR_LABEL, - (void*)&&ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_NULL_LABEL, (void*)&&ZEND_GENERATOR_RETURN_SPEC_CV_LABEL, - (void*)&&ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER_LABEL, + (void*)&&ZEND_GENERATOR_RETURN_SPEC_OBSERVER_LABEL, (void*)&&ZEND_FAST_CALL_SPEC_LABEL, (void*)&&ZEND_FAST_RET_SPEC_LABEL, (void*)&&ZEND_RECV_VARIADIC_SPEC_UNUSED_LABEL, @@ -55330,13 +54458,9 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_DO_UCALL_SPEC_RETVAL_USED) ZEND_DO_UCALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER): - VM_TRACE(ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER) - ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); - HYBRID_CASE(ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER): - VM_TRACE(ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER) - ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_CASE(ZEND_DO_UCALL_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_UCALL_SPEC_OBSERVER) + ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED): VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED) @@ -55346,13 +54470,9 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED) ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER): - VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER) - ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); - HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER): - VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER) - ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_CASE(ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER) + ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); HYBRID_CASE(ZEND_DO_FCALL_SPEC_RETVAL_UNUSED): VM_TRACE(ZEND_DO_FCALL_SPEC_RETVAL_UNUSED) @@ -55362,13 +54482,9 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_DO_FCALL_SPEC_RETVAL_USED) ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER): - VM_TRACE(ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER) - ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); - HYBRID_CASE(ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER): - VM_TRACE(ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER) - ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_CASE(ZEND_DO_FCALL_SPEC_OBSERVER): + VM_TRACE(ZEND_DO_FCALL_SPEC_OBSERVER) + ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); HYBRID_CASE(ZEND_GENERATOR_CREATE_SPEC): VM_TRACE(ZEND_GENERATOR_CREATE_SPEC) @@ -55616,81 +54732,81 @@ ZEND_API void execute_ex(zend_execute_data *ex) } } } - - goto zend_leave_helper_SPEC_LABEL; -} - - HYBRID_CASE(ZEND_RETURN_SPEC_CONST_OBSERVER): - VM_TRACE(ZEND_RETURN_SPEC_CONST_OBSERVER) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = RT_CONSTANT(opline, opline->op1); - return_value = EX(return_value); - if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_CONST & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_CONST == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_CONST == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_CONST == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); + + goto zend_leave_helper_SPEC_LABEL; +} + + HYBRID_CASE(ZEND_RETURN_SPEC_OBSERVER): + VM_TRACE(ZEND_RETURN_SPEC_OBSERVER) +{ + USE_OPLINE + zval *retval_ptr; + zval *return_value; + + retval_ptr = get_zval_ptr_undef(opline->op1_type, opline->op1, BP_VAR_R); + return_value = EX(return_value); + if (opline->op1_type == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { + SAVE_OPLINE(); + retval_ptr = ZVAL_UNDEFINED_OP1(); + if (return_value) { + ZVAL_NULL(return_value); + } + } else if (!return_value) { + if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { + if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { + SAVE_OPLINE(); + rc_dtor_func(Z_COUNTED_P(retval_ptr)); + } + } + } else { + if ((opline->op1_type & (IS_CONST|IS_TMP_VAR))) { + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (opline->op1_type == IS_CONST) { + if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { + Z_ADDREF_P(return_value); + } + } + } else if (opline->op1_type == IS_CV) { + do { + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { + if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (GC_MAY_LEAK(ref)) { + gc_possible_root(ref); + } + ZVAL_NULL(retval_ptr); + break; + } else { + Z_ADDREF_P(retval_ptr); + } + } else { + retval_ptr = Z_REFVAL_P(retval_ptr); + if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } + } + ZVAL_COPY_VALUE(return_value, retval_ptr); + } while (0); + } else /* if (opline->op1_type == IS_VAR) */ { + if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { + zend_refcounted *ref = Z_COUNTED_P(retval_ptr); + + retval_ptr = Z_REFVAL_P(retval_ptr); + ZVAL_COPY_VALUE(return_value, retval_ptr); + if (UNEXPECTED(GC_DELREF(ref) == 0)) { + efree_size(ref, sizeof(zend_reference)); + } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { + Z_ADDREF_P(retval_ptr); + } + } else { + ZVAL_COPY_VALUE(return_value, retval_ptr); + } + } + } + zend_observer_fcall_end(execute_data, return_value); goto zend_leave_helper_SPEC_LABEL; } @@ -55698,17 +54814,17 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_RETURN_BY_REF_SPEC_CONST) ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER): - VM_TRACE(ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER) - ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_OBSERVER): + VM_TRACE(ZEND_RETURN_BY_REF_SPEC_OBSERVER) + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_CONST): VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_CONST) ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER): - VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER) - ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_OBSERVER): + VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_OBSERVER) + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); HYBRID_CASE(ZEND_THROW_SPEC_CONST): VM_TRACE(ZEND_THROW_SPEC_CONST) @@ -55738,9 +54854,9 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_CONST) ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER): - VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER) - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER): + VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); HYBRID_CASE(ZEND_FE_RESET_R_SPEC_CONST): VM_TRACE(ZEND_FE_RESET_R_SPEC_CONST) @@ -56842,10 +55958,6 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR) ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER): - VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER) - ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_YIELD_FROM_SPEC_TMPVAR): VM_TRACE(ZEND_YIELD_FROM_SPEC_TMPVAR) ZEND_YIELD_FROM_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -57229,80 +56341,6 @@ ZEND_API void execute_ex(zend_execute_data *ex) } } - goto zend_leave_helper_SPEC_LABEL; -} - - HYBRID_CASE(ZEND_RETURN_SPEC_TMP_OBSERVER): - VM_TRACE(ZEND_RETURN_SPEC_TMP_OBSERVER) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = _get_zval_ptr_tmp(opline->op1.var EXECUTE_DATA_CC); - return_value = EX(return_value); - if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_TMP_VAR & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_TMP_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_TMP_VAR == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_TMP_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); goto zend_leave_helper_SPEC_LABEL; } @@ -57310,18 +56348,10 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_RETURN_BY_REF_SPEC_TMP) ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER): - VM_TRACE(ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER) - ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_TMP): VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_TMP) ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER): - VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER) - ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_SEND_USER_SPEC_TMP): VM_TRACE(ZEND_SEND_USER_SPEC_TMP) ZEND_SEND_USER_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -57609,80 +56639,6 @@ ZEND_API void execute_ex(zend_execute_data *ex) } } - goto zend_leave_helper_SPEC_LABEL; -} - - HYBRID_CASE(ZEND_RETURN_SPEC_VAR_OBSERVER): - VM_TRACE(ZEND_RETURN_SPEC_VAR_OBSERVER) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); - return_value = EX(return_value); - if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_VAR & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_VAR & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_VAR == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_VAR == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_VAR == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); goto zend_leave_helper_SPEC_LABEL; } @@ -57690,18 +56646,10 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_RETURN_BY_REF_SPEC_VAR) ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER): - VM_TRACE(ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER) - ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_VAR): VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_VAR) ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER): - VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER) - ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_SEND_USER_SPEC_VAR): VM_TRACE(ZEND_SEND_USER_SPEC_VAR) ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -58805,80 +57753,6 @@ ZEND_API void execute_ex(zend_execute_data *ex) } } - goto zend_leave_helper_SPEC_LABEL; -} - - HYBRID_CASE(ZEND_RETURN_SPEC_CV_OBSERVER): - VM_TRACE(ZEND_RETURN_SPEC_CV_OBSERVER) -{ - USE_OPLINE - zval *retval_ptr; - zval *return_value; - - retval_ptr = EX_VAR(opline->op1.var); - return_value = EX(return_value); - if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) { - SAVE_OPLINE(); - retval_ptr = ZVAL_UNDEFINED_OP1(); - if (return_value) { - ZVAL_NULL(return_value); - } - } else if (!return_value) { - if (IS_CV & (IS_VAR|IS_TMP_VAR)) { - if (Z_REFCOUNTED_P(retval_ptr) && !Z_DELREF_P(retval_ptr)) { - SAVE_OPLINE(); - rc_dtor_func(Z_COUNTED_P(retval_ptr)); - } - } - } else { - if ((IS_CV & (IS_CONST|IS_TMP_VAR))) { - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (IS_CV == IS_CONST) { - if (UNEXPECTED(Z_OPT_REFCOUNTED_P(return_value))) { - Z_ADDREF_P(return_value); - } - } - } else if (IS_CV == IS_CV) { - do { - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) { - if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (GC_MAY_LEAK(ref)) { - gc_possible_root(ref); - } - ZVAL_NULL(retval_ptr); - break; - } else { - Z_ADDREF_P(retval_ptr); - } - } else { - retval_ptr = Z_REFVAL_P(retval_ptr); - if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } - } - ZVAL_COPY_VALUE(return_value, retval_ptr); - } while (0); - } else /* if (IS_CV == IS_VAR) */ { - if (UNEXPECTED(Z_ISREF_P(retval_ptr))) { - zend_refcounted *ref = Z_COUNTED_P(retval_ptr); - - retval_ptr = Z_REFVAL_P(retval_ptr); - ZVAL_COPY_VALUE(return_value, retval_ptr); - if (UNEXPECTED(GC_DELREF(ref) == 0)) { - efree_size(ref, sizeof(zend_reference)); - } else if (Z_OPT_REFCOUNTED_P(retval_ptr)) { - Z_ADDREF_P(retval_ptr); - } - } else { - ZVAL_COPY_VALUE(return_value, retval_ptr); - } - } - } - zend_observer_maybe_fcall_call_end(execute_data, return_value); goto zend_leave_helper_SPEC_LABEL; } @@ -58886,18 +57760,10 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_RETURN_BY_REF_SPEC_CV) ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER): - VM_TRACE(ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER) - ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_CV): VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_CV) ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER): - VM_TRACE(ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER) - ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_THROW_SPEC_CV): VM_TRACE(ZEND_THROW_SPEC_CV) ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -58922,10 +57788,6 @@ ZEND_API void execute_ex(zend_execute_data *ex) VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_CV) ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); HYBRID_BREAK(); - HYBRID_CASE(ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER): - VM_TRACE(ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER) - ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - HYBRID_BREAK(); HYBRID_CASE(ZEND_FE_RESET_R_SPEC_CV): VM_TRACE(ZEND_FE_RESET_R_SPEC_CV) ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -59920,9 +58782,7 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value) } EX(prev_execute_data) = EG(current_execute_data); i_init_code_execute_data(execute_data, op_array, return_value); - if (ZEND_OBSERVER_ENABLED) { - zend_observer_maybe_fcall_call_begin(execute_data); - } + ZEND_OBSERVER_FCALL_BEGIN(execute_data); zend_execute_ex(execute_data); /* Observer end handlers are called from ZEND_RETURN */ zend_vm_stack_free_call_frame(execute_data); @@ -61284,19 +60144,19 @@ void zend_vm_init(void) ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER, ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER, - ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER, - ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER_HANDLER, + ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER, ZEND_INIT_FCALL_SPEC_CONST_HANDLER, ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_OBSERVER_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_OBSERVER_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_OBSERVER_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_OBSERVER_HANDLER, + ZEND_RETURN_SPEC_OBSERVER_HANDLER, ZEND_RECV_SPEC_UNUSED_HANDLER, ZEND_RECV_INIT_SPEC_CONST_HANDLER, ZEND_SEND_VAL_SPEC_CONST_CONST_HANDLER, @@ -61457,15 +60317,15 @@ void zend_vm_init(void) ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER, ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER_HANDLER, + ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER_HANDLER, ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER, ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER, ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_HANDLER, @@ -61921,15 +60781,15 @@ void zend_vm_init(void) ZEND_CLONE_SPEC_UNUSED_HANDLER, ZEND_CLONE_SPEC_CV_HANDLER, ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER, - ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER, - ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER, - ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_RETURN_BY_REF_SPEC_CV_HANDLER, - ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER_HANDLER, + ZEND_RETURN_BY_REF_SPEC_OBSERVER_HANDLER, ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST_HANDLER, ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER, ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER, @@ -62128,12 +60988,12 @@ void zend_vm_init(void) ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER, ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_HANDLER, ZEND_DO_UCALL_SPEC_RETVAL_USED_HANDLER, - ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER, - ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER_HANDLER, + ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER, + ZEND_DO_UCALL_SPEC_OBSERVER_HANDLER, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_HANDLER, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER_HANDLER, + ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER, + ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, @@ -62305,15 +61165,15 @@ void zend_vm_init(void) ZEND_YIELD_SPEC_CV_UNUSED_HANDLER, ZEND_YIELD_SPEC_CV_CV_HANDLER, ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER, - ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER, - ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER, - ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, ZEND_NULL_HANDLER, ZEND_NULL_HANDLER, ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER, - ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER_HANDLER, + ZEND_GENERATOR_RETURN_SPEC_OBSERVER_HANDLER, ZEND_FAST_CALL_SPEC_HANDLER, ZEND_FAST_RET_SPEC_HANDLER, ZEND_RECV_VARIADIC_SPEC_UNUSED_HANDLER, diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 22911760e43e1..582ec490e2d77 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -55,9 +55,7 @@ ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value } EX(prev_execute_data) = EG(current_execute_data); i_init_code_execute_data(execute_data, op_array, return_value); - if (ZEND_OBSERVER_ENABLED) { - zend_observer_maybe_fcall_call_begin(execute_data); - } + ZEND_OBSERVER_FCALL_BEGIN(execute_data); zend_{%EXECUTOR_NAME%}_ex(execute_data); /* Observer end handlers are called from ZEND_RETURN */ zend_vm_stack_free_call_frame(execute_data); diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 2c2a64b294ccb..3346a59cfa620 100755 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -793,11 +793,12 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2, $name, $extra_spec=null) "/opline->extended_value\s*&\s*~\s*ZEND_ISEMPTY/" => isset($extra_spec['ISSET']) ? ($extra_spec['ISSET'] == 0 ? "\\0" : "opline->extended_value") : "\\0", - "/OBSERVER_FCALL_BEGIN_HANDLERS\(\s*(.*)\s*\)/" => isset($extra_spec['OBSERVER']) ? - ($extra_spec['OBSERVER'] == 0 ? "" : "zend_observer_maybe_fcall_call_begin(\\1)") + "/ZEND_OBSERVER_ENABLED/" => isset($extra_spec['OBSERVER']) && $extra_spec['OBSERVER'] == 1 ? "1" : "0", + "/ZEND_OBSERVER_FCALL_BEGIN\(\s*(.*)\s*\)/" => isset($extra_spec['OBSERVER']) ? + ($extra_spec['OBSERVER'] == 0 ? "" : "zend_observer_fcall_begin(\\1)") : "", - "/OBSERVER_FCALL_END_HANDLERS\(\s*([^,]*)\s*,\s*(.*)\s*\)/" => isset($extra_spec['OBSERVER']) ? - ($extra_spec['OBSERVER'] == 0 ? "" : "zend_observer_maybe_fcall_call_end(\\1, \\2)") + "/ZEND_OBSERVER_FCALL_END\(\s*([^,]*)\s*,\s*(.*)\s*\)/" => isset($extra_spec['OBSERVER']) ? + ($extra_spec['OBSERVER'] == 0 ? "" : "zend_observer_fcall_end(\\1, \\2)") : "", ); $code = preg_replace(array_keys($specialized_replacements), array_values($specialized_replacements), $code); @@ -1004,6 +1005,8 @@ function is_inline_hybrid_handler($name, $hot, $op1, $op2, $extra_spec) { function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno, $opcode, $extra_spec = null, &$switch_labels = array()) { global $definition_file, $prefix, $opnames, $gen_order; + static $used_observer_handlers = array(); + if (isset($opcode['alias']) && ($spec || $kind != ZEND_VM_KIND_SWITCH)) { return; } @@ -1037,6 +1040,26 @@ function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno, } } + /* Skip all specialization for OBSERVER handlers */ + if (isset($extra_spec["OBSERVER"]) && $extra_spec["OBSERVER"] == 1) { + if (isset($extra_spec["RETVAL"])) { + if ($extra_spec["RETVAL"] == 0) { + unset($extra_spec["RETVAL"]); + } else { + return; + } + } + if ($op1 != "ANY" || $op2 != "ANY") { + if (!isset($used_observer_handlers[$kind][$opcode["op"]])) { + $used_observer_handlers[$kind][$opcode["op"]] = true; + $op1 = "ANY"; + $op2 = "ANY"; + } else { + return; + } + } + } + if (ZEND_VM_LINES) { out($f, "#line $lineno \"$definition_file\"\n"); } @@ -1364,6 +1387,17 @@ function gen_labels($f, $spec, $kind, $prolog, &$specs, $switch_labels = array() } } + /* Skip all specialization for OBSERVER handlers */ + if (isset($extra_spec["OBSERVER"]) && $extra_spec["OBSERVER"] == 1) { + if (isset($extra_spec["RETVAL"])) { + unset($extra_spec["RETVAL"]); + } + if ($op1 != "ANY" || $op2 != "ANY") { + $op1 = "ANY"; + $op2 = "ANY"; + } + } + // Emit pointer to specialized handler $spec_name = $dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2].extra_spec_name($extra_spec); switch ($kind) { diff --git a/Zend/zend_vm_handlers.h b/Zend/zend_vm_handlers.h index 8410c70e15ceb..fb1251a185321 100644 --- a/Zend/zend_vm_handlers.h +++ b/Zend/zend_vm_handlers.h @@ -637,17 +637,17 @@ _(1349, ZEND_INIT_FCALL_BY_NAME_SPEC_CONST) \ _(1350, ZEND_DO_FCALL_SPEC_RETVAL_UNUSED) \ _(1351, ZEND_DO_FCALL_SPEC_RETVAL_USED) \ - _(1352, ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_OBSERVER) \ - _(1353, ZEND_DO_FCALL_SPEC_RETVAL_USED_OBSERVER) \ + _(1352, ZEND_DO_FCALL_SPEC_OBSERVER) \ + _(1353, ZEND_DO_FCALL_SPEC_OBSERVER) \ _(1354, ZEND_INIT_FCALL_SPEC_CONST) \ _(1355, ZEND_RETURN_SPEC_CONST) \ - _(1356, ZEND_RETURN_SPEC_CONST_OBSERVER) \ + _(1356, ZEND_RETURN_SPEC_OBSERVER) \ _(1357, ZEND_RETURN_SPEC_TMP) \ - _(1358, ZEND_RETURN_SPEC_TMP_OBSERVER) \ + _(1358, ZEND_RETURN_SPEC_OBSERVER) \ _(1359, ZEND_RETURN_SPEC_VAR) \ - _(1360, ZEND_RETURN_SPEC_VAR_OBSERVER) \ + _(1360, ZEND_RETURN_SPEC_OBSERVER) \ _(1363, ZEND_RETURN_SPEC_CV) \ - _(1364, ZEND_RETURN_SPEC_CV_OBSERVER) \ + _(1364, ZEND_RETURN_SPEC_OBSERVER) \ _(1365, ZEND_RECV_SPEC_UNUSED) \ _(1366, ZEND_RECV_INIT_SPEC_CONST) \ _(1367, ZEND_SEND_VAL_SPEC_CONST_CONST) \ @@ -719,13 +719,13 @@ _(1522, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED) \ _(1523, ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV) \ _(1524, ZEND_INCLUDE_OR_EVAL_SPEC_CONST) \ - _(1525, ZEND_INCLUDE_OR_EVAL_SPEC_CONST_OBSERVER) \ + _(1525, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ _(1526, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR) \ - _(1527, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER) \ + _(1527, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ _(1528, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR) \ - _(1529, ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_OBSERVER) \ + _(1529, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ _(1532, ZEND_INCLUDE_OR_EVAL_SPEC_CV) \ - _(1533, ZEND_INCLUDE_OR_EVAL_SPEC_CV_OBSERVER) \ + _(1533, ZEND_INCLUDE_OR_EVAL_SPEC_OBSERVER) \ _(1534, ZEND_UNSET_VAR_SPEC_CONST_UNUSED) \ _(1535, ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED) \ _(1536, ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED) \ @@ -1000,13 +1000,13 @@ _(1986, ZEND_CLONE_SPEC_UNUSED) \ _(1987, ZEND_CLONE_SPEC_CV) \ _(1988, ZEND_RETURN_BY_REF_SPEC_CONST) \ - _(1989, ZEND_RETURN_BY_REF_SPEC_CONST_OBSERVER) \ + _(1989, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ _(1990, ZEND_RETURN_BY_REF_SPEC_TMP) \ - _(1991, ZEND_RETURN_BY_REF_SPEC_TMP_OBSERVER) \ + _(1991, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ _(1992, ZEND_RETURN_BY_REF_SPEC_VAR) \ - _(1993, ZEND_RETURN_BY_REF_SPEC_VAR_OBSERVER) \ + _(1993, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ _(1996, ZEND_RETURN_BY_REF_SPEC_CV) \ - _(1997, ZEND_RETURN_BY_REF_SPEC_CV_OBSERVER) \ + _(1997, ZEND_RETURN_BY_REF_SPEC_OBSERVER) \ _(1998, ZEND_INIT_METHOD_CALL_SPEC_CONST_CONST) \ _(1999, ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR) \ _(2000, ZEND_INIT_METHOD_CALL_SPEC_CONST_TMPVAR) \ @@ -1111,12 +1111,12 @@ _(2193, ZEND_DO_ICALL_SPEC_RETVAL_USED) \ _(2194, ZEND_DO_UCALL_SPEC_RETVAL_UNUSED) \ _(2195, ZEND_DO_UCALL_SPEC_RETVAL_USED) \ - _(2196, ZEND_DO_UCALL_SPEC_RETVAL_UNUSED_OBSERVER) \ - _(2197, ZEND_DO_UCALL_SPEC_RETVAL_USED_OBSERVER) \ + _(2196, ZEND_DO_UCALL_SPEC_OBSERVER) \ + _(2197, ZEND_DO_UCALL_SPEC_OBSERVER) \ _(2198, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED) \ _(2199, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED) \ - _(2200, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_OBSERVER) \ - _(2201, ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_OBSERVER) \ + _(2200, ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER) \ + _(2201, ZEND_DO_FCALL_BY_NAME_SPEC_OBSERVER) \ _(2212, ZEND_PRE_INC_OBJ_SPEC_VAR_CONST) \ _(2213, ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR) \ _(2214, ZEND_PRE_INC_OBJ_SPEC_VAR_TMPVAR) \ @@ -1233,13 +1233,13 @@ _(2370, ZEND_YIELD_SPEC_CV_UNUSED) \ _(2371, ZEND_YIELD_SPEC_CV_CV) \ _(2372, ZEND_GENERATOR_RETURN_SPEC_CONST) \ - _(2373, ZEND_GENERATOR_RETURN_SPEC_CONST_OBSERVER) \ + _(2373, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ _(2374, ZEND_GENERATOR_RETURN_SPEC_TMP) \ - _(2375, ZEND_GENERATOR_RETURN_SPEC_TMP_OBSERVER) \ + _(2375, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ _(2376, ZEND_GENERATOR_RETURN_SPEC_VAR) \ - _(2377, ZEND_GENERATOR_RETURN_SPEC_VAR_OBSERVER) \ + _(2377, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ _(2380, ZEND_GENERATOR_RETURN_SPEC_CV) \ - _(2381, ZEND_GENERATOR_RETURN_SPEC_CV_OBSERVER) \ + _(2381, ZEND_GENERATOR_RETURN_SPEC_OBSERVER) \ _(2382, ZEND_FAST_CALL_SPEC) \ _(2383, ZEND_FAST_RET_SPEC) \ _(2384, ZEND_RECV_VARIADIC_SPEC_UNUSED) \ diff --git a/azure/apt.yml b/azure/apt.yml index 703e5753d3c40..71f58ce8da2ad 100644 --- a/azure/apt.yml +++ b/azure/apt.yml @@ -40,6 +40,8 @@ steps: postgresql-contrib \ snmpd \ snmp-mibs-downloader \ + unixodbc-dev \ llvm \ + libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd \ ${{ parameters.packages }} displayName: 'APT' diff --git a/azure/configure.yml b/azure/configure.yml index fd0191528bef6..0bfbf6d92e0ec 100644 --- a/azure/configure.yml +++ b/azure/configure.yml @@ -57,6 +57,10 @@ steps: --with-sodium \ --enable-dba \ --with-snmp \ + --with-unixODBC \ + --with-imap \ + --with-kerberos \ + --with-imap-ssl \ --enable-werror \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d diff --git a/azure/setup.yml b/azure/setup.yml index 825ca4d5f6c01..e0b4dc79da991 100644 --- a/azure/setup.yml +++ b/azure/setup.yml @@ -16,4 +16,12 @@ steps: sudo cp ext/snmp/tests/bigtest /etc/snmp sudo service snmpd restart displayName: 'Configure snmpd' + - script: | + set -e + sudo groupadd -g 5000 vmail + sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail + sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf + sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass + sudo service dovecot restart + displayName: 'Configure IMAP' diff --git a/build/php.m4 b/build/php.m4 index b0e3c424d18e4..1f77f38e572f2 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1626,7 +1626,7 @@ dnl AC_DEFUN([PHP_TEST_BUILD], [ old_LIBS=$LIBS LIBS="$4 $LIBS" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_LINK_IFELSE([AC_LANG_SOURCE([[ $5 char $1(); int main() { @@ -1639,8 +1639,6 @@ AC_DEFUN([PHP_TEST_BUILD], [ ],[ LIBS=$old_LIBS $3 - ],[ - LIBS=$old_LIBS ]) ]) diff --git a/configure.ac b/configure.ac index f82783a03b04e..a6ff4e707aa38 100644 --- a/configure.ac +++ b/configure.ac @@ -1464,7 +1464,7 @@ PHP_ADD_SOURCES(Zend, \ zend_closures.c zend_weakrefs.c zend_float.c zend_string.c zend_signal.c zend_generators.c \ zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \ zend_default_classes.c zend_inheritance.c zend_smart_str.c zend_cpuinfo.c zend_gdb.c \ - zend_observer.c, \ + zend_observer.c zend_system_id.c, \ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_ADD_BUILD_DIR(main main/streams) diff --git a/ext/com_dotnet/tests/bug66431_0.phpt b/ext/com_dotnet/tests/bug66431_0.phpt index 4a0062a7e13c2..5f9bc5c0b0bb5 100644 --- a/ext/com_dotnet/tests/bug66431_0.phpt +++ b/ext/com_dotnet/tests/bug66431_0.phpt @@ -33,7 +33,7 @@ if (!$result) { $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.txt"); if (file_exists($fpath)) { - unlink($fpath); + unlink($fpath); } ?> --EXPECT-- diff --git a/ext/com_dotnet/tests/bug66431_1.phpt b/ext/com_dotnet/tests/bug66431_1.phpt index e99131d27b1e1..7ebf16a10d1da 100644 --- a/ext/com_dotnet/tests/bug66431_1.phpt +++ b/ext/com_dotnet/tests/bug66431_1.phpt @@ -5,9 +5,9 @@ Bug #66431 Special Character via COM Interface (CP_UTF8), Application.Word if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; } try { - new COM("word.application", NULL, CP_UTF8); + new COM("word.application", NULL, CP_UTF8); } catch (Exception $e) { - die('skip ' . $e->getMessage()); + die('skip ' . $e->getMessage()); } ?> @@ -51,7 +51,7 @@ if (!$result) { $fpath = str_replace("/", "\\", __DIR__ . "/bug66431.docx"); if (file_exists($fpath)) { - unlink($fpath); + unlink($fpath); } ?> --EXPECT-- diff --git a/ext/com_dotnet/tests/variants_x64.phpt b/ext/com_dotnet/tests/variants_x64.phpt index 88f9f3e12616e..6a1b7e1c12925 100644 --- a/ext/com_dotnet/tests/variants_x64.phpt +++ b/ext/com_dotnet/tests/variants_x64.phpt @@ -5,7 +5,7 @@ COM: General variant tests if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; if (8 != PHP_INT_SIZE) print "skip x64 only"; if ((string) variant_cat(new VARIANT(false), new VARIANT(0.5)) != 'False0.5') - print "skip English locale only"; + print "skip English locale only"; ?> --FILE-- --FILE-- diff --git a/ext/curl/tests/bug48514.phpt b/ext/curl/tests/bug48514.phpt index 759e4bc1be163..12dcdd498b0c0 100644 --- a/ext/curl/tests/bug48514.phpt +++ b/ext/curl/tests/bug48514.phpt @@ -4,7 +4,7 @@ Bug #48514 (cURL extension uses same resource name for simple and multi APIs) diff --git a/ext/curl/tests/bug52827.phpt b/ext/curl/tests/bug52827.phpt index 8fbcad627d4ef..3b9aabf92cdc1 100644 --- a/ext/curl/tests/bug52827.phpt +++ b/ext/curl/tests/bug52827.phpt @@ -4,7 +4,7 @@ Bug #52827 (curl_setopt with CURLOPT_STDERR erroneously increments the resource diff --git a/ext/curl/tests/bug61948.phpt b/ext/curl/tests/bug61948.phpt index 316fa4d0e7315..9b795241f26b2 100644 --- a/ext/curl/tests/bug61948.phpt +++ b/ext/curl/tests/bug61948.phpt @@ -18,9 +18,9 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) ?> --CLEAN-- --EXPECTF-- %a diff --git a/ext/curl/tests/bug71523.phpt b/ext/curl/tests/bug71523.phpt index 2d947febecb7b..3252f75f4613b 100644 --- a/ext/curl/tests/bug71523.phpt +++ b/ext/curl/tests/bug71523.phpt @@ -3,7 +3,7 @@ Bug #71523 (Copied handle with new option CURLOPT_HTTPHEADER crashes while curl_ --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/bug72202.phpt b/ext/curl/tests/bug72202.phpt index bf04d9faea501..5b2ebfa2cccc4 100644 --- a/ext/curl/tests/bug72202.phpt +++ b/ext/curl/tests/bug72202.phpt @@ -3,7 +3,7 @@ Bug #72202 (curl_close doesn't close cURL handle) --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/bug76675.phpt b/ext/curl/tests/bug76675.phpt index e59aabc7c3407..5d36abfdd671b 100644 --- a/ext/curl/tests/bug76675.phpt +++ b/ext/curl/tests/bug76675.phpt @@ -4,11 +4,11 @@ Bug #76675 (Segfault with H2 server push write/writeheader handlers) --FILE-- diff --git a/ext/curl/tests/bug77535.phpt b/ext/curl/tests/bug77535.phpt index 95eec344a894e..b1d8f4d4da51a 100644 --- a/ext/curl/tests/bug77535.phpt +++ b/ext/curl/tests/bug77535.phpt @@ -4,11 +4,11 @@ Bug #77535 (Invalid callback, h2 server push) --FILE-- diff --git a/ext/curl/tests/bug77946.phpt b/ext/curl/tests/bug77946.phpt index c983a7761747f..2a0dcd62a3802 100644 --- a/ext/curl/tests/bug77946.phpt +++ b/ext/curl/tests/bug77946.phpt @@ -4,7 +4,7 @@ Bug #77946 (Errored cURL resources returned by curl_multi_info_read() must be co diff --git a/ext/curl/tests/bug79033.phpt b/ext/curl/tests/bug79033.phpt index 454c3b2669dfe..c70611dda602f 100644 --- a/ext/curl/tests/bug79033.phpt +++ b/ext/curl/tests/bug79033.phpt @@ -21,7 +21,7 @@ var_dump(curl_getinfo($ch)["request_header"]); string(%d) "array(0) { } " -string(90) "POST /get.inc?test=post HTTP/1.1 +string(%d) "POST /get.inc?test=post HTTP/1.1 Host: localhost:%d Accept: */* Content-Length: 0 diff --git a/ext/curl/tests/bug79741.phpt b/ext/curl/tests/bug79741.phpt index 3f5a4801b19c2..5fddd30c2769c 100644 --- a/ext/curl/tests/bug79741.phpt +++ b/ext/curl/tests/bug79741.phpt @@ -4,7 +4,7 @@ Bug #79741: curl_setopt CURLOPT_POSTFIELDS asserts on object with declared prope --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- = 7.50.0"); + exit("skip: test works only with curl >= 7.50.0"); } ?> --FILE-- diff --git a/ext/curl/tests/curl_basic_024.phpt b/ext/curl/tests/curl_basic_024.phpt index 6875d4f02a25d..4037a0bc12636 100644 --- a/ext/curl/tests/curl_basic_024.phpt +++ b/ext/curl/tests/curl_basic_024.phpt @@ -4,7 +4,7 @@ Test curl_getinfo() function with CURLINFO_* from curl >= 7.52.0 = 7.52.0"); + exit("skip: test works only with curl >= 7.52.0"); } ?> --FILE-- diff --git a/ext/curl/tests/curl_copy_handle_basic.phpt b/ext/curl/tests/curl_copy_handle_basic.phpt index 0aa58dbcf869e..945768436c5fe 100644 --- a/ext/curl/tests/curl_copy_handle_basic.phpt +++ b/ext/curl/tests/curl_copy_handle_basic.phpt @@ -5,7 +5,7 @@ Francesco Fullone ff@ideato.it #PHPTestFest Cesena Italia on 2009-06-20 --SKIPIF-- --FILE-- --FILE-- --DESCRIPTION-- the only way to test if a option is setten on a curl handle is using the curl_getinfo() function. diff --git a/ext/curl/tests/curl_escape.phpt b/ext/curl/tests/curl_escape.phpt index 015b010a1ca2c..91dff3f056339 100644 Binary files a/ext/curl/tests/curl_escape.phpt and b/ext/curl/tests/curl_escape.phpt differ diff --git a/ext/curl/tests/curl_file_serialize.phpt b/ext/curl/tests/curl_file_serialize.phpt index 7748272b7610d..7776a455a402f 100644 --- a/ext/curl/tests/curl_file_serialize.phpt +++ b/ext/curl/tests/curl_file_serialize.phpt @@ -3,7 +3,7 @@ CURL file uploading --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/curl_multi_errno_strerror_001.phpt b/ext/curl/tests/curl_multi_errno_strerror_001.phpt index cc8e175460a51..d0c237ef0c72e 100644 --- a/ext/curl/tests/curl_multi_errno_strerror_001.phpt +++ b/ext/curl/tests/curl_multi_errno_strerror_001.phpt @@ -3,7 +3,7 @@ curl_multi_errno and curl_multi_strerror basic test --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/curl_multi_setopt_basic001.phpt b/ext/curl/tests/curl_multi_setopt_basic001.phpt index 25c3b4962f5c6..7620c421e4cdd 100644 --- a/ext/curl/tests/curl_multi_setopt_basic001.phpt +++ b/ext/curl/tests/curl_multi_setopt_basic001.phpt @@ -3,7 +3,7 @@ curl_multi_setopt basic test --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/curl_multi_strerror_001.phpt b/ext/curl/tests/curl_multi_strerror_001.phpt index 3c2edb988de6b..7d1b426a258a4 100644 --- a/ext/curl/tests/curl_multi_strerror_001.phpt +++ b/ext/curl/tests/curl_multi_strerror_001.phpt @@ -3,7 +3,7 @@ curl_multi_strerror basic test --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/curl_share_errno_strerror_001.phpt b/ext/curl/tests/curl_share_errno_strerror_001.phpt index 3a24121b57ee3..d8f18eb76fd9c 100644 --- a/ext/curl/tests/curl_share_errno_strerror_001.phpt +++ b/ext/curl/tests/curl_share_errno_strerror_001.phpt @@ -3,7 +3,7 @@ curl_share_errno and curl_share_strerror basic test --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/curl_share_setopt_basic001.phpt b/ext/curl/tests/curl_share_setopt_basic001.phpt index d53ae4ff8e963..476ea688250b4 100644 --- a/ext/curl/tests/curl_share_setopt_basic001.phpt +++ b/ext/curl/tests/curl_share_setopt_basic001.phpt @@ -3,7 +3,7 @@ curl_share_setopt basic test --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/curl_strerror_001.phpt b/ext/curl/tests/curl_strerror_001.phpt index 06342598962d9..85a13271c190a 100644 --- a/ext/curl/tests/curl_strerror_001.phpt +++ b/ext/curl/tests/curl_strerror_001.phpt @@ -3,7 +3,7 @@ curl_strerror basic test --SKIPIF-- --FILE-- diff --git a/ext/curl/tests/server.inc b/ext/curl/tests/server.inc index 00eeb5ff76683..3051bf98a4c1d 100644 --- a/ext/curl/tests/server.inc +++ b/ext/curl/tests/server.inc @@ -1,8 +1,4 @@ - STDIN, 1 => STDOUT, - 2 => array("null"), + 2 => ['pipe', 'w'], ); $handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root, null, array("suppress_errors" => true)); + // First, wait for the dev server to declare itself ready. + $bound = null; + stream_set_blocking($pipes[2], false); + for ($i = 0; $i < 60; $i++) { + usleep(50000); // 50ms per try + $status = proc_get_status($handle); + if (empty($status['running'])) { + echo "Server is not running\n"; + proc_terminate($handle); + exit(1); + } + + while (($line = fgets($pipes[2])) !== false) { + if (preg_match('@PHP \S* Development Server \(https?://(.*?:\d+)\) started@', $line, $matches)) { + $bound = $matches[1]; + // Now that we've identified the listen address, close STDERR. + // Otherwise the pipe may clog up with unread log messages. + fclose($pipes[2]); + break 2; + } + } + } + if ($bound === null) { + echo "Server did not output startup message"; + proc_terminate($handle); + exit(1); + } + + // Now wait for a connection to succeed. // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns $error = "Unable to connect to server\n"; for ($i=0; $i < 60; $i++) { usleep(50000); // 50ms per try $status = proc_get_status($handle); - $fp = @fsockopen(PHP_CURL_SERVER_HOSTNAME, PHP_CURL_SERVER_PORT); + $fp = @fsockopen("tcp://$bound"); // Failure, the server is no longer running if (!($status && $status['running'])) { $error = "Server is not running\n"; @@ -64,5 +89,5 @@ function curl_cli_server_start() { $handle ); - return PHP_CURL_SERVER_ADDRESS; + return $bound; } diff --git a/ext/date/tests/002.phpt b/ext/date/tests/002.phpt index 36dc43d7605b6..65e8228149338 100644 --- a/ext/date/tests/002.phpt +++ b/ext/date/tests/002.phpt @@ -3,7 +3,7 @@ strtotime() function --SKIPIF-- --FILE-- diff --git a/ext/date/tests/bug13142.phpt b/ext/date/tests/bug13142.phpt index 80d4fa82fc453..63eba795d866e 100644 --- a/ext/date/tests/bug13142.phpt +++ b/ext/date/tests/bug13142.phpt @@ -5,10 +5,10 @@ date.timezone=US/Eastern --SKIPIF-- --FILE-- diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt index 38c724ed57017..bfd416fc5e308 100644 --- a/ext/date/tests/bug26317.phpt +++ b/ext/date/tests/bug26317.phpt @@ -5,7 +5,7 @@ date.timezone=GMT0 --SKIPIF-- --FILE-- diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt index 563e39ab30601..b8d4fc1d2a3e2 100644 --- a/ext/date/tests/bug26320.phpt +++ b/ext/date/tests/bug26320.phpt @@ -5,7 +5,7 @@ date.timezone=GMT0 --SKIPIF-- --FILE-- diff --git a/ext/date/tests/date_default_timezone_get-1.phpt b/ext/date/tests/date_default_timezone_get-1.phpt index 32c066c1ca7ca..fc466d411d1ec 100644 --- a/ext/date/tests/date_default_timezone_get-1.phpt +++ b/ext/date/tests/date_default_timezone_get-1.phpt @@ -2,7 +2,7 @@ date_default_timezone_get() function [1] --SKIPIF-- --INI-- date.timezone= diff --git a/ext/date/tests/date_default_timezone_get-2.phpt b/ext/date/tests/date_default_timezone_get-2.phpt index cf7478c90b502..44d94cd76f2a3 100644 --- a/ext/date/tests/date_default_timezone_get-2.phpt +++ b/ext/date/tests/date_default_timezone_get-2.phpt @@ -2,7 +2,7 @@ date_default_timezone_get() function [2] --SKIPIF-- --INI-- date.timezone= diff --git a/ext/date/tests/strftime_variation22.phpt b/ext/date/tests/strftime_variation22.phpt index b1c107ba78c08..ab0089e7f75b1 100644 --- a/ext/date/tests/strftime_variation22.phpt +++ b/ext/date/tests/strftime_variation22.phpt @@ -6,7 +6,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { die("skip Test is not valid for Windows"); } if(!setlocale(LC_ALL, "POSIX")) { - die("skip Locale POSIX is needed by test and is not available"); + die("skip Locale POSIX is needed by test and is not available"); } ?> --FILE-- diff --git a/ext/dba/tests/bug36436.phpt b/ext/dba/tests/bug36436.phpt index fe625b62bc6b4..a7a87c70c3474 100644 --- a/ext/dba/tests/bug36436.phpt +++ b/ext/dba/tests/bug36436.phpt @@ -2,8 +2,8 @@ Bug #36436 (DBA problem with Berkeley DB4) --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- resource(%d) of type (dba persistent) diff --git a/ext/dba/tests/bug38698.phpt b/ext/dba/tests/bug38698.phpt index fe4c68aa80fea..364d54d00496a 100644 --- a/ext/dba/tests/bug38698.phpt +++ b/ext/dba/tests/bug38698.phpt @@ -2,8 +2,8 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't read valid db) --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- bool(false) diff --git a/ext/dba/tests/bug49125.phpt b/ext/dba/tests/bug49125.phpt index 70f59c97c91a2..7e46ea9f1f04c 100644 --- a/ext/dba/tests/bug49125.phpt +++ b/ext/dba/tests/bug49125.phpt @@ -2,8 +2,8 @@ Bug #49125 (Error in dba_exists C code) --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/dba/tests/bug65708.phpt b/ext/dba/tests/bug65708.phpt index 8bec60a543fc2..dff291a39d263 100644 --- a/ext/dba/tests/bug65708.phpt +++ b/ext/dba/tests/bug65708.phpt @@ -2,7 +2,7 @@ Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write) --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- integer diff --git a/ext/dba/tests/bug72157.phpt b/ext/dba/tests/bug72157.phpt index 71fa8730b89ac..490e9116d153e 100644 --- a/ext/dba/tests/bug72157.phpt +++ b/ext/dba/tests/bug72157.phpt @@ -2,7 +2,7 @@ Bug #72157 (use-after-free caused by dba_open) --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba002.phpt b/ext/dba/tests/dba002.phpt index c0432c4599bc2..2aba823af25c6 100644 --- a/ext/dba/tests/dba002.phpt +++ b/ext/dba/tests/dba002.phpt @@ -2,8 +2,8 @@ DBA Insert/Fetch Test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba003.phpt b/ext/dba/tests/dba003.phpt index 55d4ce9fe010a..dd08f86ed571f 100644 --- a/ext/dba/tests/dba003.phpt +++ b/ext/dba/tests/dba003.phpt @@ -2,8 +2,8 @@ DBA Insert/Replace/Fetch Test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba004.phpt b/ext/dba/tests/dba004.phpt index 3846ccfd2918e..eebbc04ffb9ec 100644 --- a/ext/dba/tests/dba004.phpt +++ b/ext/dba/tests/dba004.phpt @@ -2,8 +2,8 @@ DBA Multiple Insert/Fetch Test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba005.phpt b/ext/dba/tests/dba005.phpt index 0f5767988dd95..bde23a495defa 100644 --- a/ext/dba/tests/dba005.phpt +++ b/ext/dba/tests/dba005.phpt @@ -2,8 +2,8 @@ DBA FirstKey/NextKey Loop Test With 5 Items --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba006.phpt b/ext/dba/tests/dba006.phpt index 1264ccf89955e..dfe93f874db81 100644 --- a/ext/dba/tests/dba006.phpt +++ b/ext/dba/tests/dba006.phpt @@ -2,8 +2,8 @@ DBA FirstKey/NextKey with 2 deletes --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba007.phpt b/ext/dba/tests/dba007.phpt index bb71ad273e40e..b617c34e9b6d6 100644 --- a/ext/dba/tests/dba007.phpt +++ b/ext/dba/tests/dba007.phpt @@ -2,9 +2,9 @@ DBA Multiple File Creation Test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba009.phpt b/ext/dba/tests/dba009.phpt index 4ca9b0ed96ce4..3f23c9748c2e3 100644 --- a/ext/dba/tests/dba009.phpt +++ b/ext/dba/tests/dba009.phpt @@ -2,8 +2,8 @@ DBA dba_popen Test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba010.phpt b/ext/dba/tests/dba010.phpt index f5cb08871a936..1b0d6172aa3c6 100644 --- a/ext/dba/tests/dba010.phpt +++ b/ext/dba/tests/dba010.phpt @@ -2,8 +2,8 @@ DBA with array keys --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: %s diff --git a/ext/dba/tests/dba015.phpt b/ext/dba/tests/dba015.phpt index 42a448dde99d5..1da13070492b4 100644 --- a/ext/dba/tests/dba015.phpt +++ b/ext/dba/tests/dba015.phpt @@ -50,7 +50,7 @@ echo dba_fetch("key2", $db_file1), "\n"; ?> --CLEAN-- --EXPECTF-- database handler: flatfile diff --git a/ext/dba/tests/dba016.phpt b/ext/dba/tests/dba016.phpt index 5d2a35990cdfb..e670ec86b96b1 100644 --- a/ext/dba/tests/dba016.phpt +++ b/ext/dba/tests/dba016.phpt @@ -17,7 +17,7 @@ $db_file1 = dba_popen($db_filename, 'n-t', 'flatfile'); ?> --CLEAN-- --EXPECTF-- database handler: flatfile diff --git a/ext/dba/tests/dba_cdb.phpt b/ext/dba/tests/dba_cdb.phpt index 956483f5f35f3..7ed9a6487b9a9 100644 --- a/ext/dba/tests/dba_cdb.phpt +++ b/ext/dba/tests/dba_cdb.phpt @@ -2,9 +2,9 @@ DBA CDB handler test --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- database handler: cdb diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt index 21969db0743a8..c15f49a805418 100644 --- a/ext/dba/tests/dba_cdb_make.phpt +++ b/ext/dba/tests/dba_cdb_make.phpt @@ -2,9 +2,9 @@ DBA CDB_MAKE handler test --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- database handler: cdb_make diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt index 39fc85e454cac..77afb95661d9a 100644 --- a/ext/dba/tests/dba_cdb_read.phpt +++ b/ext/dba/tests/dba_cdb_read.phpt @@ -2,8 +2,8 @@ DBA CDB handler test (read only) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --CLEAN-- --XFAIL-- Test 6 crashes with dba pointer of NULL, bug http://bugs.php.net/bug.php?id=51278 diff --git a/ext/dba/tests/dba_dbm.phpt b/ext/dba/tests/dba_dbm.phpt index 47bbae28c0757..6fc649d29c445 100644 --- a/ext/dba/tests/dba_dbm.phpt +++ b/ext/dba/tests/dba_dbm.phpt @@ -2,8 +2,8 @@ DBA DBM handler test --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- database handler: dbm diff --git a/ext/dba/tests/dba_flatfile.phpt b/ext/dba/tests/dba_flatfile.phpt index 41bd0f891d307..c2022895ab70d 100644 --- a/ext/dba/tests/dba_flatfile.phpt +++ b/ext/dba/tests/dba_flatfile.phpt @@ -2,8 +2,8 @@ DBA FlatFile handler test --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- database handler: flatfile diff --git a/ext/dba/tests/dba_gdbm.phpt b/ext/dba/tests/dba_gdbm.phpt index ae4216d7fd5c3..f8174dde58ee7 100644 --- a/ext/dba/tests/dba_gdbm.phpt +++ b/ext/dba/tests/dba_gdbm.phpt @@ -2,8 +2,8 @@ DBA GDBM handler test --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- database handler: inifile diff --git a/ext/dba/tests/dba_lmdb.phpt b/ext/dba/tests/dba_lmdb.phpt index a97244bf36918..b23a2686f8751 100644 --- a/ext/dba/tests/dba_lmdb.phpt +++ b/ext/dba/tests/dba_lmdb.phpt @@ -2,8 +2,8 @@ DBA LMDB handler test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: lmdb diff --git a/ext/dba/tests/dba_ndbm.phpt b/ext/dba/tests/dba_ndbm.phpt index 74f316e1908e3..0cd00bbab191e 100644 --- a/ext/dba/tests/dba_ndbm.phpt +++ b/ext/dba/tests/dba_ndbm.phpt @@ -2,8 +2,8 @@ DBA NDBM handler test --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- database handler: flatfile diff --git a/ext/dba/tests/dba_qdbm.phpt b/ext/dba/tests/dba_qdbm.phpt index efe34653b3f55..940b929bdf284 100644 --- a/ext/dba/tests/dba_qdbm.phpt +++ b/ext/dba/tests/dba_qdbm.phpt @@ -2,8 +2,8 @@ DBA QDBM handler test --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- database handler: qdbm diff --git a/ext/dba/tests/dba_split.phpt b/ext/dba/tests/dba_split.phpt index a85798474182b..246018715033b 100644 --- a/ext/dba/tests/dba_split.phpt +++ b/ext/dba/tests/dba_split.phpt @@ -2,8 +2,8 @@ DBA Split Test --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- database handler: flatfile diff --git a/ext/dba/tests/dba_tcadb.phpt b/ext/dba/tests/dba_tcadb.phpt index 0d7c32f06c6ac..f8ff71cb9eadc 100644 --- a/ext/dba/tests/dba_tcadb.phpt +++ b/ext/dba/tests/dba_tcadb.phpt @@ -2,8 +2,8 @@ DBA TCADB handler test --SKIPIF-- --FILE-- save($temp_filename) . ' bytes'; // Wrote: 72 bytes ?> --CLEAN-- --EXPECT-- Wrote: 72 bytes diff --git a/ext/enchant/tests/broker_describe.phpt b/ext/enchant/tests/broker_describe.phpt index 07134ae50fa2b..93ec1fafdc820 100644 --- a/ext/enchant/tests/broker_describe.phpt +++ b/ext/enchant/tests/broker_describe.phpt @@ -5,21 +5,21 @@ marcosptf - --SKIPIF-- --SKIPIF-- = info->valid_start && end <= info->valid_end; } -#ifdef EXIF_DEBUG +#ifdef EXIF_DEBUG static inline int exif_offset_info_length(const exif_offset_info *info) { return info->valid_end - info->valid_start; diff --git a/ext/exif/tests/exif003.phpt b/ext/exif/tests/exif003.phpt index 9d66e35ddc56a..6c043af4e2fdb 100644 --- a/ext/exif/tests/exif003.phpt +++ b/ext/exif/tests/exif003.phpt @@ -2,9 +2,9 @@ Check for exif_read_data, Unicode user comment --SKIPIF-- --INI-- output_handler= diff --git a/ext/exif/tests/exif004.phpt b/ext/exif/tests/exif004.phpt index 2b2e978d528df..1b371ff81f886 100644 --- a/ext/exif/tests/exif004.phpt +++ b/ext/exif/tests/exif004.phpt @@ -2,9 +2,9 @@ Check for exif_read_data, Unicode WinXP tags --SKIPIF-- --INI-- output_handler= diff --git a/ext/ffi/tests/100.phpt b/ext/ffi/tests/100.phpt index 634d8d44362a7..62cd0b2bdb602 100644 --- a/ext/ffi/tests/100.phpt +++ b/ext/ffi/tests/100.phpt @@ -5,9 +5,9 @@ FFI 100: PHP symbols --INI-- diff --git a/ext/ffi/tests/101.phpt b/ext/ffi/tests/101.phpt index 3acc98f035a59..d3a81cbfd1bdc 100644 --- a/ext/ffi/tests/101.phpt +++ b/ext/ffi/tests/101.phpt @@ -5,9 +5,9 @@ FFI 101: PHP symbols (function address) --INI-- diff --git a/ext/ffi/tests/200.phpt b/ext/ffi/tests/200.phpt index 39dcbdf71a6b7..0fba3d4e16175 100644 --- a/ext/ffi/tests/200.phpt +++ b/ext/ffi/tests/200.phpt @@ -5,9 +5,9 @@ FFI 200: PHP callbacks --INI-- diff --git a/ext/ffi/tests/bug77632.phpt b/ext/ffi/tests/bug77632.phpt index 314424548a0fa..df9078b723486 100644 --- a/ext/ffi/tests/bug77632.phpt +++ b/ext/ffi/tests/bug77632.phpt @@ -4,9 +4,9 @@ Bug #77632 (FFI Segfaults When Called With Variadics) --INI-- diff --git a/ext/ffi/tests/bug77632b.phpt b/ext/ffi/tests/bug77632b.phpt index 2509aa9bae8c8..c0fee9ed4f531 100644 --- a/ext/ffi/tests/bug77632b.phpt +++ b/ext/ffi/tests/bug77632b.phpt @@ -5,9 +5,9 @@ Bug #77632 (FFI function pointers with variadics) require_once('skipif.inc'); require_once('utils.inc'); try { - FFI::cdef("extern void *zend_printf;", ffi_get_php_dll_name()); + FFI::cdef("extern void *zend_printf;", ffi_get_php_dll_name()); } catch (Throwable $_) { - die('skip PHP symbols not available'); + die('skip PHP symbols not available'); } ?> --INI-- diff --git a/ext/ffi/tests/bug77706.phpt b/ext/ffi/tests/bug77706.phpt index 87ef584d51284..5a44d5855371b 100644 --- a/ext/ffi/tests/bug77706.phpt +++ b/ext/ffi/tests/bug77706.phpt @@ -4,9 +4,9 @@ Bug #77632 (FFI Segfaults When Called With Variadics) --INI-- diff --git a/ext/ffi/tests/bug77768.phpt b/ext/ffi/tests/bug77768.phpt index 6c29db59d7cef..204a6e4f8cdb9 100644 --- a/ext/ffi/tests/bug77768.phpt +++ b/ext/ffi/tests/bug77768.phpt @@ -4,9 +4,9 @@ Bug #77768 (Redeclaration of builtin types and repeated declarations) --INI-- diff --git a/ext/fileinfo/tests/bug57547.phpt b/ext/fileinfo/tests/bug57547.phpt index 184ea6e018627..a2375005017fe 100644 --- a/ext/fileinfo/tests/bug57547.phpt +++ b/ext/fileinfo/tests/bug57547.phpt @@ -3,7 +3,7 @@ Bug #57547 Settings options on file doesn't give same result as constructor opti --SKIPIF-- --FILE-- file($f)); +++DONE+++ --CLEAN-- --EXPECT-- string(15) "video/quicktime" diff --git a/ext/fileinfo/tests/bug68731.phpt b/ext/fileinfo/tests/bug68731.phpt index c15b83c951f17..5ae63ee11f775 100644 --- a/ext/fileinfo/tests/bug68731.phpt +++ b/ext/fileinfo/tests/bug68731.phpt @@ -3,7 +3,7 @@ Bug #68731 finfo_buffer doesn't extract the correct mime with some gifs --SKIPIF-- --CLEAN-- --EXPECT-- string(10) "text/plain" diff --git a/ext/fileinfo/tests/bug71527-mb.phpt b/ext/fileinfo/tests/bug71527-mb.phpt index 272cdba702fb4..ea32a8122a923 100644 --- a/ext/fileinfo/tests/bug71527-mb.phpt +++ b/ext/fileinfo/tests/bug71527-mb.phpt @@ -3,7 +3,7 @@ Bug #71527 Buffer over-write in finfo_open with malformed magic file --SKIPIF-- --FILE-- --FILE-- --INI-- pcre.jit=0 diff --git a/ext/fileinfo/tests/cve-2014-3538.phpt b/ext/fileinfo/tests/cve-2014-3538.phpt index 0ff2a68685b7e..4d571b1b3f8b7 100644 --- a/ext/fileinfo/tests/cve-2014-3538.phpt +++ b/ext/fileinfo/tests/cve-2014-3538.phpt @@ -3,9 +3,9 @@ Bug #66731: file: extensive backtracking --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- 45) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/gd/tests/bug43073.phpt b/ext/gd/tests/bug43073.phpt index 74641496de970..4257f6c1a7d8f 100644 --- a/ext/gd/tests/bug43073.phpt +++ b/ext/gd/tests/bug43073.phpt @@ -2,8 +2,8 @@ Bug #43073 (TrueType bounding box is wrong for angle<>0) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/gd/tests/bug44849.phpt b/ext/gd/tests/bug44849.phpt index 22e8a65ec45bc..4710f218f9b21 100644 --- a/ext/gd/tests/bug44849.phpt +++ b/ext/gd/tests/bug44849.phpt @@ -2,7 +2,7 @@ Bug #44849 (imagecolorclosesthwb is not available on Windows) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/gd/tests/bug66356.phpt b/ext/gd/tests/bug66356.phpt index a255997ca08aa..0803ed48bdfdd 100644 --- a/ext/gd/tests/bug66356.phpt +++ b/ext/gd/tests/bug66356.phpt @@ -2,7 +2,7 @@ Bug #66356 (Heap Overflow Vulnerability in imagecrop()) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/gd/tests/bug72512.phpt b/ext/gd/tests/bug72512.phpt index e9331ec600639..96b6de10237d7 100644 --- a/ext/gd/tests/bug72512.phpt +++ b/ext/gd/tests/bug72512.phpt @@ -2,10 +2,10 @@ Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd)) --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- gd1/gd2 conversion test --SKIPIF-- --FILE-- jpeg conversion test --SKIPIF-- --FILE-- png conversion test --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- diff --git a/ext/gd/tests/imagecolourstotal_basic.phpt b/ext/gd/tests/imagecolourstotal_basic.phpt index 955dee9848fdd..0d03ecf7586f6 100644 --- a/ext/gd/tests/imagecolourstotal_basic.phpt +++ b/ext/gd/tests/imagecolourstotal_basic.phpt @@ -4,12 +4,12 @@ Test imagecolorstotal() function : basic functionality Felix De Vliegher --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- Simple test of imagecopyresampled() function diff --git a/ext/gd/tests/imagecreate_error.phpt b/ext/gd/tests/imagecreate_error.phpt index b0b6c3abf7e94..3e16c1f034193 100644 --- a/ext/gd/tests/imagecreate_error.phpt +++ b/ext/gd/tests/imagecreate_error.phpt @@ -2,8 +2,8 @@ Testing imagecreate(): error on out of bound parameters --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECT-- Simple test of imagedashedline() function diff --git a/ext/gd/tests/imagefill_1.phpt b/ext/gd/tests/imagefill_1.phpt index f356fe826df43..ea2129b52b0ef 100644 --- a/ext/gd/tests/imagefill_1.phpt +++ b/ext/gd/tests/imagefill_1.phpt @@ -2,12 +2,12 @@ imagefill() infinite loop with wrong color index --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/gd/tests/imagefilledarc_variation1.phpt b/ext/gd/tests/imagefilledarc_variation1.phpt index cc6e01b4ad495..f17651afef249 100644 --- a/ext/gd/tests/imagefilledarc_variation1.phpt +++ b/ext/gd/tests/imagefilledarc_variation1.phpt @@ -7,7 +7,7 @@ Edgar Ferreira da Silva --FILE-- diff --git a/ext/gd/tests/imagefilledarc_variation2.phpt b/ext/gd/tests/imagefilledarc_variation2.phpt index feb81a8e0628c..b388882390983 100644 --- a/ext/gd/tests/imagefilledarc_variation2.phpt +++ b/ext/gd/tests/imagefilledarc_variation2.phpt @@ -7,7 +7,7 @@ Edgar Ferreira da Silva --FILE-- diff --git a/ext/gd/tests/imagefilledpolygon_basic.phpt b/ext/gd/tests/imagefilledpolygon_basic.phpt index 165e685052d47..6462f42de736e 100644 --- a/ext/gd/tests/imagefilledpolygon_basic.phpt +++ b/ext/gd/tests/imagefilledpolygon_basic.phpt @@ -2,7 +2,7 @@ imagefilledpolygon() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- Simple test of imagefilledpolygon() function diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt index f040c5cac4490..a55b88ee90384 100644 --- a/ext/gd/tests/imagefilter.phpt +++ b/ext/gd/tests/imagefilter.phpt @@ -2,10 +2,10 @@ imagefilter() function test --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/gd/tests/imagelayereffect_basic.phpt b/ext/gd/tests/imagelayereffect_basic.phpt index 5a9c380758218..dc41148394b00 100644 --- a/ext/gd/tests/imagelayereffect_basic.phpt +++ b/ext/gd/tests/imagelayereffect_basic.phpt @@ -5,8 +5,8 @@ Rafael Dohms #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest #tek11 --SKIPIF-- --FILE-- --FILE-- --FILE-- diff --git a/ext/gd/tests/imagepolygon_basic.phpt b/ext/gd/tests/imagepolygon_basic.phpt index d4948fcc61016..bea4462c6a160 100644 --- a/ext/gd/tests/imagepolygon_basic.phpt +++ b/ext/gd/tests/imagepolygon_basic.phpt @@ -2,7 +2,7 @@ imagepolygon() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- Simple test of imagepolygon() function diff --git a/ext/gd/tests/imagerotate_overflow.phpt b/ext/gd/tests/imagerotate_overflow.phpt index ade61d8f801ce..34d66862ea5bf 100644 --- a/ext/gd/tests/imagerotate_overflow.phpt +++ b/ext/gd/tests/imagerotate_overflow.phpt @@ -2,13 +2,13 @@ imagerotate() overflow with negative numbers --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- diff --git a/ext/gd/tests/imagesetthickness_basic.phpt b/ext/gd/tests/imagesetthickness_basic.phpt index 376d18f790b91..30bd6094aa083 100644 --- a/ext/gd/tests/imagesetthickness_basic.phpt +++ b/ext/gd/tests/imagesetthickness_basic.phpt @@ -4,8 +4,8 @@ Testing imagetruecolortopalette() of GD library Rafael Dohms --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- #testfest PHPSP on 2009-06-20 --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/gd/tests/imagewbmp_nullbyte_injection.phpt b/ext/gd/tests/imagewbmp_nullbyte_injection.phpt index 8f2bdcec5951e..d7c3f0c41617b 100644 --- a/ext/gd/tests/imagewbmp_nullbyte_injection.phpt +++ b/ext/gd/tests/imagewbmp_nullbyte_injection.phpt @@ -5,7 +5,7 @@ Testing null byte injection in imagewbmp if(!extension_loaded('gd')){ die('skip gd extension not available'); } $support = gd_info(); if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) { - print 'skip wbmp support not available'; + print 'skip wbmp support not available'; } ?> --FILE-- diff --git a/ext/gd/tests/imagewebp_nullbyte_injection.phpt b/ext/gd/tests/imagewebp_nullbyte_injection.phpt index c48fd7d821fd0..52ecc59941247 100644 --- a/ext/gd/tests/imagewebp_nullbyte_injection.phpt +++ b/ext/gd/tests/imagewebp_nullbyte_injection.phpt @@ -5,7 +5,7 @@ Testing null byte injection in imagewebp if(!extension_loaded('gd')){ die('skip gd extension not available'); } $support = gd_info(); if (!isset($support['WebP Support']) || $support['WebP Support'] === false) { - print 'skip webp support not available'; + print 'skip webp support not available'; } ?> --FILE-- diff --git a/ext/gd/tests/jpeg2png.phpt b/ext/gd/tests/jpeg2png.phpt index dfcd1ef1a264f..cae283d10b968 100644 --- a/ext/gd/tests/jpeg2png.phpt +++ b/ext/gd/tests/jpeg2png.phpt @@ -2,16 +2,16 @@ jpeg <--> png conversion test --SKIPIF-- --FILE-- gd1/gd2 conversion test --SKIPIF-- --FILE-- gd1/gd2 conversion test --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- gd1/gd2 conversion test --SKIPIF-- --FILE-- --FILE-- png conversion test --SKIPIF-- --FILE-- gd1/gd2 conversion test --SKIPIF-- --FILE-- jpeg conversion test --SKIPIF-- --FILE-- png conversion test --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/gettext/tests/gettext_basic-enus.phpt b/ext/gettext/tests/gettext_basic-enus.phpt index edbd31cc48180..6fcd5bed80499 100644 --- a/ext/gettext/tests/gettext_basic-enus.phpt +++ b/ext/gettext/tests/gettext_basic-enus.phpt @@ -2,12 +2,12 @@ Gettext basic test with en_US locale that should be on nearly every system --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- = 0 ? (x) : -(x)) ZEND_DECLARE_MODULE_GLOBALS(gmp) static ZEND_GINIT_FUNCTION(gmp); @@ -590,11 +589,8 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base, uint32_t a { switch (Z_TYPE_P(val)) { case IS_LONG: - case IS_FALSE: - case IS_TRUE: { - mpz_set_si(gmpnumber, zval_get_long(val)); + mpz_set_si(gmpnumber, Z_LVAL_P(val)); return SUCCESS; - } case IS_STRING: { char *numstr = Z_STRVAL_P(val); zend_bool skip_lead = 0; @@ -624,14 +620,16 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base, uint32_t a return SUCCESS; } - default: - /* if unserializing */ - if (arg_pos == 0) { - php_error_docref(NULL, E_WARNING, "Cannot convert variable of type %s to GMP", zend_zval_type_name(val)); + default: { + zend_long lval; + if (!zend_parse_arg_long_slow(val, &lval)) { + zend_argument_type_error(arg_pos, "must be of type GMP|string|int, %s given", zend_zval_type_name(val)); return FAILURE; } - zend_argument_type_error(arg_pos, "must be of type GMP|string|int|bool, %s given", zend_zval_type_name(val)); - return FAILURE; + + mpz_set_si(gmpnumber, lval); + return SUCCESS; + } } } /* }}} */ @@ -993,16 +991,16 @@ ZEND_FUNCTION(gmp_export) ZEND_FUNCTION(gmp_intval) { zval *gmpnumber_arg; + mpz_ptr gmpnum; + gmp_temp_t temp_a; if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &gmpnumber_arg) == FAILURE){ RETURN_THROWS(); } - if (IS_GMP(gmpnumber_arg)) { - RETVAL_LONG(mpz_get_si(GET_GMP_FROM_ZVAL(gmpnumber_arg))); - } else { - RETVAL_LONG(zval_get_long(gmpnumber_arg)); - } + FETCH_GMP_ZVAL(gmpnum, gmpnumber_arg, temp_a, 1); + RETVAL_LONG(mpz_get_si(gmpnum)); + FREE_GMP_TEMP(temp_a); } /* }}} */ diff --git a/ext/gmp/gmp.stub.php b/ext/gmp/gmp.stub.php index 6d4390ab411fb..8f2c6ed944fd2 100644 --- a/ext/gmp/gmp.stub.php +++ b/ext/gmp/gmp.stub.php @@ -6,222 +6,105 @@ class GMP { } -/** @param int|bool|string $number */ -function gmp_init($number, int $base = 0): GMP {} +function gmp_init(int|string $number, int $base = 0): GMP {} function gmp_import(string $data, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): GMP {} -/** @param GMP|int|bool|string $gmpnumber */ -function gmp_export($gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {} - -/** @param GMP|int|bool|string $gmpnumber */ -function gmp_intval($gmpnumber): int {} - -/** @param GMP|int|bool|string $gmpnumber */ -function gmp_strval($gmpnumber, int $base = 10): string {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_add($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_sub($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_mul($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_div_qr($a, $b, int $round = GMP_ROUND_ZERO): array {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_div_q($a, $b, int $round = GMP_ROUND_ZERO): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_div_r($a, $b, int $round = GMP_ROUND_ZERO): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - * @alias gmp_div_q - */ -function gmp_div($a, $b, int $round = GMP_ROUND_ZERO): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_mod($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_divexact($a, $b): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_neg($a): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_abs($a): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_fact($a): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_sqrt($a): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_sqrtrem($a): array {} - -/** @param GMP|int|bool|string $a */ -function gmp_root($a, int $nth): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_rootrem($a, int $nth): array {} - -/** @param GMP|int|bool|string $base */ -function gmp_pow($base, int $exp): GMP {} - -/** - * @param GMP|int|bool|string $base - * @param GMP|int|bool|string $exp - * @param GMP|int|bool|string $mod - */ -function gmp_powm($base, $exp, $mod): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_perfect_square($a): bool {} - -/** @param GMP|int|bool|string $a */ -function gmp_perfect_power($a): bool {} - -/** @param GMP|int|bool|string $a */ -function gmp_prob_prime($a, int $reps = 10): int {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_gcd($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_gcdext($a, $b): array {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_lcm($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_invert($a, $b): GMP|false {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_jacobi($a, $b): int {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_legendre($a, $b): int {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_kronecker($a, $b): int {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_cmp($a, $b): int {} - -/** @param GMP|int|bool|string $a */ -function gmp_sign($a): int {} - -/** @param GMP|int|bool|string $seed */ -function gmp_random_seed($seed): void {} +function gmp_export(GMP|int|string $gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {} + +function gmp_intval(GMP|int|string $gmpnumber): int {} + +function gmp_strval(GMP|int|string $gmpnumber, int $base = 10): string {} + +function gmp_add(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_sub(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_mul(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_div_qr(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): array {} + +function gmp_div_q(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {} + +function gmp_div_r(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {} + +/** @alias gmp_div_q */ +function gmp_div(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {} + +function gmp_mod(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_divexact(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_neg(GMP|int|string $a): GMP {} + +function gmp_abs(GMP|int|string $a): GMP {} + +function gmp_fact(GMP|int|string $a): GMP {} + +function gmp_sqrt(GMP|int|string $a): GMP {} + +function gmp_sqrtrem(GMP|int|string $a): array {} + +function gmp_root(GMP|int|string $a, int $nth): GMP {} + +function gmp_rootrem(GMP|int|string $a, int $nth): array {} + +function gmp_pow(GMP|int|string $base, int $exp): GMP {} + +function gmp_powm(GMP|int|string $base, GMP|int|string $exp, GMP|int|string $mod): GMP {} + +function gmp_perfect_square(GMP|int|string $a): bool {} + +function gmp_perfect_power(GMP|int|string $a): bool {} + +function gmp_prob_prime(GMP|int|string $a, int $reps = 10): int {} + +function gmp_gcd(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_gcdext(GMP|int|string $a, GMP|int|string $b): array {} + +function gmp_lcm(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_invert(GMP|int|string $a, GMP|int|string $b): GMP|false {} + +function gmp_jacobi(GMP|int|string $a, GMP|int|string $b): int {} + +function gmp_legendre(GMP|int|string $a, GMP|int|string $b): int {} + +function gmp_kronecker(GMP|int|string $a, GMP|int|string $b): int {} + +function gmp_cmp(GMP|int|string $a, GMP|int|string $b): int {} + +function gmp_sign(GMP|int|string $a): int {} + +function gmp_random_seed(GMP|int|string $seed): void {} function gmp_random_bits(int $bits): GMP {} -/** - * @param GMP|int|bool|string $min - * @param GMP|int|bool|string $max - **/ -function gmp_random_range($min, $max): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_and($a, $b): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_or($a, $b): GMP {} - -/** @param GMP|int|bool|string $a */ -function gmp_com($a): GMP {} - -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_xor($a, $b): GMP {} +function gmp_random_range(GMP|int|string $min, GMP|int|string $max): GMP {} + +function gmp_and(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_or(GMP|int|string $a, GMP|int|string $b): GMP {} + +function gmp_com(GMP|int|string $a): GMP {} + +function gmp_xor(GMP|int|string $a, GMP|int|string $b): GMP {} function gmp_setbit(GMP $a, int $index, bool $set_clear = true): void {} function gmp_clrbit(GMP $a, int $index): void {} -/** @param GMP|int|bool|string $a */ -function gmp_testbit($a, int $index): bool {} +function gmp_testbit(GMP|int|string $a, int $index): bool {} -/** @param GMP|int|bool|string $a */ -function gmp_scan0($a, int $start): int {} +function gmp_scan0(GMP|int|string $a, int $start): int {} -/** @param GMP|int|bool|string $a */ -function gmp_scan1($a, int $start): int {} +function gmp_scan1(GMP|int|string $a, int $start): int {} -/** @param GMP|int|bool|string $a */ -function gmp_popcount($a): int {} +function gmp_popcount(GMP|int|string $a): int {} -/** - * @param GMP|int|bool|string $a - * @param GMP|int|bool|string $b - */ -function gmp_hamdist($a, $b): int {} +function gmp_hamdist(GMP|int|string $a, GMP|int|string $b): int {} -/** @param GMP|int|bool|string $a */ -function gmp_nextprime($a): GMP {} +function gmp_nextprime(GMP|int|string $a): GMP {} -/** @param GMP|int|bool|string $a */ -function gmp_binomial($a, int $b): GMP {} +function gmp_binomial(GMP|int|string $a, int $b): GMP {} diff --git a/ext/gmp/gmp_arginfo.h b/ext/gmp/gmp_arginfo.h index e0fd4f8318635..9f4a44f6d7954 100644 --- a/ext/gmp/gmp_arginfo.h +++ b/ext/gmp/gmp_arginfo.h @@ -1,8 +1,8 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b2bbdaeb1b396bd20eb59eefc92116be80ddb63b */ + * Stub hash: fe4ff47c3359705bf2b1a64a882659fabd370bab */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_init, 0, 1, GMP, 0) - ZEND_ARG_INFO(0, number) + ZEND_ARG_TYPE_MASK(0, number, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -13,23 +13,23 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_import, 0, 1, GMP, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_export, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, gmpnumber) + ZEND_ARG_OBJ_TYPE_MASK(0, gmpnumber, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, word_size, IS_LONG, 0, "1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "GMP_MSW_FIRST | GMP_NATIVE_ENDIAN") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_intval, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, gmpnumber) + ZEND_ARG_OBJ_TYPE_MASK(0, gmpnumber, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_strval, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, gmpnumber) + ZEND_ARG_OBJ_TYPE_MASK(0, gmpnumber, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "10") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_add, 0, 2, GMP, 0) - ZEND_ARG_INFO(0, a) - ZEND_ARG_INFO(0, b) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_sub arginfo_gmp_add @@ -37,14 +37,14 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_mul arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_div_qr, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, a) - ZEND_ARG_INFO(0, b) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, round, IS_LONG, 0, "GMP_ROUND_ZERO") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_div_q, 0, 2, GMP, 0) - ZEND_ARG_INFO(0, a) - ZEND_ARG_INFO(0, b) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, round, IS_LONG, 0, "GMP_ROUND_ZERO") ZEND_END_ARG_INFO() @@ -57,7 +57,7 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_divexact arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_neg, 0, 1, GMP, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_abs arginfo_gmp_neg @@ -67,58 +67,58 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_sqrt arginfo_gmp_neg ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_sqrtrem, 0, 1, IS_ARRAY, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_root, 0, 2, GMP, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, nth, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_rootrem, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, nth, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_pow, 0, 2, GMP, 0) - ZEND_ARG_INFO(0, base) + ZEND_ARG_OBJ_TYPE_MASK(0, base, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, exp, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_powm, 0, 3, GMP, 0) - ZEND_ARG_INFO(0, base) - ZEND_ARG_INFO(0, exp) - ZEND_ARG_INFO(0, mod) + ZEND_ARG_OBJ_TYPE_MASK(0, base, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, exp, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, mod, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_perfect_square, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_perfect_power arginfo_gmp_perfect_square ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_prob_prime, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, reps, IS_LONG, 0, "10") ZEND_END_ARG_INFO() #define arginfo_gmp_gcd arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_gcdext, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, a) - ZEND_ARG_INFO(0, b) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_lcm arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_gmp_invert, 0, 2, GMP, MAY_BE_FALSE) - ZEND_ARG_INFO(0, a) - ZEND_ARG_INFO(0, b) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_jacobi, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, a) - ZEND_ARG_INFO(0, b) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_legendre arginfo_gmp_jacobi @@ -128,11 +128,11 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_cmp arginfo_gmp_jacobi ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_sign, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_random_seed, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, seed) + ZEND_ARG_OBJ_TYPE_MASK(0, seed, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_random_bits, 0, 1, GMP, 0) @@ -140,8 +140,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_random_bits, 0, 1, GMP, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_random_range, 0, 2, GMP, 0) - ZEND_ARG_INFO(0, min) - ZEND_ARG_INFO(0, max) + ZEND_ARG_OBJ_TYPE_MASK(0, min, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, max, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_and arginfo_gmp_add @@ -164,12 +164,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_clrbit, 0, 2, IS_VOID, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_testbit, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_scan0, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -182,7 +182,7 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_nextprime arginfo_gmp_neg ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_binomial, 0, 2, GMP, 0) - ZEND_ARG_INFO(0, a) + ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, b, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/gmp/tests/gmp_abs.phpt b/ext/gmp/tests/gmp_abs.phpt index 3b64004c89eda..0fb8ba5f1a291 100644 --- a/ext/gmp/tests/gmp_abs.phpt +++ b/ext/gmp/tests/gmp_abs.phpt @@ -47,11 +47,11 @@ echo "Done\n"; gmp_abs(): Argument #1 ($a) is not an integer string string(1) "0" string(1) "0" -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int|bool, float given +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, float given string(21) "111111111111111111111" string(21) "111111111111111111111" string(1) "0" gmp_abs(): Argument #1 ($a) is not an integer string gmp_abs(): Argument #1 ($a) is not an integer string -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_and.phpt b/ext/gmp/tests/gmp_and.phpt index 90387e5f64635..26ed3dda3761b 100644 --- a/ext/gmp/tests/gmp_and.phpt +++ b/ext/gmp/tests/gmp_and.phpt @@ -50,7 +50,7 @@ string(4) "4544" gmp_and(): Argument #1 ($a) is not an integer string string(4) "1536" string(15) "424703623692768" -gmp_and(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_and(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_and(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_and(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_and(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_and(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_cmp.phpt b/ext/gmp/tests/gmp_cmp.phpt index 98e3c9ec3e994..35c2796ffaae2 100644 --- a/ext/gmp/tests/gmp_cmp.phpt +++ b/ext/gmp/tests/gmp_cmp.phpt @@ -34,5 +34,5 @@ int(1) int(-1) bool(true) int(0) -gmp_cmp(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_cmp(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_com.phpt b/ext/gmp/tests/gmp_com.phpt index 7f653f7ad3637..71f9f39e96a40 100644 --- a/ext/gmp/tests/gmp_com.phpt +++ b/ext/gmp/tests/gmp_com.phpt @@ -40,5 +40,5 @@ string(7) "-874654" string(4) "9875" string(9) "-98765468" string(12) "-98765463338" -gmp_com(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_com(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_q.phpt b/ext/gmp/tests/gmp_div_q.phpt index c86eb952fe8fe..08d82c6132c62 100644 --- a/ext/gmp/tests/gmp_div_q.phpt +++ b/ext/gmp/tests/gmp_div_q.phpt @@ -76,6 +76,6 @@ object(GMP)#1 (1) { ["num"]=> string(4) "9131" } -gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int|bool, resource given -gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int, resource given +gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_qr.phpt b/ext/gmp/tests/gmp_div_qr.phpt index 7af729804e7aa..03c5facac2a48 100644 --- a/ext/gmp/tests/gmp_div_qr.phpt +++ b/ext/gmp/tests/gmp_div_qr.phpt @@ -159,6 +159,6 @@ array(2) { string(2) "10" } } -gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int|bool, resource given -gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int, resource given +gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_r.phpt b/ext/gmp/tests/gmp_div_r.phpt index 1cf1e66252f50..eab9286fe763b 100644 --- a/ext/gmp/tests/gmp_div_r.phpt +++ b/ext/gmp/tests/gmp_div_r.phpt @@ -76,6 +76,6 @@ object(GMP)#3 (1) { ["num"]=> string(2) "10" } -gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int|bool, resource given -gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int, resource given +gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_divexact.phpt b/ext/gmp/tests/gmp_divexact.phpt index f148693ef3f39..15182bbbee7b3 100644 --- a/ext/gmp/tests/gmp_divexact.phpt +++ b/ext/gmp/tests/gmp_divexact.phpt @@ -4,7 +4,7 @@ gmp_divexact() tests =")) { - die("skip your GMP is too old and will crash"); + die("skip your GMP is too old and will crash"); } ?> --FILE-- diff --git a/ext/gmp/tests/gmp_fact.phpt b/ext/gmp/tests/gmp_fact.phpt index 3829599788e11..81f16019f0928 100644 --- a/ext/gmp/tests/gmp_fact.phpt +++ b/ext/gmp/tests/gmp_fact.phpt @@ -23,12 +23,7 @@ try { echo $e->getMessage() . \PHP_EOL; } -try { - var_dump(gmp_strval(gmp_fact(1.1))); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; -} - +var_dump(gmp_strval(gmp_fact(1.1))); var_dump(gmp_strval(gmp_fact(20))); var_dump(gmp_strval(gmp_fact("50"))); var_dump(gmp_strval(gmp_fact("10"))); @@ -57,12 +52,12 @@ gmp_fact(): Argument #1 ($a) is not an integer string string(1) "1" gmp_fact(): Argument #1 ($a) must be greater than or equal to 0 gmp_fact(): Argument #1 ($a) must be greater than or equal to 0 -gmp_fact(): Argument #1 ($a) must be of type GMP|string|int|bool, float given +string(1) "1" string(19) "2432902008176640000" string(65) "30414093201713378043612608166064768844377641568960512000000000000" string(7) "3628800" string(1) "1" string(9) "479001600" gmp_fact(): Argument #1 ($a) must be greater than or equal to 0 -gmp_fact(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_fact(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_gcdext.phpt b/ext/gmp/tests/gmp_gcdext.phpt index 9619ff755759d..abab8cdfdcd83 100644 --- a/ext/gmp/tests/gmp_gcdext.phpt +++ b/ext/gmp/tests/gmp_gcdext.phpt @@ -63,6 +63,6 @@ string(1) "1" string(1) "1" string(3) "195" string(3) "195" -gmp_gcdext(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_gcdext(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_gcdext(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_gcdext(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_hamdist.phpt b/ext/gmp/tests/gmp_hamdist.phpt index ddaea9f0a4197..c4b28949411fd 100644 --- a/ext/gmp/tests/gmp_hamdist.phpt +++ b/ext/gmp/tests/gmp_hamdist.phpt @@ -42,7 +42,7 @@ int(-1) int(43) int(0) int(26) -gmp_hamdist(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_hamdist(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_hamdist(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_hamdist(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_hamdist(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_hamdist(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_intval.phpt b/ext/gmp/tests/gmp_intval.phpt index 019ab3d070c0e..9540f7a432ca1 100644 --- a/ext/gmp/tests/gmp_intval.phpt +++ b/ext/gmp/tests/gmp_intval.phpt @@ -5,36 +5,47 @@ gmp_intval() tests --FILE-- getMessage(), "\n"; +} +try { + var_dump(gmp_intval(new stdclass)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(gmp_intval(array())); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(gmp_intval("1.0001")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} + echo "Done\n"; ?> ---EXPECTF-- -int(0) -int(1) -int(1) +--EXPECT-- int(-1) int(-1) int(-2349828) int(2342344) - -Notice: Object of class stdClass could not be converted to int in %s on line %d int(1) -int(0) -int(%d) int(12345678) +gmp_intval(): Argument #1 ($gmpnumber) is not an integer string +gmp_intval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, stdClass given +gmp_intval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, array given +gmp_intval(): Argument #1 ($gmpnumber) is not an integer string Done diff --git a/ext/gmp/tests/gmp_invert.phpt b/ext/gmp/tests/gmp_invert.phpt index 8ea60b084789a..b5ab666061a25 100644 --- a/ext/gmp/tests/gmp_invert.phpt +++ b/ext/gmp/tests/gmp_invert.phpt @@ -53,7 +53,7 @@ string(1) "0" string(1) "0" string(22) "3498273496234234523441" string(1) "1" -gmp_invert(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_invert(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_invert(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_invert(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_invert(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_invert(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_jacobi.phpt b/ext/gmp/tests/gmp_jacobi.phpt index 4f40a94828cf7..116442457819b 100644 --- a/ext/gmp/tests/gmp_jacobi.phpt +++ b/ext/gmp/tests/gmp_jacobi.phpt @@ -56,7 +56,7 @@ string(1) "0" string(2) "-1" string(1) "0" string(2) "-1" -gmp_jacobi(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_jacobi(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_jacobi(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_jacobi(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_jacobi(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_jacobi(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_legendre.phpt b/ext/gmp/tests/gmp_legendre.phpt index e52686689e9ca..258e453e4de18 100644 --- a/ext/gmp/tests/gmp_legendre.phpt +++ b/ext/gmp/tests/gmp_legendre.phpt @@ -56,7 +56,7 @@ string(1) "0" string(2) "-1" string(1) "0" string(2) "-1" -gmp_legendre(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_legendre(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_legendre(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_legendre(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_legendre(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_legendre(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_mod.phpt b/ext/gmp/tests/gmp_mod.phpt index a8a56a4d37fb3..90868ab9d99da 100644 --- a/ext/gmp/tests/gmp_mod.phpt +++ b/ext/gmp/tests/gmp_mod.phpt @@ -43,7 +43,7 @@ object(GMP)#2 (1) { string(1) "0" } Modulo by zero -gmp_mod(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_mod(): Argument #1 ($a) must be of type GMP|string|int, array given object(GMP)#4 (1) { ["num"]=> string(5) "31161" diff --git a/ext/gmp/tests/gmp_neg.phpt b/ext/gmp/tests/gmp_neg.phpt index 0bded20758899..5d8e80cd5b620 100644 --- a/ext/gmp/tests/gmp_neg.phpt +++ b/ext/gmp/tests/gmp_neg.phpt @@ -40,5 +40,5 @@ gmp_neg(): Argument #1 ($a) is not an integer string int(0) int(0) string(21) "-12345678901234567890" -gmp_neg(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_neg(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_nextprime.phpt b/ext/gmp/tests/gmp_nextprime.phpt index 6f9e9bfaf6b8f..e2fa2703cbbc8 100644 --- a/ext/gmp/tests/gmp_nextprime.phpt +++ b/ext/gmp/tests/gmp_nextprime.phpt @@ -43,7 +43,7 @@ string(1) "2" string(1) "2" string(4) "1009" string(6) "100003" -gmp_nextprime(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_nextprime(): Argument #1 ($a) must be of type GMP|string|int, array given gmp_nextprime(): Argument #1 ($a) is not an integer string -gmp_nextprime(): Argument #1 ($a) must be of type GMP|string|int|bool, stdClass given +gmp_nextprime(): Argument #1 ($a) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_or.phpt b/ext/gmp/tests/gmp_or.phpt index ad8f26a87afd2..5a34a82addf91 100644 --- a/ext/gmp/tests/gmp_or.phpt +++ b/ext/gmp/tests/gmp_or.phpt @@ -49,7 +49,7 @@ string(3) "-19" gmp_or(): Argument #1 ($a) is not an integer string string(15) "987657876576252" string(21) "987658441719689394144" -gmp_or(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_or(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_or(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_or(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_or(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_or(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_perfect_square.phpt b/ext/gmp/tests/gmp_perfect_square.phpt index 933b2fe9f9c32..d6cd09e40ef49 100644 --- a/ext/gmp/tests/gmp_perfect_square.phpt +++ b/ext/gmp/tests/gmp_perfect_square.phpt @@ -41,5 +41,5 @@ bool(false) bool(false) bool(true) bool(false) -gmp_perfect_square(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_perfect_square(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_popcount.phpt b/ext/gmp/tests/gmp_popcount.phpt index c38cb6f2b8d10..fa1a6172d4fb6 100644 --- a/ext/gmp/tests/gmp_popcount.phpt +++ b/ext/gmp/tests/gmp_popcount.phpt @@ -28,5 +28,5 @@ int(10) int(31) int(-1) int(20) -gmp_popcount(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_popcount(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_pow.phpt b/ext/gmp/tests/gmp_pow.phpt index b70226bb17e35..d4d20f2ce796a 100644 --- a/ext/gmp/tests/gmp_pow.phpt +++ b/ext/gmp/tests/gmp_pow.phpt @@ -57,5 +57,5 @@ gmp_pow(): Argument #2 ($exp) must be greater than or equal to 0 string(14) "10240000000000" string(14) "10240000000000" gmp_pow(): Argument #2 ($exp) must be of type int, array given -gmp_pow(): Argument #1 ($base) must be of type GMP|string|int|bool, array given +gmp_pow(): Argument #1 ($base) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_pown.phpt b/ext/gmp/tests/gmp_pown.phpt index ae3316b1adcdf..76d5576e47581 100644 --- a/ext/gmp/tests/gmp_pown.phpt +++ b/ext/gmp/tests/gmp_pown.phpt @@ -75,10 +75,10 @@ string(3) "171" string(3) "371" Modulo by zero Modulo by zero -gmp_powm(): Argument #1 ($base) must be of type GMP|string|int|bool, array given -gmp_powm(): Argument #2 ($exp) must be of type GMP|string|int|bool, array given -gmp_powm(): Argument #2 ($exp) must be of type GMP|string|int|bool, TypeError given -gmp_powm(): Argument #1 ($base) must be of type GMP|string|int|bool, array given +gmp_powm(): Argument #1 ($base) must be of type GMP|string|int, array given +gmp_powm(): Argument #2 ($exp) must be of type GMP|string|int, array given +gmp_powm(): Argument #2 ($exp) must be of type GMP|string|int, TypeError given +gmp_powm(): Argument #1 ($base) must be of type GMP|string|int, array given gmp_powm(): Argument #2 ($exp) must be greater than or equal to 0 object(GMP)#6 (1) { ["num"]=> diff --git a/ext/gmp/tests/gmp_prob_prime.phpt b/ext/gmp/tests/gmp_prob_prime.phpt index 15c7aaeaa554e..efc5cf4e165ae 100644 --- a/ext/gmp/tests/gmp_prob_prime.phpt +++ b/ext/gmp/tests/gmp_prob_prime.phpt @@ -75,5 +75,5 @@ int(0) int(0) int(0) int(0) -gmp_prob_prime(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_prob_prime(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_scan0.phpt b/ext/gmp/tests/gmp_scan0.phpt index e7b37d48667c2..017148c0119b0 100644 --- a/ext/gmp/tests/gmp_scan0.phpt +++ b/ext/gmp/tests/gmp_scan0.phpt @@ -34,5 +34,5 @@ int(0) int(5) int(200) int(13) -gmp_scan0(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_scan0(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_scan1.phpt b/ext/gmp/tests/gmp_scan1.phpt index 9274a659f4b27..ba480e3e9665e 100644 --- a/ext/gmp/tests/gmp_scan1.phpt +++ b/ext/gmp/tests/gmp_scan1.phpt @@ -34,5 +34,5 @@ int(12) int(9) int(-1) int(10) -gmp_scan1(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_scan1(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_setbit_long.phpt b/ext/gmp/tests/gmp_setbit_long.phpt index 065c8f8208fd6..a967a80d76fd7 100644 --- a/ext/gmp/tests/gmp_setbit_long.phpt +++ b/ext/gmp/tests/gmp_setbit_long.phpt @@ -6,19 +6,19 @@ gmp_setbit() with large index --FILE-- getMessage(), "\n"; +} +try { + gmp_abs(false); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + gmp_abs(true); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + gmp_abs(null); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + gmp_abs([]); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +object(GMP)#2 (1) { + ["num"]=> + string(1) "1" +} +object(GMP)#2 (1) { + ["num"]=> + string(1) "1" +} +object(GMP)#2 (1) { + ["num"]=> + string(1) "1" +} +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, float given +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, bool given +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, bool given +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, null given +gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, array given diff --git a/ext/gmp/tests/gmp_strval.phpt b/ext/gmp/tests/gmp_strval.phpt index 722cdfdd8f583..234465c294a6b 100644 --- a/ext/gmp/tests/gmp_strval.phpt +++ b/ext/gmp/tests/gmp_strval.phpt @@ -67,7 +67,7 @@ echo "Done\n"; --EXPECT-- gmp_strval(): Argument #1 ($gmpnumber) is not an integer string gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 -gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int|bool, resource given +gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, resource given string(7) "9765456" gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 @@ -76,6 +76,6 @@ string(8) "-3373333" gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 string(8) "-3373333" -gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int|bool, array given -gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int|bool, stdClass given +gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, array given +gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_sub.phpt b/ext/gmp/tests/gmp_sub.phpt index 48b1c81092e5c..28a01f86ee640 100644 --- a/ext/gmp/tests/gmp_sub.phpt +++ b/ext/gmp/tests/gmp_sub.phpt @@ -38,7 +38,7 @@ echo "Done\n"; ?> --EXPECT-- gmp_sub(): Argument #1 ($a) is not an integer string -gmp_sub(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_sub(): Argument #1 ($a) must be of type GMP|string|int, array given object(GMP)#1 (1) { ["num"]=> string(2) "-1" @@ -49,6 +49,6 @@ object(GMP)#3 (1) { string(5) "10001" } string(5) "10001" -gmp_sub(): Argument #2 ($b) must be of type GMP|string|int|bool, stdClass given -gmp_sub(): Argument #1 ($a) must be of type GMP|string|int|bool, stdClass given +gmp_sub(): Argument #2 ($b) must be of type GMP|string|int, stdClass given +gmp_sub(): Argument #1 ($a) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_xor.phpt b/ext/gmp/tests/gmp_xor.phpt index fadcd0086e32a..d81b5947fcbde 100644 --- a/ext/gmp/tests/gmp_xor.phpt +++ b/ext/gmp/tests/gmp_xor.phpt @@ -49,7 +49,7 @@ string(5) "-4563" gmp_xor(): Argument #1 ($a) is not an integer string string(15) "987657876574716" string(21) "987658017016065701376" -gmp_xor(): Argument #1 ($a) must be of type GMP|string|int|bool, array given -gmp_xor(): Argument #2 ($b) must be of type GMP|string|int|bool, array given -gmp_xor(): Argument #1 ($a) must be of type GMP|string|int|bool, array given +gmp_xor(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_xor(): Argument #2 ($b) must be of type GMP|string|int, array given +gmp_xor(): Argument #1 ($a) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/overloading.phpt b/ext/gmp/tests/overloading.phpt index e0fa6deb17cdd..75eafa3ee5b71 100644 --- a/ext/gmp/tests/overloading.phpt +++ b/ext/gmp/tests/overloading.phpt @@ -282,7 +282,7 @@ bool(false) bool(true) bool(false) bool(true) -main(): Argument #2 must be of type GMP|string|int|bool, stdClass given +main(): Argument #2 must be of type GMP|string|int, stdClass given object(GMP)#4 (1) { ["num"]=> string(2) "43" diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index d2e9d1aee1019..a8f90cd5ec98c 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -32,7 +32,7 @@ function hash_pbkdf2(string $algo, string $password, string $salt, int $iteratio function hash_equals(string $known_string, string $user_string): bool {} -function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = '', string $salt = ''): string {} +function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = "", string $salt = ""): string {} #ifdef PHP_MHASH_BC function mhash_get_block_size(int $hash): int|false {} diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index 1315f3f118de5..a7837b28481c3 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9280e94fe6bb8b86d0cc6f939996c6c0b0bb9241 */ + * Stub hash: 28ec46ceae7550c9a4103c98fd7c20364f078289 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) @@ -77,8 +77,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_hkdf, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, ikm, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() #if defined(PHP_MHASH_BC) diff --git a/ext/iconv/tests/bug37176.phpt b/ext/iconv/tests/bug37176.phpt index c562ceac850de..d1da176b6a108 100644 --- a/ext/iconv/tests/bug37176.phpt +++ b/ext/iconv/tests/bug37176.phpt @@ -6,7 +6,7 @@ include('skipif.inc'); $test = @iconv_strpos("abbttt","ttt",0,"UTF-8"); if ($test === false) { - die("skip UTF-8 is not supported?"); + die("skip UTF-8 is not supported?"); } ?> diff --git a/ext/iconv/tests/bug37773.phpt b/ext/iconv/tests/bug37773.phpt index e2fb6a55e6a8b..3b520c6e022a3 100644 --- a/ext/iconv/tests/bug37773.phpt +++ b/ext/iconv/tests/bug37773.phpt @@ -6,7 +6,7 @@ include('skipif.inc'); $test = @iconv_strpos("abbttt","ttt",0,"UTF-8"); if ($test === false) { - die("skip UTF-8 is not supported?"); + die("skip UTF-8 is not supported?"); } ?> diff --git a/ext/iconv/tests/iconv002.phpt b/ext/iconv/tests/iconv002.phpt index 6be5a86a69eba..c43402262ece5 100644 --- a/ext/iconv/tests/iconv002.phpt +++ b/ext/iconv/tests/iconv002.phpt @@ -4,7 +4,7 @@ iconv() test 2 (UCS4BE to ASCII) --INI-- diff --git a/ext/imap/php_imap.stub.php b/ext/imap/php_imap.stub.php index fb83dc6c5497f..9d2e1082c1a7c 100644 --- a/ext/imap/php_imap.stub.php +++ b/ext/imap/php_imap.stub.php @@ -35,7 +35,7 @@ function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $sub */ function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {} -function imap_rfc822_parse_headers(string $headers, string $default_host = 'UNKNOWN'): \stdClass {} +function imap_rfc822_parse_headers(string $headers, string $default_host = "UNKNOWN"): stdClass {} function imap_rfc822_write_address(string $mailbox, string $host, string $personal): string|false {} @@ -52,7 +52,7 @@ function imap_fetchtext($stream_id, int $msg_no, int $options = 0): string|false /** * @param resource $stream_id - * @return \stdClass|false + * @return stdClass|false */ function imap_bodystruct($stream_id, int $msg_no, string $section) {} @@ -66,7 +66,7 @@ function imap_fetchmime($stream_id, int $msg_no, string $section, int $options = * @param resource $stream_id * @param resource|string|int $file */ -function imap_savebody($stream_id, $file, int $msg_no, string $section = '', int $options = 0): bool {} +function imap_savebody($stream_id, $file, int $msg_no, string $section = "", int $options = 0): bool {} /** @param resource $stream_id */ function imap_fetchheader($stream_id, int $msg_no, int $options = 0): string|false {} @@ -166,12 +166,12 @@ function imap_utf8(string $mime_encoded_text): string {} /** * @param resource $stream_id - * @return \stdClass|false + * @return stdClass|false */ function imap_status($stream_id, string $mailbox, int $options) {} /** @param resource $stream_id */ -function imap_mailboxmsginfo($stream_id): \stdClass {} +function imap_mailboxmsginfo($stream_id): stdClass {} /** @param resource $stream_id */ function imap_setflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {} @@ -222,7 +222,7 @@ function imap_errors(): array|false {} function imap_last_error(): string|false {} /** @param resource $stream_id */ -function imap_search($stream_id, string $criteria, int $options = \SE_FREE, string $charset = ''): array|false {} +function imap_search($stream_id, string $criteria, int $options = SE_FREE, string $charset = ""): array|false {} function imap_utf7_decode(string $buf): string|false {} @@ -237,7 +237,7 @@ function imap_mutf7_to_utf8(string $in): string|false {} function imap_mime_header_decode(string $str): array|false {} /** @param resource $stream_id */ -function imap_thread($stream_id, int $options = \SE_FREE): array|false {} +function imap_thread($stream_id, int $options = SE_FREE): array|false {} function imap_timeout(int $timeout_type, int $timeout = -1): int|bool {} diff --git a/ext/imap/php_imap_arginfo.h b/ext/imap/php_imap_arginfo.h index fd679f99538d7..69fe25e4d0f4c 100644 --- a/ext/imap/php_imap_arginfo.h +++ b/ext/imap/php_imap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 449bab2357a8a83cbe4f630a87776ebb5e0d65f6 */ + * Stub hash: 4991f82d78672ab23044864fa6dd75851952965c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) @@ -44,7 +44,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_rfc822_parse_headers, 0, 1, stdClass, 0) ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, default_host, IS_STRING, 0, "\'UNKNOWN\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, default_host, IS_STRING, 0, "\"UNKNOWN\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_rfc822_write_address, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) @@ -85,7 +85,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_savebody, 0, 3, _IS_BOOL, 0 ZEND_ARG_INFO(0, stream_id) ZEND_ARG_INFO(0, file) ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, section, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, section, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -265,7 +265,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_search, 0, 2, MAY_BE_ARRAY| ZEND_ARG_INFO(0, stream_id) ZEND_ARG_TYPE_INFO(0, criteria, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "SE_FREE") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_utf7_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) diff --git a/ext/imap/tests/CONFLICTS b/ext/imap/tests/CONFLICTS new file mode 100644 index 0000000000000..c301c0ffaca1d --- /dev/null +++ b/ext/imap/tests/CONFLICTS @@ -0,0 +1 @@ +imap diff --git a/ext/imap/tests/bug45705_1.phpt b/ext/imap/tests/bug45705_1.phpt index f699451407e11..05d3a0a2f6b9d 100644 --- a/ext/imap/tests/bug45705_1.phpt +++ b/ext/imap/tests/bug45705_1.phpt @@ -2,9 +2,9 @@ Bug #45705 test #1 (imap rfc822_parse_adrlist() modifies passed address parameter) --SKIPIF-- --FILE-- --FILE-- getMessage() . "\n"; +} catch (\TypeError $e) { + echo $e->getMessage() . "\n"; } fclose($var1); @@ -22,5 +22,4 @@ unlink($fn); ?> --EXPECTF-- Warning: imap_append(): Internal date not correctly formatted in %s on line %d - -Exception: imap_append(): Supplied resource is not a valid imap resource +imap_append(): supplied resource is not a valid imap resource diff --git a/ext/imap/tests/bug77153.phpt b/ext/imap/tests/bug77153.phpt index 63590aee1dde4..7b759621fe16f 100644 --- a/ext/imap/tests/bug77153.phpt +++ b/ext/imap/tests/bug77153.phpt @@ -2,8 +2,8 @@ Bug #77153 (imap_open allows to run arbitrary shell commands via mailbox parameter) --SKIPIF-- --FILE-- diff --git a/ext/imap/tests/dovecot.conf b/ext/imap/tests/dovecot.conf new file mode 100644 index 0000000000000..c465ba3ce9121 --- /dev/null +++ b/ext/imap/tests/dovecot.conf @@ -0,0 +1,33 @@ +# 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf +# Pigeonhole version 0.4.21 (92477967) +listen = *, :: + +# To make authentication work +ssl = no +disable_plaintext_auth = no + +auth_mechanisms = plain cram-md5 +auth_username_format = %u +auth_debug = yes +auth_verbose = yes +#log +log_path = /var/log/dovecot.log +# If not set, use the value from log_path +info_log_path = /var/log/dovecot-info.log +# If not set, use the value from info_log_path +debug_log_path = /var/log/dovecot-debug.log +## Mailbox locations and namespaces +mail_location = maildir:/var/vmail/dovecot/mail/%d/%n/Maildir +passdb { + args = scheme=cram-md5 /etc/dovecot/dovecotpass + driver = passwd-file +} +protocols = imap +service auth { + user = root +} +userdb { + args = /etc/dovecot/dovecotpass + driver = passwd-file + override_fields = home=/var/vmail/dovecot/mail/%d/%n +} diff --git a/ext/imap/tests/dovecotpass b/ext/imap/tests/dovecotpass new file mode 100644 index 0000000000000..86a069fc4f699 --- /dev/null +++ b/ext/imap/tests/dovecotpass @@ -0,0 +1 @@ +webmaster@something.com:{CRAM-MD5}be5f3177e9c7c06403272f25d983ba630df4ef40476b353bb3087a8401713451:vmail:vmail diff --git a/ext/imap/tests/imap_body.phpt b/ext/imap/tests/imap_body.phpt index a4e8069d040d9..4d4133c343fc7 100644 --- a/ext/imap/tests/imap_body.phpt +++ b/ext/imap/tests/imap_body.phpt @@ -9,16 +9,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_body() expects at least 2 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d - -Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d - -Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d - Warning: imap_body(): Bad message number in %s on line %d Warning: imap_body(): Invalid value for the options parameter in %s on line %d diff --git a/ext/imap/tests/imap_fetch_overview_variation3.phpt b/ext/imap/tests/imap_fetch_overview_variation3.phpt index 13b5591dc5b0e..419de4c95152f 100644 --- a/ext/imap/tests/imap_fetch_overview_variation3.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation3.phpt @@ -58,7 +58,7 @@ imap_fetch_overview() returns an object Testing with option value:bool(true) imap_fetch_overview() returns an object -Testing with option value:float(1) +Testing with option value:float(1.000000000000001) imap_fetch_overview() returns an object Testing with option value:float(1) diff --git a/ext/imap/tests/imap_fetchbody_variation6.phpt b/ext/imap/tests/imap_fetchbody_variation6.phpt index 20ac49edc8a38..75516f8381454 100644 --- a/ext/imap/tests/imap_fetchbody_variation6.phpt +++ b/ext/imap/tests/imap_fetchbody_variation6.phpt @@ -19,9 +19,7 @@ require_once(__DIR__.'/imap_include.inc'); $stream_id = setup_test_mailbox('', 3); // set up temp mailbox with simple msgs $section = 1; -$sequences = array (0, 4, // out of range - '1,3', '1:3', // message sequences instead of numbers - ); +$sequences = [0, /* out of range */ 4, 1]; foreach($sequences as $msg_no) { echo "\n-- \$msg_no is $msg_no --\n"; @@ -52,12 +50,6 @@ Warning: imap_fetchbody(): Bad message number in %s on line %d bool(false) --- $msg_no is 1,3 -- - -Notice: A non well formed numeric value encountered in %s on line %d -string(%d) "1: this is a test message, please ignore%a" - --- $msg_no is 1:3 -- - -Notice: A non well formed numeric value encountered in %s on line %d -string(%d) "1: this is a test message, please ignore%a" +-- $msg_no is 1 -- +string(42) "1: this is a test message, please ignore +" diff --git a/ext/imap/tests/imap_fetchheader_variation5.phpt b/ext/imap/tests/imap_fetchheader_variation5.phpt index 7ff8ca697e777..2283861df8e8a 100644 --- a/ext/imap/tests/imap_fetchheader_variation5.phpt +++ b/ext/imap/tests/imap_fetchheader_variation5.phpt @@ -17,9 +17,7 @@ require_once(__DIR__.'/imap_include.inc'); $stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple'); // set up temp mailbox with 3 msgs -$sequences = array (0, 4, // out of range - '1,3', '1:3', // message sequences instead of numbers - ); +$sequences = [0, /* out of range */ 4, 1]; foreach($sequences as $msg_no) { echo "\n-- \$msg_no is $msg_no --\n"; @@ -53,24 +51,11 @@ Warning: imap_fetchheader(): Bad message number in %s on line %d bool(false) --- $msg_no is 1,3 -- - -Notice: A non well formed numeric value encountered in %s on line %d -string(%d) "From: foo@anywhere.com -Subject: Test msg 1 -To: %s -MIME-Version: 1.0 -Content-Type: MULTIPART/mixed; BOUNDARY="%s" - -" - --- $msg_no is 1:3 -- - -Notice: A non well formed numeric value encountered in %s on line %d +-- $msg_no is 1 -- string(%d) "From: foo@anywhere.com Subject: Test msg 1 -To: %s +To: webmaster@something.com MIME-Version: 1.0 -Content-Type: MULTIPART/mixed; BOUNDARY="%s" +Content-Type: MULTIPART/mixed; BOUNDARY="%s=:%d" " diff --git a/ext/imap/tests/imap_fetchstructure_basic.phpt b/ext/imap/tests/imap_fetchstructure_basic.phpt index 0ff266a390c83..572556e6e13d1 100644 --- a/ext/imap/tests/imap_fetchstructure_basic.phpt +++ b/ext/imap/tests/imap_fetchstructure_basic.phpt @@ -8,17 +8,10 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_fetchstructure() expects at least 2 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d - -Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created - -Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d +.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created bool(true) bool(true) bool(true) diff --git a/ext/imap/tests/imap_gc_error.phpt b/ext/imap/tests/imap_gc_error.phpt index 2d825ce1fdf19..072af103930cb 100644 --- a/ext/imap/tests/imap_gc_error.phpt +++ b/ext/imap/tests/imap_gc_error.phpt @@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_gc() Expects exactly 2 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_gc(): Argument #1 must be of type resource, string given in %s on line %d - -Warning: imap_gc(): Argument #1 must be of type resource, bool given in %s on line %d - Warning: imap_gc(): Invalid value for the flags parameter in %s on line %d diff --git a/ext/imap/tests/imap_getsubscribed_basic.phpt b/ext/imap/tests/imap_getsubscribed_basic.phpt index 8995eadd05289..bba82271c7ca3 100644 --- a/ext/imap/tests/imap_getsubscribed_basic.phpt +++ b/ext/imap/tests/imap_getsubscribed_basic.phpt @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_getsubscribed() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_getsubscribed() expects exactly 3 parameters, 2 given in %s on line %d bool(false) Checking OK bool(true) diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc index 7de634075a295..e57d6516979f2 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/imap_include.inc @@ -1,6 +1,6 @@ --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_list() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_list() expects exactly 3 parameters, 2 given in %s on line %d bool(true) string(%s) "{%s}%s" diff --git a/ext/imap/tests/imap_lsub_basic.phpt b/ext/imap/tests/imap_lsub_basic.phpt index 591a023ed8696..98875266d7406 100644 --- a/ext/imap/tests/imap_lsub_basic.phpt +++ b/ext/imap/tests/imap_lsub_basic.phpt @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_lsub() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_lsub() expects exactly 3 parameters, 2 given in %s on line %d bool(false) Checking OK bool(true) diff --git a/ext/imap/tests/imap_open_error.phpt b/ext/imap/tests/imap_open_error.phpt index b94c11d797afd..f9410519f2159 100644 --- a/ext/imap/tests/imap_open_error.phpt +++ b/ext/imap/tests/imap_open_error.phpt @@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_open() expects at least 3 parameters, 0 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d - -Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d Checking with incorrect parameters Warning: imap_open(): Couldn't open stream in %s on line %d diff --git a/ext/imap/tests/imap_renamemailbox_basic.phpt b/ext/imap/tests/imap_renamemailbox_basic.phpt index ee5ccb2be7234..c6b1812d165b5 100644 --- a/ext/imap/tests/imap_renamemailbox_basic.phpt +++ b/ext/imap/tests/imap_renamemailbox_basic.phpt @@ -8,13 +8,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_renamemailbox() expects exactly 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d Create a temporary mailbox and add 1 msgs .. mailbox '{%s}%s' created - -Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d - -Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d Checking OK bool(true) bool(true) diff --git a/ext/imap/tests/imap_savebody_basic.phpt b/ext/imap/tests/imap_savebody_basic.phpt index 2be987a3617c3..ccbaa1ba66cc4 100644 --- a/ext/imap/tests/imap_savebody_basic.phpt +++ b/ext/imap/tests/imap_savebody_basic.phpt @@ -8,18 +8,10 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_savebody() expects at least 3 parameters, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d - -Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d Create a temporary mailbox and add 1 msgs -.. mailbox '{%s}%s' created - -Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d +.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created bool(true) Size: %d bool(true) diff --git a/ext/imap/tests/imap_timeout_basic.phpt b/ext/imap/tests/imap_timeout_basic.phpt index e1b958b3c77ef..f9618c3e3a33d 100644 --- a/ext/imap/tests/imap_timeout_basic.phpt +++ b/ext/imap/tests/imap_timeout_basic.phpt @@ -8,12 +8,6 @@ require_once(__DIR__.'/skipif.inc'); ?> --FILE-- --EXPECTF-- -Checking with no parameters - -Warning: imap_timeout() expects at least 1 argument, 0 given in %s on line %d -Checking with incorrect parameter type - -Warning: imap_timeout(): Argument #1 must be of type int, %s given in %s on line %d GET values: int(%d) int(%d) diff --git a/ext/imap/tests/setup.sh b/ext/imap/tests/setup.sh new file mode 100644 index 0000000000000..5cb18334a3f95 --- /dev/null +++ b/ext/imap/tests/setup.sh @@ -0,0 +1,6 @@ +sudo service dovecot stop +sudo groupadd -g 5000 vmail +sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail +sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf +sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass +sudo service dovecot start diff --git a/ext/imap/tests/skipif.inc b/ext/imap/tests/skipif.inc index 2820bff5c69f4..2167ad1d0cd65 100644 --- a/ext/imap/tests/skipif.inc +++ b/ext/imap/tests/skipif.inc @@ -2,7 +2,7 @@ extension_loaded('imap') or die('skip imap extension not available in this build'); // Change these to make tests run successfully -$mailbox = '{localhost/norsh}'; +$mailbox = '{127.0.0.1:143/debug/norsh}'; $username = 'webmaster@something.com'; $password = 'p4ssw0rd'; $options = OP_HALFOPEN; // this should be enough to verify server present diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php index f2a1af1c2e2e0..67bd27be92a0f 100644 --- a/ext/intl/php_intl.stub.php +++ b/ext/intl/php_intl.stub.php @@ -5,7 +5,7 @@ /* calendar */ /** @param IntlTimeZone|DateTimeZone|string|null $timeZone */ -function intlcal_create_instance($timeZone = null, ?string $locale = null): IntlCalendar|null {} +function intlcal_create_instance($timeZone = null, ?string $locale = null): ?IntlCalendar {} function intlcal_get_keyword_values_for_locale(string $key, string $locale, bool $commonlyUsed): IntlIterator|false {} diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h index 32f098d0bb878..1b1c0ea84dcf2 100644 --- a/ext/intl/php_intl_arginfo.h +++ b/ext/intl/php_intl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 324b7ae3eaab4777117c1c6963bc841088e6b998 */ + * Stub hash: 943baf02eee2f720a45106e379534b3d4adc3072 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null") diff --git a/ext/intl/tests/breakiter___construct.phpt b/ext/intl/tests/breakiter___construct.phpt index 16ca32bf184f6..716de728ae7b6 100644 --- a/ext/intl/tests/breakiter___construct.phpt +++ b/ext/intl/tests/breakiter___construct.phpt @@ -3,7 +3,7 @@ IntlBreakIterator::__construct() should not be callable --SKIPIF-- 0) die('skip for ICU <= 57.1'); ?> --FILE-- diff --git a/ext/intl/tests/breakiter_getPartsIterator_basic2.phpt b/ext/intl/tests/breakiter_getPartsIterator_basic2.phpt index 834da13ecea7d..826f57e45ab9e 100644 --- a/ext/intl/tests/breakiter_getPartsIterator_basic2.phpt +++ b/ext/intl/tests/breakiter_getPartsIterator_basic2.phpt @@ -3,7 +3,7 @@ IntlBreakIterator::getPartsIterator(): basic test, ICU >= 58.1 --SKIPIF-- = 58.1'); ?> --FILE-- diff --git a/ext/intl/tests/breakiter_getPartsIterator_error.phpt b/ext/intl/tests/breakiter_getPartsIterator_error.phpt index f86e64d4ccdd7..cd518b19d4d02 100644 --- a/ext/intl/tests/breakiter_getPartsIterator_error.phpt +++ b/ext/intl/tests/breakiter_getPartsIterator_error.phpt @@ -3,7 +3,7 @@ IntlBreakIterator::getPartsIterator(): bad args --SKIPIF-- 0) die('skip for ICU <= 57.1'); ?> --FILE-- diff --git a/ext/intl/tests/breakiter_preceding_basic2.phpt b/ext/intl/tests/breakiter_preceding_basic2.phpt index 8c1ee625e4517..53446b2f6bc2c 100644 --- a/ext/intl/tests/breakiter_preceding_basic2.phpt +++ b/ext/intl/tests/breakiter_preceding_basic2.phpt @@ -3,7 +3,7 @@ IntlBreakIterator::preceding(): basic test, ICU >= 58.1 --SKIPIF-- = 58.1'); --FILE-- = 0) - die('skip for ICU < 51.2'); + die('skip for ICU < 51.2'); ?> --FILE-- = 51.2'); + die('skip for ICU >= 51.2'); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- = 0) - die('skip for ICU < 52.1'); + die('skip for ICU < 52.1'); --FILE-- = 52.1'); + die('skip for ICU >= 52.1'); --FILE-- getConstant("SINGLE_SCRIPT_RESTRICTIVE")) { - die("skip Incompatible ICU version"); - } + $r = new ReflectionClass("SpoofChecker"); + if (false === $r->getConstant("SINGLE_SCRIPT_RESTRICTIVE")) { + die("skip Incompatible ICU version"); + } ?> --FILE-- + die('skip intl extension not enabled'); ?> = 52'); ?> = 0) die('skip for ICU <= 57.1'); ?> --FILE-- diff --git a/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt b/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt index 5008c2b66ab95..064c5826d8743 100644 --- a/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt +++ b/ext/intl/tests/timezone_IDforWindowsID_basic2.phpt @@ -3,7 +3,7 @@ IntlTimeZone::getIDForWindowsID basic test --SKIPIF-- + die('skip intl extension not enabled'); ?> = 58.1'); ?> --FILE-- int cast behavior. */ $arch = php_uname('m'); if ($arch != 'x86_64' && $arch != 'i386') diff --git a/ext/intl/tests/timezone_getErrorCode_error.phpt b/ext/intl/tests/timezone_getErrorCode_error.phpt index c20e3c666a020..c44a9107261fd 100644 --- a/ext/intl/tests/timezone_getErrorCode_error.phpt +++ b/ext/intl/tests/timezone_getErrorCode_error.phpt @@ -3,7 +3,7 @@ IntlTimeZone::getErrorCode(): errors --SKIPIF-- int cast behavior. */ $arch = php_uname('m'); diff --git a/ext/intl/tests/timezone_getRawOffset_basic.phpt b/ext/intl/tests/timezone_getRawOffset_basic.phpt index bfbf2710cac34..6f85e9fc9c6f2 100644 --- a/ext/intl/tests/timezone_getRawOffset_basic.phpt +++ b/ext/intl/tests/timezone_getRawOffset_basic.phpt @@ -3,7 +3,7 @@ IntlTimeZone::getRawOffset(): basic test --SKIPIF-- + die('skip intl extension not enabled'); ?> = 52'); ?> = 0) die('skip for ICU <= 57.1'); ?> --FILE-- diff --git a/ext/intl/tests/timezone_windowsID_basic2.phpt b/ext/intl/tests/timezone_windowsID_basic2.phpt index 7c00b646b6484..32f80596c4bfe 100644 --- a/ext/intl/tests/timezone_windowsID_basic2.phpt +++ b/ext/intl/tests/timezone_windowsID_basic2.phpt @@ -3,7 +3,7 @@ IntlTimeZone::getWindowsID basic test --SKIPIF-- + die('skip intl extension not enabled'); ?> = 58.1'); ?> --FILE-- --INI-- diff --git a/ext/json/tests/bug42785.phpt b/ext/json/tests/bug42785.phpt index 7c39f4c8e2992..698f193a70881 100644 --- a/ext/json/tests/bug42785.phpt +++ b/ext/json/tests/bug42785.phpt @@ -5,7 +5,7 @@ serialize_precision=-1 --SKIPIF-- --FILE-- diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index e46d1405453e8..372458fe78b9e 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -193,7 +193,7 @@ function ldap_compare($link_identifier, string $dn, string $attribute, string $v * @param resource $link * @deprecated since 7.4 */ -function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ''): bool {} +function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): bool {} /** * @param resource $link @@ -281,7 +281,7 @@ function ldap_set_rebind_proc($link, ?callable $callback): bool {} function ldap_start_tls($link_identifier): bool {} #endif -function ldap_escape(string $value, string $ignore = '', int $flags = 0): string {} +function ldap_escape(string $value, string $ignore = "", int $flags = 0): string {} #ifdef STR_TRANSLATION function ldap_t61_to_8859(string $value): string|false {} @@ -305,7 +305,7 @@ function ldap_exop($link, string $reqoid, ?string $reqdata = null, ?array $serve * @param resource $link * @param array $serverctrls */ -function ldap_exop_passwd($link, string $user = '', string $oldpw = '', string $newpw = '', &$serverctrls = null): string|bool {} +function ldap_exop_passwd($link, string $user = "", string $oldpw = "", string $newpw = "", &$serverctrls = null): string|bool {} #endif diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h index 5e4cd4281c16d..d610408d97423 100644 --- a/ext/ldap/ldap_arginfo.h +++ b/ext/ldap/ldap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c247d438a69d40353a629b09c5200d33ed8218ee */ + * Stub hash: f07138972651411473c34c5ee2d0c2de94e01ada */ #if defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) @@ -192,7 +192,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_control_paged_result, 0, 2, ZEND_ARG_INFO(0, link) ZEND_ARG_TYPE_INFO(0, pagesize, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iscritical, _IS_BOOL, 0, "false") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookie, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookie, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() #endif @@ -299,7 +299,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_escape, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -327,9 +327,9 @@ ZEND_END_ARG_INFO() #if defined(HAVE_LDAP_PASSWD) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_exop_passwd, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, oldpw, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, newpw, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, oldpw, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, newpw, IS_STRING, 0, "\"\"") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, serverctrls, "null") ZEND_END_ARG_INFO() #endif diff --git a/ext/ldap/tests/ldap_exop_refresh.phpt b/ext/ldap/tests/ldap_exop_refresh.phpt index b90a92bc00a65..b7e7835f384cc 100644 --- a/ext/ldap/tests/ldap_exop_refresh.phpt +++ b/ext/ldap/tests/ldap_exop_refresh.phpt @@ -6,12 +6,12 @@ Emmanuel Dreyfus --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --FILE-- --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --INI-- diff --git a/ext/mbstring/tests/htmlent.phpt b/ext/mbstring/tests/htmlent.phpt index eb251efd7bf81..cecd1c35393be 100644 --- a/ext/mbstring/tests/htmlent.phpt +++ b/ext/mbstring/tests/htmlent.phpt @@ -2,8 +2,8 @@ HTML input/output --SKIPIF-- --INI-- output_buffering=4096 diff --git a/ext/mbstring/tests/mb_send_mail01.phpt b/ext/mbstring/tests/mb_send_mail01.phpt index 283ff11d6baab..96eecbb625601 100644 --- a/ext/mbstring/tests/mb_send_mail01.phpt +++ b/ext/mbstring/tests/mb_send_mail01.phpt @@ -3,10 +3,10 @@ mb_send_mail() test 1 (lang=neutral) --SKIPIF-- --INI-- diff --git a/ext/mbstring/tests/mb_send_mail02.phpt b/ext/mbstring/tests/mb_send_mail02.phpt index 06b85c691f5bd..026d794e40e05 100644 --- a/ext/mbstring/tests/mb_send_mail02.phpt +++ b/ext/mbstring/tests/mb_send_mail02.phpt @@ -3,10 +3,10 @@ mb_send_mail() test 2 (lang=Japanese) --SKIPIF-- --INI-- diff --git a/ext/mbstring/tests/mb_send_mail03.phpt b/ext/mbstring/tests/mb_send_mail03.phpt index 3d5ffd5659535..acc152f720363 100644 --- a/ext/mbstring/tests/mb_send_mail03.phpt +++ b/ext/mbstring/tests/mb_send_mail03.phpt @@ -3,10 +3,10 @@ mb_send_mail() test 3 (lang=English) --SKIPIF-- --INI-- diff --git a/ext/mbstring/tests/mb_send_mail04.phpt b/ext/mbstring/tests/mb_send_mail04.phpt index 2eccb87189aaa..9e68128140731 100644 --- a/ext/mbstring/tests/mb_send_mail04.phpt +++ b/ext/mbstring/tests/mb_send_mail04.phpt @@ -3,10 +3,10 @@ mb_send_mail() test 4 (lang=German) --SKIPIF-- --INI-- diff --git a/ext/mbstring/tests/mb_send_mail05.phpt b/ext/mbstring/tests/mb_send_mail05.phpt index 53d97ef3d18b2..f4c07e26f8b2b 100644 --- a/ext/mbstring/tests/mb_send_mail05.phpt +++ b/ext/mbstring/tests/mb_send_mail05.phpt @@ -3,13 +3,13 @@ mb_send_mail() test 5 (lang=Simplified Chinese) --SKIPIF-- --INI-- diff --git a/ext/mbstring/tests/mb_send_mail06.phpt b/ext/mbstring/tests/mb_send_mail06.phpt index 44a877aaee528..521a976ca39c5 100644 --- a/ext/mbstring/tests/mb_send_mail06.phpt +++ b/ext/mbstring/tests/mb_send_mail06.phpt @@ -3,13 +3,13 @@ mb_send_mail() test 6 (lang=Traditional Chinese) --SKIPIF-- --INI-- diff --git a/ext/mbstring/tests/mb_send_mail07.phpt b/ext/mbstring/tests/mb_send_mail07.phpt index 9640abc1e88a0..eb702b690ae4e 100644 --- a/ext/mbstring/tests/mb_send_mail07.phpt +++ b/ext/mbstring/tests/mb_send_mail07.phpt @@ -3,13 +3,13 @@ mb_send_mail() test 7 (lang=Korean) --SKIPIF-- --INI-- diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index c38f013583da7..b57ce197a946c 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -47,14 +47,8 @@ if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then elif test "$PHP_MYSQLI" != "no"; then MYSQL_CONFIG=$PHP_MYSQLI - MYSQL_LIB_NAME='mysqlclient' - if test "$enable_zts" = "yes"; then - MYSQL_LIB_CFG='--libs_r' - MYSQL_LIB_NAME='mysqlclient_r' - else - MYSQL_LIB_CFG='--libs' - fi + MYSQL_LIB_CFG='--libs' if test -x "$MYSQL_CONFIG" && $MYSQL_CONFIG $MYSQL_LIB_CFG > /dev/null 2>&1; then MYSQLI_INCLINE=`$MYSQL_CONFIG --cflags | $SED -e "s/'//g"` @@ -81,16 +75,6 @@ elif test "$PHP_MYSQLI" != "no"; then ],[ $MYSQLI_LIBLINE ]) - dnl - dnl Check the library for mysql_stmt_next_result - dnl - PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_stmt_next_result, - [ - AC_DEFINE(HAVE_STMT_NEXT_RESULT, 1, [ ]) - ],[ - ],[ - $MYSQLI_LIBLINE - ]) fi dnl Build extension diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index e056ceba2dabd..9eb1885ea6ffb 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -521,7 +521,6 @@ static PHP_GINIT_FUNCTION(mysqli) mysqli_globals->report_mode = 0; mysqli_globals->report_ht = 0; mysqli_globals->allow_local_infile = 0; - mysqli_globals->embedded = 0; mysqli_globals->rollback_on_cached_plink = FALSE; } /* }}} */ @@ -659,7 +658,7 @@ PHP_MINIT_FUNCTION(mysqli) #ifdef MYSQLND_STRING_TO_INT_CONVERSION REGISTER_LONG_CONSTANT("MYSQLI_OPT_INT_AND_FLOAT_NATIVE", MYSQLND_OPT_INT_AND_FLOAT_NATIVE, CONST_CS | CONST_PERSISTENT); #endif -#if MYSQL_VERSION_ID > 50110 || defined(MYSQLI_USE_MYSQLND) +#if MYSQL_VERSION_ID < 80000 || MYSQL_VERSION_ID >= 100000 || defined(MYSQLI_USE_MYSQLND) REGISTER_LONG_CONSTANT("MYSQLI_OPT_SSL_VERIFY_SERVER_CERT", MYSQL_OPT_SSL_VERIFY_SERVER_CERT, CONST_CS | CONST_PERSISTENT); #endif @@ -727,7 +726,7 @@ PHP_MINIT_FUNCTION(mysqli) REGISTER_LONG_CONSTANT("MYSQLI_BINARY_FLAG", BINARY_FLAG, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MYSQLI_NO_DEFAULT_VALUE_FLAG", NO_DEFAULT_VALUE_FLAG, CONST_CS | CONST_PERSISTENT); -#if (MYSQL_VERSION_ID > 51122 && MYSQL_VERSION_ID < 60000) || (MYSQL_VERSION_ID > 60003) || defined(MYSQLI_USE_MYSQLND) +#if MYSQL_VERSION_ID < 60000 || MYSQL_VERSION_ID > 60003 || defined(MYSQLI_USE_MYSQLND) REGISTER_LONG_CONSTANT("MYSQLI_ON_UPDATE_NOW_FLAG", ON_UPDATE_NOW_FLAG, CONST_CS | CONST_PERSISTENT); #endif @@ -1095,6 +1094,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend case 3:llval = (my_ulonglong) bit_uint3korr(row[i]);break; case 2:llval = (my_ulonglong) bit_uint2korr(row[i]);break; case 1:llval = (my_ulonglong) uint1korr(row[i]);break; + EMPTY_SWITCH_DEFAULT_CASE() } /* even though lval is declared as unsigned, the value * may be negative. Therefor we cannot use MYSQLI_LLU_SPEC and must diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index de74bba8e128f..9d557fe7462e0 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -572,7 +572,9 @@ function mysqli_fetch_field_direct(mysqli_result $mysql_result, int $offset): ob function mysqli_fetch_lengths(mysqli_result $mysql_result): array|false {} +#if defined(MYSQLI_USE_MYSQLND) function mysqli_fetch_all(mysqli_result $mysql_result, int $mode = MYSQLI_NUM): array|false {} +#endif function mysqli_fetch_array(mysqli_result $mysql_result, int $fetchtype = MYSQLI_BOTH): array|null|false {} @@ -590,9 +592,11 @@ function mysqli_field_tell(mysqli_result $mysqli_result): int {} function mysqli_free_result(mysqli_result $mysqli_result): void {} +#if defined(MYSQLI_USE_MYSQLND) function mysqli_get_connection_stats(mysqli $mysqli_link): array {} function mysqli_get_client_stats(): array {} +#endif function mysqli_get_charset(mysqli $mysqli_link): ?object {} @@ -635,7 +639,9 @@ function mysqli_options(mysqli $mysqli_link, int $option, $value): bool {} function mysqli_ping(mysqli $mysqli_link): bool {} +#if defined(MYSQLI_USE_MYSQLND) function mysqli_poll(?array &$read, ?array &$write, array &$error, int $sec, int $usec = 0): int|false {} +#endif function mysqli_prepare(mysqli $mysqli_link, string $query): mysqli_stmt|false {} @@ -658,7 +664,9 @@ function mysqli_real_escape_string(mysqli $mysqli_link, string $string_to_escape function mysqli_real_query(mysqli $mysqli_link, string $query): bool {} +#if defined(MYSQLI_USE_MYSQLND) function mysqli_reap_async_query(mysqli $mysqli_link): mysqli_result|bool {} +#endif function mysqli_release_savepoint(mysqli $mysqli_link, string $name): bool {} @@ -696,7 +704,9 @@ function mysqli_stmt_field_count(mysqli_stmt $mysql_stmt): int {} function mysqli_stmt_free_result(mysqli_stmt $mysql_stmt): void {} +#if defined(MYSQLI_USE_MYSQLND) function mysqli_stmt_get_result(mysqli_stmt $mysql_stmt): mysqli_result|false {} +#endif function mysqli_stmt_get_warnings(mysqli_stmt $mysql_stmt): mysqli_warning|false {} @@ -704,9 +714,11 @@ function mysqli_stmt_init(mysqli $mysql_link): mysqli_stmt|false {} function mysqli_stmt_insert_id(mysqli_stmt $mysql_stmt): int|string {} +#if defined(MYSQLI_USE_MYSQLND) function mysqli_stmt_more_results(mysqli_stmt $mysql_stmt): bool {} function mysqli_stmt_next_result(mysqli_stmt $mysql_stmt): bool {} +#endif function mysqli_stmt_num_rows(mysqli_stmt $mysql_stmt): int|string {} diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 88e6e91cd151a..2263c75434e34 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -370,7 +370,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc) int size; char *p = emalloc(size= var_cnt * (sizeof(char) + sizeof(VAR_BUFFER))); stmt->result.buf = (VAR_BUFFER *) p; - stmt->result.is_null = p + var_cnt * sizeof(VAR_BUFFER); + stmt->result.is_null = (my_bool *) (p + var_cnt * sizeof(VAR_BUFFER)); memset(p, 0, size); } @@ -457,12 +457,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc) case MYSQL_TYPE_NEWDECIMAL: #endif { -#if MYSQL_VERSION_ID >= 50107 - /* Changed to my_bool in MySQL 5.1. See MySQL Bug #16144 */ my_bool tmp; -#else - zend_ulong tmp = 0; -#endif stmt->result.buf[ofs].type = IS_STRING; /* If the user has called $stmt->store_result() then we have asked @@ -577,7 +572,7 @@ PHP_FUNCTION(mysqli_change_user) size_t user_len, password_len, dbname_len; zend_ulong rc; #ifndef MYSQLI_USE_MYSQLND - const CHARSET_INFO * old_charset; + MY_CHARSET_INFO old_charset; #endif if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) { @@ -586,7 +581,7 @@ PHP_FUNCTION(mysqli_change_user) MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); #ifndef MYSQLI_USE_MYSQLND - old_charset = mysql->mysql->charset; + mysql_get_character_set_info(mysql->mysql, &old_charset); #endif #ifdef MYSQLI_USE_MYSQLND @@ -606,7 +601,7 @@ PHP_FUNCTION(mysqli_change_user) 5.0 doesn't support it. Support added in 5.1.23 by fixing the following bug : Bug #30472 libmysql doesn't reset charset, insert_id after succ. mysql_change_user() call */ - rc = mysql_set_character_set(mysql->mysql, old_charset->csname); + rc = mysql_set_character_set(mysql->mysql, old_charset.csname); } #endif @@ -740,9 +735,9 @@ PHP_FUNCTION(mysqli_data_seek) if (mysqli_result_is_unbuffered(result)) { if (getThis()) { - zend_throw_error(NULL, "mysqli_result::data_seek() cannot be used with MYSQLI_USE_RESULT"); + zend_throw_error(NULL, "mysqli_result::data_seek() cannot be used in MYSQLI_USE_RESULT mode"); } else { - zend_throw_error(NULL, "mysqli_data_seek() cannot be used with MYSQLI_USE_RESULT"); + zend_throw_error(NULL, "mysqli_data_seek() cannot be used in MYSQLI_USE_RESULT mode"); } RETURN_THROWS(); } @@ -908,7 +903,6 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) zval *mysql_stmt; unsigned int i; zend_ulong ret; - unsigned int uval; my_ulonglong llval; @@ -945,8 +939,8 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) && (stmt->stmt->fields[i].flags & UNSIGNED_FLAG)) { /* unsigned int (11) */ - uval= *(unsigned int *) stmt->result.buf[i].val; -#if SIZEOF_ZEND_LONG==4 +#if SIZEOF_ZEND_LONG == 4 + unsigned int uval = *(unsigned int *) stmt->result.buf[i].val; if (uval > INT_MAX) { char *tmp, *p; int j = 10; @@ -1286,9 +1280,8 @@ PHP_FUNCTION(mysqli_field_seek) MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); if ((uint32_t)fieldnr >= mysql_num_fields(result)) { - // TODO ValueError? - php_error_docref(NULL, E_WARNING, "Invalid field offset"); - RETURN_FALSE; + zend_argument_value_error(ERROR_ARG_POS(2), "must be less than the number of fields for this result set"); + RETURN_THROWS(); } mysql_field_seek(result, fieldnr); @@ -1568,7 +1561,8 @@ PHP_FUNCTION(mysqli_next_result) { } /* }}} */ -#if defined(HAVE_STMT_NEXT_RESULT) && defined(MYSQLI_USE_MYSQLND) +/* TODO: Make these available without mysqlnd */ +#if defined(MYSQLI_USE_MYSQLND) /* {{{ check if there any more query results from a multi query */ PHP_FUNCTION(mysqli_stmt_more_results) { @@ -1626,7 +1620,7 @@ PHP_FUNCTION(mysqli_num_rows) MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); if (mysqli_result_is_unbuffered_and_not_everything_is_fetched(result)) { - zend_throw_error(NULL, "mysqli_num_rows() cannot be used with MYSQLI_USE_RESULT"); + zend_throw_error(NULL, "mysqli_num_rows() cannot be used in MYSQLI_USE_RESULT mode"); RETURN_THROWS(); } @@ -1656,10 +1650,12 @@ static int mysqli_options_get_option_zval_type(int option) #endif /* MySQL 4.1.0 */ case MYSQL_OPT_READ_TIMEOUT: case MYSQL_OPT_WRITE_TIMEOUT: +#ifdef MYSQL_OPT_GUESS_CONNECTION /* removed in MySQL-8.0 */ case MYSQL_OPT_GUESS_CONNECTION: case MYSQL_OPT_USE_EMBEDDED_CONNECTION: case MYSQL_OPT_USE_REMOTE_CONNECTION: case MYSQL_SECURE_AUTH: +#endif #ifdef MYSQL_OPT_RECONNECT case MYSQL_OPT_RECONNECT: #endif /* MySQL 5.0.13 */ @@ -1889,7 +1885,11 @@ PHP_FUNCTION(mysqli_real_query) } /* }}} */ -/* {{{ Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection */ +#if defined(MYSQLI_USE_MYSQLND) || MYSQL_VERSION_ID < 50707 || defined(MARIADB_BASE_VERSION) +# define mysql_real_escape_string_quote(mysql, to, from, length, quote) \ + mysql_real_escape_string(mysql, to, from, length) +#endif + PHP_FUNCTION(mysqli_real_escape_string) { MY_MYSQL *mysql; zval *mysql_link = NULL; @@ -1903,12 +1903,11 @@ PHP_FUNCTION(mysqli_real_escape_string) { MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); newstr = zend_string_alloc(2 * escapestr_len, 0); - ZSTR_LEN(newstr) = mysql_real_escape_string(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len); + ZSTR_LEN(newstr) = mysql_real_escape_string_quote(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len, '\''); newstr = zend_string_truncate(newstr, ZSTR_LEN(newstr), 0); RETURN_NEW_STR(newstr); } -/* }}} */ /* {{{ Undo actions from current transaction */ PHP_FUNCTION(mysqli_rollback) @@ -2243,9 +2242,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set) MY_STMT *stmt; zval *mysql_stmt; zend_long mode_in; -#if MYSQL_VERSION_ID >= 50107 my_bool mode_b; -#endif unsigned long mode; zend_long attr; void *mode_p; @@ -2257,7 +2254,6 @@ PHP_FUNCTION(mysqli_stmt_attr_set) MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); switch (attr) { -#if MYSQL_VERSION_ID >= 50107 case STMT_ATTR_UPDATE_MAX_LENGTH: if (mode_in != 0 && mode_in != 1) { zend_argument_value_error(ERROR_ARG_POS(3), "must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH"); @@ -2266,7 +2262,6 @@ PHP_FUNCTION(mysqli_stmt_attr_set) mode_b = (my_bool) mode_in; mode_p = &mode_b; break; -#endif case STMT_ATTR_CURSOR_TYPE: switch (mode_in) { case CURSOR_TYPE_NO_CURSOR: @@ -2293,9 +2288,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set) break; default: zend_argument_value_error(ERROR_ARG_POS(2), "must be one of " -#if MYSQL_VERSION_ID >= 50107 "MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, " -#endif "MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE"); RETURN_THROWS(); } @@ -2331,18 +2324,14 @@ PHP_FUNCTION(mysqli_stmt_attr_get) /* Success corresponds to 0 return value and a non-zero value * should only happen if the attr/option is unknown */ zend_argument_value_error(ERROR_ARG_POS(2), "must be one of " -#if MYSQL_VERSION_ID >= 50107 "MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, " -#endif "MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE"); RETURN_THROWS(); } -#if MYSQL_VERSION_ID >= 50107 if (attr == STMT_ATTR_UPDATE_MAX_LENGTH) value = *((my_bool *)&value); -#endif RETURN_LONG((unsigned long)value); } /* }}} */ @@ -2487,11 +2476,7 @@ PHP_FUNCTION(mysqli_stmt_store_result) stmt->stmt->fields[i].type == MYSQL_TYPE_LONG_BLOB || stmt->stmt->fields[i].type == MYSQL_TYPE_GEOMETRY)) { -#if MYSQL_VERSION_ID >= 50107 - my_bool tmp=1; -#else - uint32_t tmp=1; -#endif + my_bool tmp = 1; mysql_stmt_attr_set(stmt->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &tmp); break; } diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 15daa38426a18..a0228f56aea86 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: beb821b6e0b26f798d88f7b726a39084d856251f */ + * Stub hash: 7657a5373cc27d878b1ac1f11d371f77fe243a6a */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) @@ -96,10 +96,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_lengths, 0, 1, MAY_ ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) ZEND_END_ARG_INFO() +#if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_all, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_NUM") ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_array, 0, 1, MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) @@ -137,12 +139,16 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_free_result, 0, 1, IS_VOI ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) ZEND_END_ARG_INFO() +#if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_connection_stats, 0, 1, IS_ARRAY, 0) ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) ZEND_END_ARG_INFO() +#endif +#if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_client_stats, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_charset, 0, 1, IS_OBJECT, 1) ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) @@ -154,7 +160,8 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_get_client_version arginfo_mysqli_connect_errno -#define arginfo_mysqli_get_links_stats arginfo_mysqli_get_client_stats +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_links_stats, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_host_info, 0, 1, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) @@ -213,6 +220,7 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_ping arginfo_mysqli_more_results +#if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_poll, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) @@ -220,6 +228,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_poll, 0, 4, MAY_BE_LONG|M ZEND_ARG_TYPE_INFO(0, sec, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, usec, IS_LONG, 0, "0") ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_prepare, 0, 2, mysqli_stmt, MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) @@ -254,9 +263,11 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_real_query arginfo_mysqli_multi_query +#if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_reap_async_query, 0, 1, mysqli_result, MAY_BE_BOOL) ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_release_savepoint, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) @@ -336,9 +347,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_free_result, 0, 1, I ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() +#if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_get_result, 0, 1, mysqli_result, MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_get_warnings, 0, 1, mysqli_warning, MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) @@ -350,9 +363,15 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_insert_id arginfo_mysqli_stmt_affected_rows -#define arginfo_mysqli_stmt_more_results arginfo_mysqli_stmt_execute +#if defined(MYSQLI_USE_MYSQLND) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_more_results, 0, 1, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) +ZEND_END_ARG_INFO() +#endif -#define arginfo_mysqli_stmt_next_result arginfo_mysqli_stmt_execute +#if defined(MYSQLI_USE_MYSQLND) +#define arginfo_mysqli_stmt_next_result arginfo_mysqli_stmt_more_results +#endif #define arginfo_mysqli_stmt_num_rows arginfo_mysqli_stmt_affected_rows @@ -365,7 +384,9 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_reset arginfo_mysqli_stmt_execute -#define arginfo_mysqli_stmt_result_metadata arginfo_mysqli_stmt_get_result +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_result_metadata, 0, 1, mysqli_result, MAY_BE_FALSE) + ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_send_long_data, 0, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) @@ -711,7 +732,9 @@ ZEND_FUNCTION(mysqli_fetch_field); ZEND_FUNCTION(mysqli_fetch_fields); ZEND_FUNCTION(mysqli_fetch_field_direct); ZEND_FUNCTION(mysqli_fetch_lengths); +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_fetch_all); +#endif ZEND_FUNCTION(mysqli_fetch_array); ZEND_FUNCTION(mysqli_fetch_assoc); ZEND_FUNCTION(mysqli_fetch_object); @@ -720,8 +743,12 @@ ZEND_FUNCTION(mysqli_field_count); ZEND_FUNCTION(mysqli_field_seek); ZEND_FUNCTION(mysqli_field_tell); ZEND_FUNCTION(mysqli_free_result); +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_get_connection_stats); +#endif +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_get_client_stats); +#endif ZEND_FUNCTION(mysqli_get_charset); ZEND_FUNCTION(mysqli_get_client_info); ZEND_FUNCTION(mysqli_get_client_version); @@ -742,14 +769,18 @@ ZEND_FUNCTION(mysqli_num_fields); ZEND_FUNCTION(mysqli_num_rows); ZEND_FUNCTION(mysqli_options); ZEND_FUNCTION(mysqli_ping); +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_poll); +#endif ZEND_FUNCTION(mysqli_prepare); ZEND_FUNCTION(mysqli_report); ZEND_FUNCTION(mysqli_query); ZEND_FUNCTION(mysqli_real_connect); ZEND_FUNCTION(mysqli_real_escape_string); ZEND_FUNCTION(mysqli_real_query); +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_reap_async_query); +#endif ZEND_FUNCTION(mysqli_release_savepoint); ZEND_FUNCTION(mysqli_rollback); ZEND_FUNCTION(mysqli_savepoint); @@ -768,12 +799,18 @@ ZEND_FUNCTION(mysqli_stmt_error_list); ZEND_FUNCTION(mysqli_stmt_fetch); ZEND_FUNCTION(mysqli_stmt_field_count); ZEND_FUNCTION(mysqli_stmt_free_result); +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_stmt_get_result); +#endif ZEND_FUNCTION(mysqli_stmt_get_warnings); ZEND_FUNCTION(mysqli_stmt_init); ZEND_FUNCTION(mysqli_stmt_insert_id); +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_stmt_more_results); +#endif +#if defined(MYSQLI_USE_MYSQLND) ZEND_FUNCTION(mysqli_stmt_next_result); +#endif ZEND_FUNCTION(mysqli_stmt_num_rows); ZEND_FUNCTION(mysqli_stmt_param_count); ZEND_FUNCTION(mysqli_stmt_prepare); @@ -792,31 +829,10 @@ ZEND_FUNCTION(mysqli_use_result); ZEND_FUNCTION(mysqli_warning_count); ZEND_FUNCTION(mysqli_refresh); ZEND_METHOD(mysqli, __construct); -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_get_connection_stats); -#endif ZEND_FUNCTION(mysqli_init_method); -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_poll); -#endif -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_reap_async_query); -#endif ZEND_METHOD(mysqli_result, __construct); -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_fetch_all); -#endif ZEND_METHOD(mysqli_result, getIterator); ZEND_METHOD(mysqli_stmt, __construct); -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_stmt_more_results); -#endif -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_stmt_next_result); -#endif -#if defined(MYSQLI_USE_MYSQLND) -ZEND_FUNCTION(mysqli_stmt_get_result); -#endif ZEND_METHOD(mysqli_warning, __construct); ZEND_METHOD(mysqli_warning, next); @@ -844,7 +860,9 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(mysqli_fetch_fields, arginfo_mysqli_fetch_fields) ZEND_FE(mysqli_fetch_field_direct, arginfo_mysqli_fetch_field_direct) ZEND_FE(mysqli_fetch_lengths, arginfo_mysqli_fetch_lengths) +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_fetch_all, arginfo_mysqli_fetch_all) +#endif ZEND_FE(mysqli_fetch_array, arginfo_mysqli_fetch_array) ZEND_FE(mysqli_fetch_assoc, arginfo_mysqli_fetch_assoc) ZEND_FE(mysqli_fetch_object, arginfo_mysqli_fetch_object) @@ -853,8 +871,12 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(mysqli_field_seek, arginfo_mysqli_field_seek) ZEND_FE(mysqli_field_tell, arginfo_mysqli_field_tell) ZEND_FE(mysqli_free_result, arginfo_mysqli_free_result) +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_get_connection_stats, arginfo_mysqli_get_connection_stats) +#endif +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_get_client_stats, arginfo_mysqli_get_client_stats) +#endif ZEND_FE(mysqli_get_charset, arginfo_mysqli_get_charset) ZEND_FE(mysqli_get_client_info, arginfo_mysqli_get_client_info) ZEND_FE(mysqli_get_client_version, arginfo_mysqli_get_client_version) @@ -875,14 +897,18 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(mysqli_num_rows, arginfo_mysqli_num_rows) ZEND_FE(mysqli_options, arginfo_mysqli_options) ZEND_FE(mysqli_ping, arginfo_mysqli_ping) +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_poll, arginfo_mysqli_poll) +#endif ZEND_FE(mysqli_prepare, arginfo_mysqli_prepare) ZEND_FE(mysqli_report, arginfo_mysqli_report) ZEND_FE(mysqli_query, arginfo_mysqli_query) ZEND_FE(mysqli_real_connect, arginfo_mysqli_real_connect) ZEND_FE(mysqli_real_escape_string, arginfo_mysqli_real_escape_string) ZEND_FE(mysqli_real_query, arginfo_mysqli_real_query) +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_reap_async_query, arginfo_mysqli_reap_async_query) +#endif ZEND_FE(mysqli_release_savepoint, arginfo_mysqli_release_savepoint) ZEND_FE(mysqli_rollback, arginfo_mysqli_rollback) ZEND_FE(mysqli_savepoint, arginfo_mysqli_savepoint) @@ -901,12 +927,18 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(mysqli_stmt_fetch, arginfo_mysqli_stmt_fetch) ZEND_FE(mysqli_stmt_field_count, arginfo_mysqli_stmt_field_count) ZEND_FE(mysqli_stmt_free_result, arginfo_mysqli_stmt_free_result) +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_stmt_get_result, arginfo_mysqli_stmt_get_result) +#endif ZEND_FE(mysqli_stmt_get_warnings, arginfo_mysqli_stmt_get_warnings) ZEND_FE(mysqli_stmt_init, arginfo_mysqli_stmt_init) ZEND_FE(mysqli_stmt_insert_id, arginfo_mysqli_stmt_insert_id) +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_stmt_more_results, arginfo_mysqli_stmt_more_results) +#endif +#if defined(MYSQLI_USE_MYSQLND) ZEND_FE(mysqli_stmt_next_result, arginfo_mysqli_stmt_next_result) +#endif ZEND_FE(mysqli_stmt_num_rows, arginfo_mysqli_stmt_num_rows) ZEND_FE(mysqli_stmt_param_count, arginfo_mysqli_stmt_param_count) ZEND_FE(mysqli_stmt_prepare, arginfo_mysqli_stmt_prepare) diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index 6bcf5902df58f..c40ff00583137 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -81,6 +81,7 @@ static int driver_report_write(mysqli_object *obj, zval *value) /* {{{ property driver_embedded_read */ static int driver_embedded_read(mysqli_object *obj, zval *retval, zend_bool quiet) { + /* No longer supported */ ZVAL_FALSE(retval); return SUCCESS; diff --git a/ext/mysqli/mysqli_mysqlnd.h b/ext/mysqli/mysqli_mysqlnd.h index 48eae08258407..a2fcff3e21ac8 100644 --- a/ext/mysqli/mysqli_mysqlnd.h +++ b/ext/mysqli/mysqli_mysqlnd.h @@ -41,6 +41,4 @@ #define mysqli_async_query(c, q, l) mysqlnd_async_query((c), (q), (l)) #define mysqli_change_user_silent(c, u, p, d, p_len) mysqlnd_change_user_ex((c), (u), (p), (d), TRUE, (size_t)(p_len)) -#define HAVE_STMT_NEXT_RESULT - #endif diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 394afc7ccc993..85c08c5b2f7da 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -326,7 +326,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql)); #ifndef MYSQLI_USE_MYSQLND - mysql->mysql->reconnect = MyG(reconnect); + char reconnect = MyG(reconnect); + mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect); #endif unsigned int allow_local_infile = MyG(allow_local_infile); mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&allow_local_infile); @@ -1039,6 +1040,7 @@ PHP_FUNCTION(mysqli_set_charset) MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); if (mysql_set_character_set(mysql->mysql, cs_name)) { + MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql); RETURN_FALSE; } RETURN_TRUE; @@ -1108,45 +1110,43 @@ extern char * mysqli_escape_string_for_tx_name_in_comment(const char * const nam static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mode, const char * const name) { int ret; - zend_bool err = FALSE; smart_str tmp_str = {0}; + char * name_esc; + char * query; + unsigned int query_len; if (mode & TRANS_START_WITH_CONSISTENT_SNAPSHOT) { if (tmp_str.s) { smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); } smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1); } - if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) { - if (mysql_get_server_version(conn) < 50605L) { - php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required"); - err = TRUE; - } else if (mode & TRANS_START_READ_WRITE) { - if (tmp_str.s) { - smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); - } - smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1); - } else if (mode & TRANS_START_READ_ONLY) { - if (tmp_str.s) { - smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); - } - smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1); + if (mode & TRANS_START_READ_WRITE) { + if (tmp_str.s) { + smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); } + smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1); + } else if (mode & TRANS_START_READ_ONLY) { + if (tmp_str.s) { + smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1); } smart_str_0(&tmp_str); - if (err == FALSE){ - char * name_esc = mysqli_escape_string_for_tx_name_in_comment(name); - char * query; - unsigned int query_len = spprintf(&query, 0, "START TRANSACTION%s %s", - name_esc? name_esc:"", tmp_str.s? ZSTR_VAL(tmp_str.s):""); + name_esc = mysqli_escape_string_for_tx_name_in_comment(name); + query_len = spprintf(&query, 0, "START TRANSACTION%s %s", + name_esc? name_esc:"", tmp_str.s? ZSTR_VAL(tmp_str.s):""); - smart_str_free(&tmp_str); - if (name_esc) { - efree(name_esc); - } + smart_str_free(&tmp_str); + if (name_esc) { + efree(name_esc); + } - ret = mysql_real_query(conn, query, query_len); - efree(query); + ret = mysql_real_query(conn, query, query_len); + efree(query); + + if (ret && mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY) && mysql_errno(conn) == 1064) { + php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required"); } return ret; } @@ -1249,7 +1249,7 @@ PHP_FUNCTION(mysqli_release_savepoint) #ifndef MYSQLI_USE_MYSQLND if (mysqli_savepoint_libmysql(mysql->mysql, name, TRUE)) { #else - if (FAIL == mysqlnd_savepoint(mysql->mysql, name)) { + if (FAIL == mysqlnd_release_savepoint(mysql->mysql, name)) { #endif RETURN_FALSE; } diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index cc4556c107baa..16ed9ddefce5c 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -39,22 +39,12 @@ #include "mysqli_mysqlnd.h" #else -#include - -/* - We need more than mysql.h because we need CHARSET_INFO in one place. - This order has been borrowed from the ODBC driver. Nothing can be removed - from the list of headers :( -*/ - -#include #include +#if MYSQL_VERSION_ID >= 80000 && MYSQL_VERSION_ID < 100000 +typedef _Bool my_bool; +#endif #include -#include -#include #include -#include -#include #include "mysqli_libmysql.h" #endif /* MYSQLI_USE_MYSQLND */ @@ -78,7 +68,7 @@ typedef struct { unsigned int var_cnt; VAR_BUFFER *buf; zval *vars; - char *is_null; + my_bool *is_null; } BIND_BUFFER; typedef struct { @@ -299,7 +289,6 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqli) zend_long report_mode; HashTable *report_ht; zend_ulong multi_query; - zend_ulong embedded; zend_bool rollback_on_cached_plink; ZEND_END_MODULE_GLOBALS(mysqli) diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt index f8ddc8a38dcc4..e9024105969cc 100644 --- a/ext/mysqli/tests/001.phpt +++ b/ext/mysqli/tests/001.phpt @@ -3,7 +3,6 @@ mysqli connect --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/002.phpt b/ext/mysqli/tests/002.phpt index 0960da7a98c11..322cbb2ee3d01 100644 --- a/ext/mysqli/tests/002.phpt +++ b/ext/mysqli/tests/002.phpt @@ -53,7 +53,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/003.phpt b/ext/mysqli/tests/003.phpt index faf3407bd7364..56a26602dfc03 100644 --- a/ext/mysqli/tests/003.phpt +++ b/ext/mysqli/tests/003.phpt @@ -79,7 +79,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/004.phpt b/ext/mysqli/tests/004.phpt index 0c246e0b2b28b..22a7712dbac3a 100644 --- a/ext/mysqli/tests/004.phpt +++ b/ext/mysqli/tests/004.phpt @@ -57,7 +57,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/005.phpt b/ext/mysqli/tests/005.phpt index 2dffee80c2022..ce0a9a886071e 100644 --- a/ext/mysqli/tests/005.phpt +++ b/ext/mysqli/tests/005.phpt @@ -47,7 +47,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/006.phpt b/ext/mysqli/tests/006.phpt index 5e0443a9fb741..534ef4261fc47 100644 --- a/ext/mysqli/tests/006.phpt +++ b/ext/mysqli/tests/006.phpt @@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/007.phpt b/ext/mysqli/tests/007.phpt index b510d8d8a32d8..7e71476a3a969 100644 --- a/ext/mysqli/tests/007.phpt +++ b/ext/mysqli/tests/007.phpt @@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/008.phpt b/ext/mysqli/tests/008.phpt index 412c3641e5a8a..37b75bb5b9835 100644 --- a/ext/mysqli/tests/008.phpt +++ b/ext/mysqli/tests/008.phpt @@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/009.phpt b/ext/mysqli/tests/009.phpt index 187ac3f9a35ec..f245c71f5dcdb 100644 --- a/ext/mysqli/tests/009.phpt +++ b/ext/mysqli/tests/009.phpt @@ -2,12 +2,12 @@ mysqli fetch bigint values (ok to fail with 4.1.x) --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/010.phpt b/ext/mysqli/tests/010.phpt index 4da24b680add6..9ddac0931fce6 100644 --- a/ext/mysqli/tests/010.phpt +++ b/ext/mysqli/tests/010.phpt @@ -55,7 +55,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/011.phpt b/ext/mysqli/tests/011.phpt index 4be6fe62c59d7..db327e2d32782 100644 --- a/ext/mysqli/tests/011.phpt +++ b/ext/mysqli/tests/011.phpt @@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/012.phpt b/ext/mysqli/tests/012.phpt index c2981a206cfa6..89303e57891cc 100644 --- a/ext/mysqli/tests/012.phpt +++ b/ext/mysqli/tests/012.phpt @@ -51,7 +51,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/013.phpt b/ext/mysqli/tests/013.phpt index 2361622c46fa3..c8aaa73d8427b 100644 --- a/ext/mysqli/tests/013.phpt +++ b/ext/mysqli/tests/013.phpt @@ -46,9 +46,6 @@ require_once('skipifconnectfailure.inc'); $test .= ($c[$i] == $d[$i]) ? "1" : "0"; if ($test == "11111111") echo "ok\n"; - else if ($b_res == FALSE && mysqli_get_client_version() > 40100 && mysqli_get_client_version() < 50000 && - mysqli_get_server_version($link) > 50000) - echo "error (4.1 library with 5.x server)"; else echo "error"; @@ -63,7 +60,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/014.phpt b/ext/mysqli/tests/014.phpt index cb100001c5498..bc5d906d934ad 100644 --- a/ext/mysqli/tests/014.phpt +++ b/ext/mysqli/tests/014.phpt @@ -2,16 +2,16 @@ mysqli autocommit/commit/rollback --SKIPIF-- errno, $link->error)); + if (!have_innodb($link)) + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- Num_of_rows=1 diff --git a/ext/mysqli/tests/015.phpt b/ext/mysqli/tests/015.phpt index 099fcff24eca3..a179e8ec5a4d9 100644 --- a/ext/mysqli/tests/015.phpt +++ b/ext/mysqli/tests/015.phpt @@ -2,15 +2,15 @@ mysqli autocommit/commit/rollback with innodb --SKIPIF-- errno, $link->error)); + if (!have_innodb($link)) + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/017.phpt b/ext/mysqli/tests/017.phpt index 0a1903abf8f3e..cb825066cd279 100644 --- a/ext/mysqli/tests/017.phpt +++ b/ext/mysqli/tests/017.phpt @@ -3,7 +3,6 @@ mysqli fetch functions --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/019.phpt b/ext/mysqli/tests/019.phpt index d35b162cd714f..6d64a17601477 100644 --- a/ext/mysqli/tests/019.phpt +++ b/ext/mysqli/tests/019.phpt @@ -62,7 +62,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS insert_read")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/020.phpt b/ext/mysqli/tests/020.phpt index f1409248c2901..a2a8782f0fd5e 100644 --- a/ext/mysqli/tests/020.phpt +++ b/ext/mysqli/tests/020.phpt @@ -74,7 +74,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/021.phpt b/ext/mysqli/tests/021.phpt index 3fa3b9a5cc967..fd2d4f0e2b68d 100644 --- a/ext/mysqli/tests/021.phpt +++ b/ext/mysqli/tests/021.phpt @@ -45,7 +45,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/022.phpt b/ext/mysqli/tests/022.phpt index d12ba4aff9ecf..d591e5bae1349 100644 --- a/ext/mysqli/tests/022.phpt +++ b/ext/mysqli/tests/022.phpt @@ -50,7 +50,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/023.phpt b/ext/mysqli/tests/023.phpt index 7c22704d441d7..a23e6e15ecfb1 100644 --- a/ext/mysqli/tests/023.phpt +++ b/ext/mysqli/tests/023.phpt @@ -59,7 +59,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/024.phpt b/ext/mysqli/tests/024.phpt index 5be231c27d0f3..dec1e284be43b 100644 --- a/ext/mysqli/tests/024.phpt +++ b/ext/mysqli/tests/024.phpt @@ -59,7 +59,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/025.phpt b/ext/mysqli/tests/025.phpt index 6e300890d7df3..62b1590d29b67 100644 --- a/ext/mysqli/tests/025.phpt +++ b/ext/mysqli/tests/025.phpt @@ -64,7 +64,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/026.phpt b/ext/mysqli/tests/026.phpt index 1db5f5af84496..7f9a9bd4b8c53 100644 --- a/ext/mysqli/tests/026.phpt +++ b/ext/mysqli/tests/026.phpt @@ -51,7 +51,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/029.phpt b/ext/mysqli/tests/029.phpt index 0ed2517227df2..769f3753f4066 100644 --- a/ext/mysqli/tests/029.phpt +++ b/ext/mysqli/tests/029.phpt @@ -33,7 +33,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS general_test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/032.phpt b/ext/mysqli/tests/032.phpt index 660950d6f1e9d..ea7d13bc9bf9a 100644 --- a/ext/mysqli/tests/032.phpt +++ b/ext/mysqli/tests/032.phpt @@ -33,7 +33,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS general_test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/033.phpt b/ext/mysqli/tests/033.phpt index b5c4e3046bfcf..387faa6de2aaa 100644 --- a/ext/mysqli/tests/033.phpt +++ b/ext/mysqli/tests/033.phpt @@ -3,7 +3,6 @@ function test: mysqli_get_host_info --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/034.phpt b/ext/mysqli/tests/034.phpt index f6e19ce5515d8..655871c96ffe3 100644 --- a/ext/mysqli/tests/034.phpt +++ b/ext/mysqli/tests/034.phpt @@ -3,7 +3,6 @@ function test: mysqli_get_proto_info --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/036.phpt b/ext/mysqli/tests/036.phpt index af6d81d64e1b9..04fa7023bef31 100644 --- a/ext/mysqli/tests/036.phpt +++ b/ext/mysqli/tests/036.phpt @@ -2,12 +2,12 @@ function test: mysqli_insert_id() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/037.phpt b/ext/mysqli/tests/037.phpt index 7c6f72cb69a7b..93b2ceace61d7 100644 --- a/ext/mysqli/tests/037.phpt +++ b/ext/mysqli/tests/037.phpt @@ -39,7 +39,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/038.phpt b/ext/mysqli/tests/038.phpt index 63d7e3ee326d3..9719d93049d74 100644 --- a/ext/mysqli/tests/038.phpt +++ b/ext/mysqli/tests/038.phpt @@ -39,7 +39,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/040.phpt b/ext/mysqli/tests/040.phpt index 782cbe57ade5f..04d839408e707 100644 --- a/ext/mysqli/tests/040.phpt +++ b/ext/mysqli/tests/040.phpt @@ -38,7 +38,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/041.phpt b/ext/mysqli/tests/041.phpt index 645a82e419691..d64739d79ed8b 100644 --- a/ext/mysqli/tests/041.phpt +++ b/ext/mysqli/tests/041.phpt @@ -29,7 +29,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/042.phpt b/ext/mysqli/tests/042.phpt index 8b46049cb8f1d..3545ed06c1a76 100644 --- a/ext/mysqli/tests/042.phpt +++ b/ext/mysqli/tests/042.phpt @@ -55,7 +55,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/043.phpt b/ext/mysqli/tests/043.phpt index 2e265d7c51772..adcf502dc72ee 100644 --- a/ext/mysqli/tests/043.phpt +++ b/ext/mysqli/tests/043.phpt @@ -47,7 +47,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_update")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt index 10773ace1b7a6..8486f1003e665 100644 --- a/ext/mysqli/tests/045.phpt +++ b/ext/mysqli/tests/045.phpt @@ -2,21 +2,20 @@ mysqli_stmt_bind_result (SHOW) --SKIPIF-- field_count) { - printf("skip SHOW command is not supported in prepared statements."); - } - $stmt->close(); - mysqli_close($link); + if (!$stmt->field_count) { + printf("skip SHOW command is not supported in prepared statements."); + } + $stmt->close(); + mysqli_close($link); ?> --FILE-- diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt index 4a2c9590cfd6b..376bcb59c5078 100644 --- a/ext/mysqli/tests/047.phpt +++ b/ext/mysqli/tests/047.phpt @@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_affected")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/048.phpt b/ext/mysqli/tests/048.phpt index 20271e43fb828..be5f5a79f1809 100644 --- a/ext/mysqli/tests/048.phpt +++ b/ext/mysqli/tests/048.phpt @@ -47,7 +47,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/049.phpt b/ext/mysqli/tests/049.phpt index 733518609fbaf..fff62da5f0fb8 100644 --- a/ext/mysqli/tests/049.phpt +++ b/ext/mysqli/tests/049.phpt @@ -3,7 +3,6 @@ mysql_fetch_row (OO-Style) --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/057.phpt b/ext/mysqli/tests/057.phpt index 7c4f149c4870c..7d968a18b2ec3 100644 --- a/ext/mysqli/tests/057.phpt +++ b/ext/mysqli/tests/057.phpt @@ -68,7 +68,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_store_result")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/058.phpt b/ext/mysqli/tests/058.phpt index 596b28569ec3e..541be1ede402c 100644 --- a/ext/mysqli/tests/058.phpt +++ b/ext/mysqli/tests/058.phpt @@ -55,7 +55,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS mbind")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/059.phpt b/ext/mysqli/tests/059.phpt index c7f3877201185..7168f6f8fafd3 100644 --- a/ext/mysqli/tests/059.phpt +++ b/ext/mysqli/tests/059.phpt @@ -48,7 +48,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS mbind")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/060.phpt b/ext/mysqli/tests/060.phpt index 22732f4ef1973..c5a77ec16d37a 100644 --- a/ext/mysqli/tests/060.phpt +++ b/ext/mysqli/tests/060.phpt @@ -49,7 +49,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt index 0b15b2ea856d7..76a40c704e2bd 100644 --- a/ext/mysqli/tests/061.phpt +++ b/ext/mysqli/tests/061.phpt @@ -5,15 +5,15 @@ local infile handler require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!function_exists('mysqli_set_local_infile_handler')) - die("skip - function not available."); + die("skip - function not available."); $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); if (!$link) - die(sprintf("skip Can't connect [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf("skip Can't connect [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); include_once("local_infile_tools.inc"); if ($msg = check_local_infile_support($link, $engine)) - die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); + die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/065.phpt b/ext/mysqli/tests/065.phpt index 2733cdafb0273..9b18d33459fea 100644 --- a/ext/mysqli/tests/065.phpt +++ b/ext/mysqli/tests/065.phpt @@ -6,7 +6,7 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!function_exists('mysqli_set_charset')) { - die('skip mysqli_set_charset() not available'); + die('skip mysqli_set_charset() not available'); } ?> --FILE-- diff --git a/ext/mysqli/tests/066.phpt b/ext/mysqli/tests/066.phpt index 678457e93430d..535d01d22434b 100644 --- a/ext/mysqli/tests/066.phpt +++ b/ext/mysqli/tests/066.phpt @@ -37,7 +37,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/067.phpt b/ext/mysqli/tests/067.phpt index 8698b94c94794..a8874ffef4417 100644 --- a/ext/mysqli/tests/067.phpt +++ b/ext/mysqli/tests/067.phpt @@ -2,20 +2,19 @@ function test: nested selects (cursors) --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/mysqli/tests/073.phpt b/ext/mysqli/tests/073.phpt index 09156532d8b26..496beed114f43 100644 --- a/ext/mysqli/tests/073.phpt +++ b/ext/mysqli/tests/073.phpt @@ -15,7 +15,7 @@ mysqli_driver properties print "done!"; ?> --EXPECTF-- -bool(%s) +bool(false) int(%d) string(%d) "%s" int(%d) diff --git a/ext/mysqli/tests/bug32405.phpt b/ext/mysqli/tests/bug32405.phpt index 974ad87b78dac..af41924c3735f 100644 --- a/ext/mysqli/tests/bug32405.phpt +++ b/ext/mysqli/tests/bug32405.phpt @@ -38,7 +38,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_users")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug33263.phpt b/ext/mysqli/tests/bug33263.phpt index 5df4065d25056..ccf619d09f375 100644 --- a/ext/mysqli/tests/bug33263.phpt +++ b/ext/mysqli/tests/bug33263.phpt @@ -3,7 +3,6 @@ Bug #33263 (mysqli_real_connect in __construct) --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt index 60ed3f8d1ad83..9157a13b9ab32 100644 --- a/ext/mysqli/tests/bug34810.phpt +++ b/ext/mysqli/tests/bug34810.phpt @@ -54,7 +54,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug35103.phpt b/ext/mysqli/tests/bug35103.phpt index 7a990eacbf648..95f65320f9e03 100644 --- a/ext/mysqli/tests/bug35103.phpt +++ b/ext/mysqli/tests/bug35103.phpt @@ -58,7 +58,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bint") || !mysqli_query($link, "DROP TABLE IF EXISTS test_buint")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug35517.phpt b/ext/mysqli/tests/bug35517.phpt index a722179896813..578f905f352c7 100644 --- a/ext/mysqli/tests/bug35517.phpt +++ b/ext/mysqli/tests/bug35517.phpt @@ -41,7 +41,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS temp")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug36949.phpt b/ext/mysqli/tests/bug36949.phpt index 5805a6510004d..7033eef23cc9e 100644 --- a/ext/mysqli/tests/bug36949.phpt +++ b/ext/mysqli/tests/bug36949.phpt @@ -54,7 +54,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS my_time")) - printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug37090.phpt b/ext/mysqli/tests/bug37090.phpt index 13d939608d522..8345b4b82f881 100644 --- a/ext/mysqli/tests/bug37090.phpt +++ b/ext/mysqli/tests/bug37090.phpt @@ -5,7 +5,7 @@ Bug #37090 (mysqli_set_charset return code) require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!function_exists('mysqli_set_charset')) { - die('skip mysqli_set_charset() not available'); + die('skip mysqli_set_charset() not available'); } ?> --FILE-- diff --git a/ext/mysqli/tests/bug42378.phpt b/ext/mysqli/tests/bug42378.phpt index 3b0638c840a54..3019679e5dc01 100644 --- a/ext/mysqli/tests/bug42378.phpt +++ b/ext/mysqli/tests/bug42378.phpt @@ -3,7 +3,6 @@ Bug #42378 (bind_result memory exhaustion, SELECT column, FORMAT(...) AS _format --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/bug42548.phpt b/ext/mysqli/tests/bug42548.phpt index 6f4de58a6673a..e188d83666c1a 100644 --- a/ext/mysqli/tests/bug42548.phpt +++ b/ext/mysqli/tests/bug42548.phpt @@ -6,10 +6,10 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); } if (mysqli_get_server_version($link) <= 50000) { - die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); + die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); } ?> --FILE-- diff --git a/ext/mysqli/tests/bug44897.phpt b/ext/mysqli/tests/bug44897.phpt index ba7d0ca49d938..430a32856e1b2 100644 --- a/ext/mysqli/tests/bug44897.phpt +++ b/ext/mysqli/tests/bug44897.phpt @@ -5,16 +5,16 @@ Bug #44879 (failed to prepare statement) require_once('skipif.inc'); if (!stristr(mysqli_get_client_info(), 'mysqlnd')) - die("skip: only available in mysqlnd"); + die("skip: only available in mysqlnd"); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); } if (mysqli_get_server_version($link) <= 50000) { - die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); + die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); } ?> --FILE-- @@ -78,7 +78,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_query($link, "DROP PROCEDURE IF EXISTS p"); diff --git a/ext/mysqli/tests/bug45019.phpt b/ext/mysqli/tests/bug45019.phpt index faad5b9b9012d..c3316133f129f 100644 --- a/ext/mysqli/tests/bug45019.phpt +++ b/ext/mysqli/tests/bug45019.phpt @@ -3,7 +3,6 @@ Bug #45019 (Segmentation fault with SELECT ? and UNION) --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/bug45289.phpt b/ext/mysqli/tests/bug45289.phpt index 65b7ebd707c71..8604fc72609c7 100644 --- a/ext/mysqli/tests/bug45289.phpt +++ b/ext/mysqli/tests/bug45289.phpt @@ -34,7 +34,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- [004] [%s diff --git a/ext/mysqli/tests/bug46614.phpt b/ext/mysqli/tests/bug46614.phpt index 2cdefbf4a316b..e451abda9ed90 100644 --- a/ext/mysqli/tests/bug46614.phpt +++ b/ext/mysqli/tests/bug46614.phpt @@ -5,7 +5,7 @@ Bug #46614 (Extended MySQLi class gives incorrect empty() result) require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!defined("MYSQLI_ASYNC")) { - die("skip mysqlnd only"); + die("skip mysqlnd only"); } ?> --FILE-- diff --git a/ext/mysqli/tests/bug47050.phpt b/ext/mysqli/tests/bug47050.phpt index ac305b07d2524..1dd8f73a699ef 100644 --- a/ext/mysqli/tests/bug47050.phpt +++ b/ext/mysqli/tests/bug47050.phpt @@ -5,7 +5,7 @@ Bug #47050 (mysqli_poll() modifies improper variables) require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!defined("MYSQLI_ASYNC")) { - die("skip mysqlnd only"); + die("skip mysqlnd only"); } ?> --FILE-- diff --git a/ext/mysqli/tests/bug48909.phpt b/ext/mysqli/tests/bug48909.phpt index 3c7e09f17e389..2d994f559e5e7 100644 --- a/ext/mysqli/tests/bug48909.phpt +++ b/ext/mysqli/tests/bug48909.phpt @@ -40,7 +40,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done diff --git a/ext/mysqli/tests/bug49027.phpt b/ext/mysqli/tests/bug49027.phpt index 4aa546cd2630e..6a459ed4acb37 100644 --- a/ext/mysqli/tests/bug49027.phpt +++ b/ext/mysqli/tests/bug49027.phpt @@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- array(1) { diff --git a/ext/mysqli/tests/bug49442.phpt b/ext/mysqli/tests/bug49442.phpt index 22ff7552b7eba..13ddf7b72154d 100644 --- a/ext/mysqli/tests/bug49442.phpt +++ b/ext/mysqli/tests/bug49442.phpt @@ -7,12 +7,12 @@ require_once('skipifconnectfailure.inc'); $link = mysqli_init(); if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) { - die(sprintf("skip Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf("skip Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error())); } include_once("local_infile_tools.inc"); if ($msg = check_local_infile_support($link, $engine)) - die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); + die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug51647.phpt b/ext/mysqli/tests/bug51647.phpt index 8fd107a95d598..8cc15e325e1ea 100644 --- a/ext/mysqli/tests/bug51647.phpt +++ b/ext/mysqli/tests/bug51647.phpt @@ -6,34 +6,37 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once("connect.inc"); +if (!defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT')) + die("skip Requires MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT"); + if ($IS_MYSQLND && !extension_loaded("openssl")) - die("skip PHP streams lack support for SSL. mysqli is compiled to use mysqlnd which uses PHP streams in turn."); + die("skip PHP streams lack support for SSL. mysqli is compiled to use mysqlnd which uses PHP streams in turn."); if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))) - die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); if (false === strpos($link->host_info, 'TCP/IP')) - die(sprintf("skip SSL only supported on TCP/IP")); + die(sprintf("skip SSL only supported on TCP/IP")); $row = NULL; if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) { - $row = $res->fetch_row(); + $row = $res->fetch_row(); } else { - if ($link->errno == 1064 && ($res = $link->query("SHOW VARIABLES"))) { - while ($row = $res->fetch_row()) - if ($row[0] == 'have_ssl') - break; - } else { - die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); - } + if ($link->errno == 1064 && ($res = $link->query("SHOW VARIABLES"))) { + while ($row = $res->fetch_row()) + if ($row[0] == 'have_ssl') + break; + } else { + die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); + } } if (empty($row)) - die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); + die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); if (($row[1] == 'NO') || ($row[1] == 'DISABLED')) - die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error)); + die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error)); $link->close(); ?> diff --git a/ext/mysqli/tests/bug52082.phpt b/ext/mysqli/tests/bug52082.phpt index f601406e8fedd..666804dac442e 100644 --- a/ext/mysqli/tests/bug52082.phpt +++ b/ext/mysqli/tests/bug52082.phpt @@ -3,7 +3,6 @@ Bug #52082 (character_set_client & character_set_connection reset after mysqli_c --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/bug52891.phpt b/ext/mysqli/tests/bug52891.phpt index f0692556399f6..2c4e19ca4c21b 100644 --- a/ext/mysqli/tests/bug52891.phpt +++ b/ext/mysqli/tests/bug52891.phpt @@ -5,7 +5,7 @@ Bug #52891 (Wrong data inserted with mysqli/mysqlnd when using bind_param,value require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!$IS_MYSQLND) { - die("skip: test applies only to mysqlnd"); + die("skip: test applies only to mysqlnd"); } ?> --FILE-- @@ -100,16 +100,16 @@ if (!$IS_MYSQLND) { require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - printf("[clean] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", - $host, $user, $db, $port, $socket); + printf("[clean] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket); } if (!mysqli_query($link, 'DROP TABLE IF EXISTS tuint')) { - printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); } if (!mysqli_query($link, 'DROP TABLE IF EXISTS tsint')) { - printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); } mysqli_close($link); diff --git a/ext/mysqli/tests/bug53503.phpt b/ext/mysqli/tests/bug53503.phpt index b71afe28c7e3c..0b187102f7550 100644 --- a/ext/mysqli/tests/bug53503.phpt +++ b/ext/mysqli/tests/bug53503.phpt @@ -6,11 +6,11 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) - die("skip Cannot connect to MySQL"); + die("skip Cannot connect to MySQL"); include_once("local_infile_tools.inc"); if ($msg = check_local_infile_support($link, $engine)) - die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); + die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); mysqli_close($link); diff --git a/ext/mysqli/tests/bug55283.phpt b/ext/mysqli/tests/bug55283.phpt index 306a4af156a33..379cab0db31f8 100644 --- a/ext/mysqli/tests/bug55283.phpt +++ b/ext/mysqli/tests/bug55283.phpt @@ -6,34 +6,37 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once("connect.inc"); +if (!defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT')) + die("skip Requires MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT"); + if ($IS_MYSQLND && !extension_loaded("openssl")) - die("skip PHP streams lack support for SSL. mysqli is compiled to use mysqlnd which uses PHP streams in turn."); + die("skip PHP streams lack support for SSL. mysqli is compiled to use mysqlnd which uses PHP streams in turn."); if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))) - die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); if (false === strpos($link->host_info, 'TCP/IP')) - die(sprintf("skip SSL only supported on TCP/IP")); + die(sprintf("skip SSL only supported on TCP/IP")); $row = NULL; if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) { - $row = $res->fetch_row(); + $row = $res->fetch_row(); } else { - if ($link->errno == 1064 && ($res = $link->query("SHOW VARIABLES"))) { - while ($row = $res->fetch_row()) - if ($row[0] == 'have_ssl') - break; - } else { - die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); - } + if ($link->errno == 1064 && ($res = $link->query("SHOW VARIABLES"))) { + while ($row = $res->fetch_row()) + if ($row[0] == 'have_ssl') + break; + } else { + die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); + } } if (empty($row)) - die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); + die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error)); if (($row[1] == 'NO') || ($row[1] == 'DISABLED')) - die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error)); + die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error)); $link->close(); ?> diff --git a/ext/mysqli/tests/bug55582.phpt b/ext/mysqli/tests/bug55582.phpt index 817f7eecfe557..e66b4f14cfb5e 100644 --- a/ext/mysqli/tests/bug55582.phpt +++ b/ext/mysqli/tests/bug55582.phpt @@ -34,12 +34,12 @@ require_once("connect.inc"); ?> --EXPECT-- bool(true) -mysqli_num_rows() cannot be used with MYSQLI_USE_RESULT +mysqli_num_rows() cannot be used in MYSQLI_USE_RESULT mode array(1) { [1]=> string(1) "1" } -mysqli_num_rows() cannot be used with MYSQLI_USE_RESULT +mysqli_num_rows() cannot be used in MYSQLI_USE_RESULT mode NULL int(1) done diff --git a/ext/mysqli/tests/bug66043.phpt b/ext/mysqli/tests/bug66043.phpt index 07714f217a5d2..6b479a45ed01b 100644 --- a/ext/mysqli/tests/bug66043.phpt +++ b/ext/mysqli/tests/bug66043.phpt @@ -3,10 +3,6 @@ Bug #66043 (Segfault calling bind_param() on mysqli) --SKIPIF-- --FILE-- @@ -16,11 +12,34 @@ if (!$db = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); } +if (!$db->query("DROP TABLE IF EXISTS test")) { + printf("[002] [%d] %s\n", mysqli_errno($db), mysqli_error($db)); + die(); +} + +if (!$db->query("CREATE TABLE test(str TEXT)")) { + printf("[003] [%d] %s\n", mysqli_errno($db), mysqli_error($db)); + die(); +} + +if (!$db->query("INSERT INTO test(str) VALUES ('Test')")) { + printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + die(); +} + $stmt = $db->stmt_init(); -$stmt->prepare("SELECT User FROM user WHERE password=\"\""); +if (!$stmt->prepare("SELECT str FROM test")) { + printf("[004] [%d] %s\n", mysqli_errno($db), mysqli_error($db)); + die(); +} + $stmt->execute(); $stmt->bind_result($testArg); echo "Okey"; ?> +--CLEAN-- + --EXPECT-- Okey diff --git a/ext/mysqli/tests/bug67839.phpt b/ext/mysqli/tests/bug67839.phpt index 4e8fd68ffdbc9..4391d74add2ef 100644 --- a/ext/mysqli/tests/bug67839.phpt +++ b/ext/mysqli/tests/bug67839.phpt @@ -2,9 +2,8 @@ mysqli_float_handling - ensure 4 byte float is handled correctly --SKIPIF-- --INI-- precision=5 diff --git a/ext/mysqli/tests/bug68077.phpt b/ext/mysqli/tests/bug68077.phpt index 8e5ccfb410e65..2be4fe97aa84a 100644 --- a/ext/mysqli/tests/bug68077.phpt +++ b/ext/mysqli/tests/bug68077.phpt @@ -5,14 +5,14 @@ Bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction) require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!$IS_MYSQLND) { - die("skip: test applies only to mysqlnd"); + die("skip: test applies only to mysqlnd"); } if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) - die("skip Cannot connect to MySQL"); + die("skip Cannot connect to MySQL"); include_once("local_infile_tools.inc"); if ($msg = check_local_infile_support($link, $engine)) - die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); + die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug69899.phpt b/ext/mysqli/tests/bug69899.phpt index da69e3c629f04..13c0c953818d5 100644 --- a/ext/mysqli/tests/bug69899.phpt +++ b/ext/mysqli/tests/bug69899.phpt @@ -12,7 +12,7 @@ require_once __DIR__ . '/skipif.inc'; require_once __DIR__ . '/skipifconnectfailure.inc'; require_once __DIR__ . '/connect.inc'; if (!$IS_MYSQLND) { - die('skip mysqlnd only'); + die('skip mysqlnd only'); } ?> --FILE-- diff --git a/ext/mysqli/tests/bug70384.phpt b/ext/mysqli/tests/bug70384.phpt index 27b9d16f25a65..1bc0e7a97f76d 100644 --- a/ext/mysqli/tests/bug70384.phpt +++ b/ext/mysqli/tests/bug70384.phpt @@ -2,20 +2,19 @@ mysqli_float_handling - ensure 4 byte float is handled correctly --SKIPIF-- server_version < 50709) { - die("skip MySQL 5.7.9+ needed. Found [". - intval(substr($link->server_version."", -5, 1)). - ".". - intval(substr($link->server_version."", -4, 2)). - ".". - intval(substr($link->server_version."", -2, 2)). - "]"); - } - } + require_once('skipif.inc'); + require_once('skipifconnectfailure.inc'); + if (@$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { + if ($link->server_version < 50709) { + die("skip MySQL 5.7.9+ needed. Found [". + intval(substr($link->server_version."", -5, 1)). + ".". + intval(substr($link->server_version."", -4, 2)). + ".". + intval(substr($link->server_version."", -2, 2)). + "]"); + } + } ?> --FILE-- --CLEAN-- --EXPECT-- OK diff --git a/ext/mysqli/tests/bug70949.phpt b/ext/mysqli/tests/bug70949.phpt index b9ad29b6b82ef..24c729c670ae4 100644 --- a/ext/mysqli/tests/bug70949.phpt +++ b/ext/mysqli/tests/bug70949.phpt @@ -6,7 +6,7 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once("connect.inc"); if (!$IS_MYSQLND) { - die("skip mysqlnd only test"); + die("skip mysqlnd only test"); } ?> --FILE-- @@ -51,7 +51,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS bug70949")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug71863.phpt b/ext/mysqli/tests/bug71863.phpt index 18465e996b92b..1490f9fe9691f 100644 --- a/ext/mysqli/tests/bug71863.phpt +++ b/ext/mysqli/tests/bug71863.phpt @@ -6,7 +6,7 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once("connect.inc"); if (!$IS_MYSQLND) { - die("skip mysqlnd only test"); + die("skip mysqlnd only test"); } ?> --FILE-- diff --git a/ext/mysqli/tests/bug72701.phpt b/ext/mysqli/tests/bug72701.phpt index 2145de9b48da1..b2944f02039d7 100644 --- a/ext/mysqli/tests/bug72701.phpt +++ b/ext/mysqli/tests/bug72701.phpt @@ -7,7 +7,7 @@ require_once('skipifconnectfailure.inc'); require_once("connect.inc"); if ("127.0.0.1" != $host && "localhost" != $host) { - die("skip require 127.0.0.1 connection"); + die("skip require 127.0.0.1 connection"); } ?> diff --git a/ext/mysqli/tests/bug73462.phpt b/ext/mysqli/tests/bug73462.phpt index 1aa18d7fb6d5e..224c981dfa901 100644 --- a/ext/mysqli/tests/bug73462.phpt +++ b/ext/mysqli/tests/bug73462.phpt @@ -3,7 +3,6 @@ Bug #73462 (Persistent connections don't set $connect_errno) --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/bug73800.phpt b/ext/mysqli/tests/bug73800.phpt index af601c6e60364..af3a5c8cfb4e3 100644 --- a/ext/mysqli/tests/bug73800.phpt +++ b/ext/mysqli/tests/bug73800.phpt @@ -5,6 +5,7 @@ Bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE) require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (PHP_INT_SIZE != 8) die('skip requires 64-bit'); +if (!defined('MYSQLI_OPT_INT_AND_FLOAT_NATIVE')) die('skip requires mysqlnd'); ?> --FILE-- --FILE-- diff --git a/ext/mysqli/tests/bug74968.phpt b/ext/mysqli/tests/bug74968.phpt index c009f864510ee..c563c2c56dcaf 100644 --- a/ext/mysqli/tests/bug74968.phpt +++ b/ext/mysqli/tests/bug74968.phpt @@ -9,7 +9,7 @@ require_once('skipifconnectfailure.inc'); --FILE-- diff --git a/ext/mysqli/tests/bug76386.phpt b/ext/mysqli/tests/bug76386.phpt index 2f5ded1de474c..f6fe13c917151 100644 --- a/ext/mysqli/tests/bug76386.phpt +++ b/ext/mysqli/tests/bug76386.phpt @@ -3,16 +3,15 @@ Prepared Statement formatter truncates fractional seconds from date/time column --SKIPIF-- = 5.6.4. */ if (mysqli_get_server_version($link) < 50604) { - die(sprintf("skip Server doesn't support fractional seconds in timestamp (%s)", mysqli_get_server_version($link))); + die(sprintf("skip Server doesn't support fractional seconds in timestamp (%s)", mysqli_get_server_version($link))); } mysqli_close($link); ?> diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt index ef3cb0f952acb..52ae874454d55 100644 --- a/ext/mysqli/tests/bug77597.phpt +++ b/ext/mysqli/tests/bug77597.phpt @@ -4,6 +4,7 @@ Bug #77597: mysqli_fetch_field hangs scripts --FILE-- errno, $link->error)); + die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error)); ?> --INI-- diff --git a/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt b/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt index 9c94aa6dfb97e..d2894f2c0d416 100644 --- a/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt +++ b/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt @@ -3,7 +3,6 @@ Fail gracefully on empty result set --SKIPIF-- --FILE-- @@ -26,7 +25,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- bool(false) diff --git a/ext/mysqli/tests/mysqli_affected_rows.phpt b/ext/mysqli/tests/mysqli_affected_rows.phpt index f89c56ef0ff47..3205e7cb2b8e2 100644 --- a/ext/mysqli/tests/mysqli_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows.phpt @@ -2,9 +2,8 @@ mysqli_affected_rows() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt index 5a83d1cfb4960..5e2e0bba8a09e 100644 --- a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt @@ -2,9 +2,8 @@ mysqli->affected_rows --SKIPIF-- --FILE-- affected_rows ?> --CLEAN-- --EXPECT-- Property access is not allowed yet diff --git a/ext/mysqli/tests/mysqli_auth_pam.phpt b/ext/mysqli/tests/mysqli_auth_pam.phpt index cdbcf2947e379..7d23ee5782571 100644 --- a/ext/mysqli/tests/mysqli_auth_pam.phpt +++ b/ext/mysqli/tests/mysqli_auth_pam.phpt @@ -3,26 +3,25 @@ PAM auth plugin --SKIPIF-- server_version < 50500) - die(sprintf("SKIP Needs MySQL 5.5 or newer, found MySQL %s\n", $link->server_info)); + die(sprintf("SKIP Needs MySQL 5.5 or newer, found MySQL %s\n", $link->server_info)); if (!$res = $link->query("SHOW PLUGINS")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); $have_pam = false; while ($row = $res->fetch_assoc()) { - if (isset($row['Name']) && ('mysql_clear_password' == $row['Name'])) { - $have_pam = true; - break; - } + if (isset($row['Name']) && ('mysql_clear_password' == $row['Name'])) { + $have_pam = true; + break; + } } $res->close(); @@ -34,22 +33,22 @@ mysqli_query($link, 'DROP USER pamtest'); mysqli_query($link, 'DROP USER pamtest@localhost'); if (!mysqli_query($link, 'CREATE USER pamtest@"%" IDENTIFIED WITH mysql_clear_password') || - !mysqli_query($link, 'CREATE USER pamtest@"localhost" IDENTIFIED WITH mysql_clear_password')) { - printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link)); - mysqli_close($link); - die("skip CREATE USER failed"); + !mysqli_query($link, 'CREATE USER pamtest@"localhost" IDENTIFIED WITH mysql_clear_password')) { + printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link)); + mysqli_close($link); + die("skip CREATE USER failed"); } if (!$link->query("CREATE TABLE test (id INT)") || !$link->query("INSERT INTO test(id) VALUES (1)")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO pamtest@'%%'", $db)) || - !mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO pamtest@'localhost'", $db))) { - printf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)); - mysqli_close($link); - die("skip GRANT failed"); + !mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO pamtest@'localhost'", $db))) { + printf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)); + mysqli_close($link); + die("skip GRANT failed"); } ?> --INI-- diff --git a/ext/mysqli/tests/mysqli_autocommit.phpt b/ext/mysqli/tests/mysqli_autocommit.phpt index 21435e7a08923..9bfec89b27095 100644 --- a/ext/mysqli/tests/mysqli_autocommit.phpt +++ b/ext/mysqli/tests/mysqli_autocommit.phpt @@ -2,18 +2,17 @@ mysqli_autocommit() --SKIPIF-- errno, $link->error)); + require_once('skipif.inc'); + require_once('connect.inc'); + require_once('skipifconnectfailure.inc'); + + if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { + die(sprintf("skip Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket)); + } + + if (!have_innodb($link)) + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_autocommit_oo.phpt b/ext/mysqli/tests/mysqli_autocommit_oo.phpt index 2720047e37d6c..1030bedbb3777 100644 --- a/ext/mysqli/tests/mysqli_autocommit_oo.phpt +++ b/ext/mysqli/tests/mysqli_autocommit_oo.phpt @@ -2,19 +2,18 @@ mysqli->autocommit() --SKIPIF-- errno, $link->error)); + require_once('skipif.inc'); + require_once('skipifconnectfailure.inc'); + require_once('connect.inc'); + + if (!$link = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) { + printf("skip Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket); + exit(1); + } + + if (!have_innodb($link)) + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- autocommit() ?> --CLEAN-- --EXPECT-- my_mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_begin_transaction.phpt b/ext/mysqli/tests/mysqli_begin_transaction.phpt index 7a9107b7e6917..fa8d88908cc4b 100644 --- a/ext/mysqli/tests/mysqli_begin_transaction.phpt +++ b/ext/mysqli/tests/mysqli_begin_transaction.phpt @@ -3,15 +3,14 @@ mysqli_begin_transaction() --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- NULL diff --git a/ext/mysqli/tests/mysqli_change_user.phpt b/ext/mysqli/tests/mysqli_change_user.phpt index 347126a7d421f..d3a7db930f639 100644 --- a/ext/mysqli/tests/mysqli_change_user.phpt +++ b/ext/mysqli/tests/mysqli_change_user.phpt @@ -3,7 +3,6 @@ mysqli_change_user() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_change_user_get_lock.phpt b/ext/mysqli/tests/mysqli_change_user_get_lock.phpt index 75d0930a83b00..605a408146fae 100644 --- a/ext/mysqli/tests/mysqli_change_user_get_lock.phpt +++ b/ext/mysqli/tests/mysqli_change_user_get_lock.phpt @@ -3,7 +3,6 @@ mysqli_change_user() - GET_LOCK() --SKIPIF-- diff --git a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt index 52e1c1c49109d..383a7a1cf869b 100644 --- a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt @@ -3,12 +3,11 @@ mysqli_change_user() - LAST_INSERT_ID() - http://bugs.mysql.com/bug.php?id=45184 --SKIPIF-- --FILE-- @@ -59,7 +58,7 @@ if (!$IS_MYSQLND) { ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt b/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt index f9e0e306444f6..70c119b554c25 100644 --- a/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt +++ b/ext/mysqli/tests/mysqli_change_user_locks_temporary.phpt @@ -3,7 +3,6 @@ mysqli_change_user() - table locks, GET_LOCK(), temporary tables --SKIPIF-- @@ -101,7 +100,7 @@ die("skip - is the server still buggy?"); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_change_user_new.phpt b/ext/mysqli/tests/mysqli_change_user_new.phpt index 1d6d2f59457d4..bff89fb8ddd96 100644 --- a/ext/mysqli/tests/mysqli_change_user_new.phpt +++ b/ext/mysqli/tests/mysqli_change_user_new.phpt @@ -3,15 +3,14 @@ mysqli_change_user(), MySQL 5.6+ --SKIPIF-- = 5.6.0"); + die("SKIP For MySQL >= 5.6.0"); ?> --FILE-- = 50600) - die("SKIP For MySQL < 5.6.0"); + die("SKIP For MySQL < 5.6.0"); ?> --FILE-- change_user() --SKIPIF-- 50100)) { - die("skip Your MySQL Server version has a known bug that will cause a crash"); + die("skip Your MySQL Server version has a known bug that will cause a crash"); } if (mysqli_get_server_version($link) >= 50600) - die("SKIP For MySQL < 5.6.0"); + die("SKIP For MySQL < 5.6.0"); ?> --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_change_user_rollback.phpt b/ext/mysqli/tests/mysqli_change_user_rollback.phpt index 19c4e36375fce..d420e060d9c43 100644 --- a/ext/mysqli/tests/mysqli_change_user_rollback.phpt +++ b/ext/mysqli/tests/mysqli_change_user_rollback.phpt @@ -3,14 +3,13 @@ mysqli_change_user() - ROLLBACK --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_change_user_set_names.phpt b/ext/mysqli/tests/mysqli_change_user_set_names.phpt index bb2558b882880..f818dea7dab98 100644 --- a/ext/mysqli/tests/mysqli_change_user_set_names.phpt +++ b/ext/mysqli/tests/mysqli_change_user_set_names.phpt @@ -3,23 +3,22 @@ mysqli_change_user() - SET NAMES --SKIPIF-- --FILE-- --FILE-- @@ -101,7 +100,7 @@ if (!function_exists('mysqli_set_charset')) { ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_character_set_name.phpt b/ext/mysqli/tests/mysqli_character_set_name.phpt index b808a6b688f97..5728b726a507c 100644 --- a/ext/mysqli/tests/mysqli_character_set_name.phpt +++ b/ext/mysqli/tests/mysqli_character_set_name.phpt @@ -3,7 +3,6 @@ mysqli_chararcter_set_name(), mysql_client_encoding() [alias] --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_character_set_name_oo.phpt b/ext/mysqli/tests/mysqli_character_set_name_oo.phpt index 843fefed3160e..2a61af45edb67 100644 --- a/ext/mysqli/tests/mysqli_character_set_name_oo.phpt +++ b/ext/mysqli/tests/mysqli_character_set_name_oo.phpt @@ -2,9 +2,8 @@ mysqli_chararcter_set_name(), mysql_client_encoding() [alias] --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt index 794f8eb241c01..48706fcf6e107 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt @@ -3,7 +3,6 @@ Interface of the class mysqli --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt index fa7c7cd53dd8c..651520b70a598 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt @@ -3,7 +3,6 @@ Interface of the class mysqli --SKIPIF-- --FILE-- @@ -285,7 +284,7 @@ Magic, magic properties: mysqli object is already closed Property access is not allowed yet Property access is not allowed yet -mysqli->client_version = '80000'/integer +mysqli->client_version = '%d'/integer mysqli object is already closed mysqli object is already closed mysqli object is already closed @@ -367,7 +366,7 @@ Magic, magic properties: mysqli object is already closed Property access is not allowed yet Property access is not allowed yet -mysqli->client_version = '80000'/integer +mysqli->client_version = '%d'/integer mysqli object is already closed mysqli object is already closed mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt index 2c368abeb629e..629697a50c521 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt @@ -3,7 +3,6 @@ Interface of the class mysqli_result --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt index 8c79d3529732a..393e06ebaad2b 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt @@ -2,9 +2,8 @@ Interface of the class mysqli_stmt --SKIPIF-- --FILE-- --FILE-- --CLEAN-- --EXPECTF-- Warning: Wrong parameter count for mysqli_warning::mysqli_warning() in %s on line %d diff --git a/ext/mysqli/tests/mysqli_close.phpt b/ext/mysqli/tests/mysqli_close.phpt index 98c934d49d04c..1f693a84d7d26 100644 --- a/ext/mysqli/tests/mysqli_close.phpt +++ b/ext/mysqli/tests/mysqli_close.phpt @@ -3,7 +3,6 @@ mysqli_close() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_close_oo.phpt b/ext/mysqli/tests/mysqli_close_oo.phpt index 351df66d94e81..2c29b02d486c1 100644 --- a/ext/mysqli/tests/mysqli_close_oo.phpt +++ b/ext/mysqli/tests/mysqli_close_oo.phpt @@ -3,7 +3,6 @@ mysqli_close() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_commit.phpt b/ext/mysqli/tests/mysqli_commit.phpt index 33bb2011cdb9b..273412de0bb4f 100644 --- a/ext/mysqli/tests/mysqli_commit.phpt +++ b/ext/mysqli/tests/mysqli_commit.phpt @@ -3,15 +3,14 @@ mysqli_commit() --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_commit_oo.phpt b/ext/mysqli/tests/mysqli_commit_oo.phpt index 9ae81f97005f6..6377fdf5a91c8 100644 --- a/ext/mysqli/tests/mysqli_commit_oo.phpt +++ b/ext/mysqli/tests/mysqli_commit_oo.phpt @@ -3,15 +3,14 @@ mysqli_commit() --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --EXPECTF-- mysqli object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_connect.phpt b/ext/mysqli/tests/mysqli_connect.phpt index a1372f3511366..3668ad8f9e9b1 100644 --- a/ext/mysqli/tests/mysqli_connect.phpt +++ b/ext/mysqli/tests/mysqli_connect.phpt @@ -3,7 +3,6 @@ mysqli_connect() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_connect_attr.phpt b/ext/mysqli/tests/mysqli_connect_attr.phpt index 694dc72dab548..7d586a694d9aa 100644 --- a/ext/mysqli/tests/mysqli_connect_attr.phpt +++ b/ext/mysqli/tests/mysqli_connect_attr.phpt @@ -6,10 +6,10 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!$IS_MYSQLND) - die("skip: test applies only to mysqlnd"); + die("skip: test applies only to mysqlnd"); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) - die("skip Cannot connect to the server"); + die("skip Cannot connect to the server"); /* skip test if the server version does not have session_connect_attrs table yet*/ if (!$res = mysqli_query($link, "select count(*) as count from information_schema.tables where table_schema='performance_schema' and table_name='session_connect_attrs';")) diff --git a/ext/mysqli/tests/mysqli_connect_errno.phpt b/ext/mysqli/tests/mysqli_connect_errno.phpt index 2bc86de5ccb8b..7e786e3d87d82 100644 --- a/ext/mysqli/tests/mysqli_connect_errno.phpt +++ b/ext/mysqli/tests/mysqli_connect_errno.phpt @@ -3,7 +3,6 @@ mysqli_connect_errno() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_connect_error.phpt b/ext/mysqli/tests/mysqli_connect_error.phpt index 6643ed27f092d..801f18535ee99 100644 --- a/ext/mysqli/tests/mysqli_connect_error.phpt +++ b/ext/mysqli/tests/mysqli_connect_error.phpt @@ -3,7 +3,6 @@ mysqli_connect_error() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_connect_oo.phpt b/ext/mysqli/tests/mysqli_connect_oo.phpt index e39b4ac2dab1b..8b0fcfbd2f51f 100644 --- a/ext/mysqli/tests/mysqli_connect_oo.phpt +++ b/ext/mysqli/tests/mysqli_connect_oo.phpt @@ -3,7 +3,6 @@ new mysqli() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_connect_oo_defaults.phpt b/ext/mysqli/tests/mysqli_connect_oo_defaults.phpt index c5e65f761650d..4893b6d134ccf 100644 --- a/ext/mysqli/tests/mysqli_connect_oo_defaults.phpt +++ b/ext/mysqli/tests/mysqli_connect_oo_defaults.phpt @@ -3,7 +3,6 @@ new mysqli() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt b/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt index 5b410b746b111..9387dd2c48942 100644 --- a/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt +++ b/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt @@ -2,13 +2,12 @@ new mysqli() --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_constants.phpt b/ext/mysqli/tests/mysqli_constants.phpt index b281a9c9c5dea..22e3cd9d2ba5e 100644 --- a/ext/mysqli/tests/mysqli_constants.phpt +++ b/ext/mysqli/tests/mysqli_constants.phpt @@ -3,7 +3,6 @@ Constants exported by ext/mysqli --SKIPIF-- --INI-- @@ -139,9 +138,7 @@ mysqli.allow_local_infile=1 $expected_constants['MYSQLI_SERVER_QUERY_WAS_SLOW'] = true; } - if ($version >= 50033 || $IS_MYSQLND) { - $expected_constants['MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT'] = true; - } + $expected_constants['MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT'] = true; if ($IS_MYSQLND) { $expected_constants['MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'] = true; } @@ -151,34 +148,26 @@ mysqli.allow_local_infile=1 $expected_constants['MYSQLI_SERVER_PUBLIC_KEY'] = true; } - if ($version > 50002) { - $expected_constants = array_merge($expected_constants, array( - "MYSQLI_TYPE_NEWDECIMAL" => true, - "MYSQLI_TYPE_BIT" => true, - )); - } + $expected_constants = array_merge($expected_constants, array( + "MYSQLI_TYPE_NEWDECIMAL" => true, + "MYSQLI_TYPE_BIT" => true, + )); - if ($version > 50002 || $IS_MYSQLND) { - $expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true; - } + $expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true; - if ($version > 50003) { - $expected_constants = array_merge($expected_constants, array( - "MYSQLI_STMT_ATTR_CURSOR_TYPE" => true, - "MYSQLI_CURSOR_TYPE_NO_CURSOR" => true, - "MYSQLI_CURSOR_TYPE_READ_ONLY" => true, - "MYSQLI_CURSOR_TYPE_FOR_UPDATE" => true, - "MYSQLI_CURSOR_TYPE_SCROLLABLE" => true, - )); - } + $expected_constants = array_merge($expected_constants, array( + "MYSQLI_STMT_ATTR_CURSOR_TYPE" => true, + "MYSQLI_CURSOR_TYPE_NO_CURSOR" => true, + "MYSQLI_CURSOR_TYPE_READ_ONLY" => true, + "MYSQLI_CURSOR_TYPE_FOR_UPDATE" => true, + "MYSQLI_CURSOR_TYPE_SCROLLABLE" => true, + )); - if ($version > 50007) { - $expected_constants = array_merge($expected_constants, array( - "MYSQLI_STMT_ATTR_PREFETCH_ROWS" => true, - )); - } + $expected_constants = array_merge($expected_constants, array( + "MYSQLI_STMT_ATTR_PREFETCH_ROWS" => true, + )); - if ($version > 50110 || $IS_MYSQLND) { + if ($version < 80000 || $version >= 100000 || $IS_MYSQLND) { $expected_constants['MYSQLI_OPT_SSL_VERIFY_SERVER_CERT'] = true; } diff --git a/ext/mysqli/tests/mysqli_constants_categories.phpt b/ext/mysqli/tests/mysqli_constants_categories.phpt index d02463e20a96c..29291fe203e71 100644 --- a/ext/mysqli/tests/mysqli_constants_categories.phpt +++ b/ext/mysqli/tests/mysqli_constants_categories.phpt @@ -3,7 +3,6 @@ Constants exported by ext/mysqli - checking category - PHP bug not mysqli bug (c --SKIPIF-- --FILE-- --FILE-- @@ -62,10 +61,10 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_data_seek(): Argument #2 ($offset) must be greater than or equal to 0 -mysqli_data_seek() cannot be used with MYSQLI_USE_RESULT +mysqli_data_seek() cannot be used in MYSQLI_USE_RESULT mode mysqli_result object is already closed done! diff --git a/ext/mysqli/tests/mysqli_data_seek_oo.phpt b/ext/mysqli/tests/mysqli_data_seek_oo.phpt index ccbf86542ac59..d1939bafa2858 100644 --- a/ext/mysqli/tests/mysqli_data_seek_oo.phpt +++ b/ext/mysqli/tests/mysqli_data_seek_oo.phpt @@ -3,7 +3,6 @@ mysqli_result->data_seek() --SKIPIF-- --FILE-- @@ -73,11 +72,11 @@ require_once('skipifconnectfailure.inc'); print "done!"; --CLEAN-- --EXPECT-- mysqli_result object is already closed mysqli_result::data_seek(): Argument #1 ($offset) must be greater than or equal to 0 -mysqli_result::data_seek() cannot be used with MYSQLI_USE_RESULT +mysqli_result::data_seek() cannot be used in MYSQLI_USE_RESULT mode mysqli_result object is already closed done! diff --git a/ext/mysqli/tests/mysqli_debug.phpt b/ext/mysqli/tests/mysqli_debug.phpt index c701d765c2be9..1646dd9f3aa3a 100644 --- a/ext/mysqli/tests/mysqli_debug.phpt +++ b/ext/mysqli/tests/mysqli_debug.phpt @@ -3,17 +3,16 @@ mysqli_debug() --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- done%s diff --git a/ext/mysqli/tests/mysqli_debug_append.phpt b/ext/mysqli/tests/mysqli_debug_append.phpt index e75639e89d824..65496fdf6e99c 100644 --- a/ext/mysqli/tests/mysqli_debug_append.phpt +++ b/ext/mysqli/tests/mysqli_debug_append.phpt @@ -3,20 +3,19 @@ mysqli_debug() - append to trace file --SKIPIF-- @@ -89,7 +88,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test is not for Windows platfo ?> --CLEAN-- --EXPECTF-- done%s diff --git a/ext/mysqli/tests/mysqli_debug_control_string.phpt b/ext/mysqli/tests/mysqli_debug_control_string.phpt index 474f0998f6dc4..bd17e138795af 100644 --- a/ext/mysqli/tests/mysqli_debug_control_string.phpt +++ b/ext/mysqli/tests/mysqli_debug_control_string.phpt @@ -3,20 +3,19 @@ mysqli_debug() - invalid debug control strings --SKIPIF-- --FILE-- --INI-- diff --git a/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt b/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt index 957ac9b573875..54026193169ba 100644 --- a/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt +++ b/ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt @@ -3,20 +3,19 @@ mysqli_debug() - all control string options supported by both mysqlnd and libmys --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- [083][control string 'n:O,%smysqli_debug_phpt.trace'] Trace file has not been written. diff --git a/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt b/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt index a6d5d08146b3a..0d963d2370188 100644 --- a/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt +++ b/ext/mysqli/tests/mysqli_debug_mysqlnd_only.phpt @@ -3,21 +3,20 @@ mysqli_debug() - mysqlnd only control strings --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_disable_reads_from_master.phpt b/ext/mysqli/tests/mysqli_disable_reads_from_master.phpt index 92b4e8fc271c6..54edb67a07355 100644 --- a/ext/mysqli/tests/mysqli_disable_reads_from_master.phpt +++ b/ext/mysqli/tests/mysqli_disable_reads_from_master.phpt @@ -3,11 +3,10 @@ mysqli_disable_reads_from_master() --SKIPIF-- --FILE-- @@ -40,7 +39,7 @@ if (!function_exists('mysqli_disable_reads_from_master')) { ?> --CLEAN-- --EXPECTF-- Warning: mysqli_disable_reads_from_master(): mysqli object is already closed in %s on line %d diff --git a/ext/mysqli/tests/mysqli_driver.phpt b/ext/mysqli/tests/mysqli_driver.phpt index d4fa124a59194..9af4f22f1fc7e 100644 --- a/ext/mysqli/tests/mysqli_driver.phpt +++ b/ext/mysqli/tests/mysqli_driver.phpt @@ -3,7 +3,6 @@ mysqli_driver class --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_driver_unclonable.phpt b/ext/mysqli/tests/mysqli_driver_unclonable.phpt index 98559f46fc2be..c51d5d5245b30 100644 --- a/ext/mysqli/tests/mysqli_driver_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_driver_unclonable.phpt @@ -2,7 +2,6 @@ Trying to clone mysqli_driver object --SKIPIF-- - --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_dump_debug_info_oo.phpt b/ext/mysqli/tests/mysqli_dump_debug_info_oo.phpt index ae153a320aa1f..7fb7ba7963581 100644 --- a/ext/mysqli/tests/mysqli_dump_debug_info_oo.phpt +++ b/ext/mysqli/tests/mysqli_dump_debug_info_oo.phpt @@ -3,7 +3,6 @@ mysqli_dump_debug_info() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_embedded_connect.phpt b/ext/mysqli/tests/mysqli_embedded_connect.phpt deleted file mode 100644 index aa970aaf74f02..0000000000000 --- a/ext/mysqli/tests/mysqli_embedded_connect.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -mysqli_embedded_connect() ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: mysqli_embedded_connect(): Argument #1 must be of type mysqli, null given in %s on line %d -done! diff --git a/ext/mysqli/tests/mysqli_enable_reads_from_master.phpt b/ext/mysqli/tests/mysqli_enable_reads_from_master.phpt index 0365b14e75cd3..9c74b9592c21c 100644 --- a/ext/mysqli/tests/mysqli_enable_reads_from_master.phpt +++ b/ext/mysqli/tests/mysqli_enable_reads_from_master.phpt @@ -3,11 +3,10 @@ mysqli_enable_reads_from_master() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_errno.phpt b/ext/mysqli/tests/mysqli_errno.phpt index 2cfb17fde3bc2..fe2493a04ff56 100644 --- a/ext/mysqli/tests/mysqli_errno.phpt +++ b/ext/mysqli/tests/mysqli_errno.phpt @@ -3,7 +3,6 @@ mysqli_errno() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_errno_oo.phpt b/ext/mysqli/tests/mysqli_errno_oo.phpt index d35477b2c40d4..d2dab3cec0dcd 100644 --- a/ext/mysqli/tests/mysqli_errno_oo.phpt +++ b/ext/mysqli/tests/mysqli_errno_oo.phpt @@ -3,7 +3,6 @@ $mysqli->errno --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_error.phpt b/ext/mysqli/tests/mysqli_error.phpt index 7a35cd0dd143e..91b2f715a1426 100644 --- a/ext/mysqli/tests/mysqli_error.phpt +++ b/ext/mysqli/tests/mysqli_error.phpt @@ -3,7 +3,6 @@ mysqli_error() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_error_oo.phpt b/ext/mysqli/tests/mysqli_error_oo.phpt index 177e3a9f5ac75..d690a619951f1 100644 --- a/ext/mysqli/tests/mysqli_error_oo.phpt +++ b/ext/mysqli/tests/mysqli_error_oo.phpt @@ -3,7 +3,6 @@ $mysqli->error --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_error_unicode.phpt b/ext/mysqli/tests/mysqli_error_unicode.phpt index bea05179ea55e..1da3f5fd698ea 100644 --- a/ext/mysqli/tests/mysqli_error_unicode.phpt +++ b/ext/mysqli/tests/mysqli_error_unicode.phpt @@ -3,7 +3,6 @@ mysqli_error() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_expire_password.phpt b/ext/mysqli/tests/mysqli_expire_password.phpt index 18517e521a269..b11856d60dfca 100644 --- a/ext/mysqli/tests/mysqli_expire_password.phpt +++ b/ext/mysqli/tests/mysqli_expire_password.phpt @@ -3,49 +3,48 @@ MySQL 5.6 EXPIRE PASSWORD protocol change --SKIPIF-- server_version < 50610) - die(sprintf("SKIP Needs MySQL 5.6.10 or newer, found MySQL %s\n", $link->server_info)); + die(sprintf("SKIP Needs MySQL 5.6.10 or newer, found MySQL %s\n", $link->server_info)); if (!$IS_MYSQLND && (mysqli_get_client_version() < 50610)) { - die(sprintf("SKIP Needs libmysql 5.6.10 or newer, found %s\n", mysqli_get_client_version())); + die(sprintf("SKIP Needs libmysql 5.6.10 or newer, found %s\n", mysqli_get_client_version())); } mysqli_query($link, 'DROP USER expiretest'); mysqli_query($link, 'DROP USER expiretest@localhost'); if (!mysqli_query($link, 'CREATE USER expiretest@"%"') || - !mysqli_query($link, 'CREATE USER expiretest@"localhost"')) { - printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link)); - mysqli_close($link); - die("skip CREATE USER failed"); + !mysqli_query($link, 'CREATE USER expiretest@"localhost"')) { + printf("skip Cannot create second DB user [%d] %s", mysqli_errno($link), mysqli_error($link)); + mysqli_close($link); + die("skip CREATE USER failed"); } if (!mysqli_query($link, 'ALTER USER expiretest@"%" PASSWORD EXPIRE') || - !mysqli_query($link, 'ALTER USER expiretest@"localhost" PASSWORD EXPIRE')) { - printf("skip Cannot modify second DB user [%d] %s", mysqli_errno($link), mysqli_error($link)); - mysqli_close($link); - die("skip ALTER USER failed"); + !mysqli_query($link, 'ALTER USER expiretest@"localhost" PASSWORD EXPIRE')) { + printf("skip Cannot modify second DB user [%d] %s", mysqli_errno($link), mysqli_error($link)); + mysqli_close($link); + die("skip ALTER USER failed"); } if (!$link->query("DROP TABLE IF EXISTS test") || - !$link->query("CREATE TABLE test (id INT)") || !$link->query("INSERT INTO test(id) VALUES (1)")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + !$link->query("CREATE TABLE test (id INT)") || !$link->query("INSERT INTO test(id) VALUES (1)")) + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'%%'", $db)) || - !mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'localhost'", $db))) { - printf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)); - mysqli_close($link); - die("skip GRANT failed"); + !mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'localhost'", $db))) { + printf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link)); + mysqli_close($link); + die("skip GRANT failed"); } ?> --FILE-- @@ -118,9 +117,9 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'% ?> --CLEAN-- --EXPECTF-- Warning: mysqli%sconnect(): (HY000/1862): %s in %s on line %d diff --git a/ext/mysqli/tests/mysqli_explain_metadata.phpt b/ext/mysqli/tests/mysqli_explain_metadata.phpt index 91ef498c62b04..ade3e93fa7ba4 100644 --- a/ext/mysqli/tests/mysqli_explain_metadata.phpt +++ b/ext/mysqli/tests/mysqli_explain_metadata.phpt @@ -3,7 +3,6 @@ EXPLAIN - metadata --SKIPIF-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_all.phpt b/ext/mysqli/tests/mysqli_fetch_all.phpt index ab48821498e0d..ae99c2ca87571 100644 --- a/ext/mysqli/tests/mysqli_fetch_all.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all.phpt @@ -3,10 +3,9 @@ mysqli_fetch_all() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt index 2b34670756583..358dc2ae8b1aa 100644 --- a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt @@ -3,11 +3,10 @@ $mysqli->fetch_all() (introduced with mysqlnd) --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_array.phpt b/ext/mysqli/tests/mysqli_fetch_array.phpt index fe1c6b94cac8a..c2046f1821e65 100644 --- a/ext/mysqli/tests/mysqli_fetch_array.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array.phpt @@ -3,7 +3,6 @@ mysqli_fetch_array() - all datatypes but BIT --SKIPIF-- --FILE-- @@ -174,9 +173,7 @@ require_once('skipifconnectfailure.inc'); func_mysqli_fetch_array($link, $engine, "INTEGER UNSIGNED", "4294967295", "4294967295", 230); func_mysqli_fetch_array($link, $engine, "INTEGER UNSIGNED", NULL, NULL, 240); - if ($IS_MYSQLND || - ((mysqli_get_server_version($link) >= 51000) && - (mysqli_get_client_version($link) >= 51000))) { + if ($IS_MYSQLND || mysqli_get_server_version($link) >= 51000) { func_mysqli_fetch_array($link, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250); func_mysqli_fetch_array($link, $engine, "BIGINT", NULL, NULL, 260); func_mysqli_fetch_array($link, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 260); diff --git a/ext/mysqli/tests/mysqli_fetch_array_assoc.phpt b/ext/mysqli/tests/mysqli_fetch_array_assoc.phpt index 6899c0bfba6a8..cbb3367dd0a1e 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_assoc.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_assoc.phpt @@ -3,7 +3,6 @@ mysqli_fetch_array() --SKIPIF-- --FILE-- @@ -29,7 +28,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [002] diff --git a/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt b/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt index 5f86e3739af83..d3e8c138b0ced 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt @@ -3,7 +3,6 @@ mysqli_fetch_array() --SKIPIF-- --FILE-- @@ -109,7 +108,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_array_oo.phpt b/ext/mysqli/tests/mysqli_fetch_array_oo.phpt index 616be43e8b110..6bf2b0f4c02df 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_oo.phpt @@ -3,7 +3,6 @@ mysqli->fetch_array() --SKIPIF-- --FILE-- @@ -169,9 +168,7 @@ require_once('skipifconnectfailure.inc'); func_mysqli_fetch_array($mysqli, $engine, "INTEGER UNSIGNED", "4294967295", "4294967295", 230); func_mysqli_fetch_array($mysqli, $engine, "INTEGER UNSIGNED", NULL, NULL, 240); - if ($IS_MYSQLND || - ((mysqli_get_server_version($link) >= 51000) && - (mysqli_get_client_version($link) >= 51000))) { + if ($IS_MYSQLND || mysqli_get_server_version($link) >= 51000) { func_mysqli_fetch_array($mysqli, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250); func_mysqli_fetch_array($mysqli, $engine, "BIGINT", NULL, NULL, 260); func_mysqli_fetch_array($mysqli, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 270); @@ -281,7 +278,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_assoc.phpt b/ext/mysqli/tests/mysqli_fetch_assoc.phpt index 5372d6f1de4a4..de19f9a878ae6 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc.phpt @@ -3,7 +3,6 @@ mysqli_fetch_assoc() --SKIPIF-- --FILE-- @@ -63,7 +62,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [005] diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt index 60c635995a2b3..d59cd82128e02 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt @@ -2,18 +2,14 @@ mysqli_fetch_assoc() - BIT --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt index a581499daab75..7083f54b4a003 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias.phpt @@ -3,7 +3,6 @@ mysqli_fetch_assoc() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt index e1ed5c5c87d78..225a5c03d82e5 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_no_alias_utf8.phpt @@ -2,36 +2,35 @@ mysqli_fetch_assoc() - utf8 --SKIPIF-- --FILE-- --FILE-- @@ -58,7 +57,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt b/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt index b06124a89c545..6d53211697d46 100644 --- a/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt +++ b/ext/mysqli/tests/mysqli_fetch_assoc_zerofill.phpt @@ -3,7 +3,6 @@ mysqli_fetch_assoc() - ZEROFILL --SKIPIF-- --FILE-- @@ -72,7 +71,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_field.phpt b/ext/mysqli/tests/mysqli_fetch_field.phpt index 33a35c7005c81..2018d75755051 100644 --- a/ext/mysqli/tests/mysqli_fetch_field.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field.phpt @@ -3,7 +3,6 @@ mysqli_fetch_field() --SKIPIF-- --FILE-- @@ -79,7 +78,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_fetch_field_direct.phpt b/ext/mysqli/tests/mysqli_fetch_field_direct.phpt index 8b57cca094c81..4a4d240be3721 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_direct.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_direct.phpt @@ -3,7 +3,6 @@ mysqli_fetch_field_direct() --SKIPIF-- --FILE-- @@ -42,7 +41,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_fetch_field_direct(): Argument #2 ($offset) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt index 5dedefcdab1b9..1f94eefd388d5 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt @@ -3,7 +3,6 @@ $res->fetch_field_direct(s) --SKIPIF-- --FILE-- @@ -54,7 +53,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_fetch_field_flags.phpt b/ext/mysqli/tests/mysqli_fetch_field_flags.phpt index 5983075942398..7dff325623ddb 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_flags.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_flags.phpt @@ -3,15 +3,14 @@ mysqli_fetch_field() - flags/field->flags --SKIPIF-- @@ -220,7 +219,7 @@ mysqli_close($link); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt index 4a10ced2c252a..d655e05a9c1da 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt @@ -3,7 +3,6 @@ mysqli_fetch_field() --SKIPIF-- --FILE-- @@ -67,7 +66,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_fetch_field_types.phpt b/ext/mysqli/tests/mysqli_fetch_field_types.phpt index ae21349ab091a..dcfbbaaace4b0 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_types.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_types.phpt @@ -3,7 +3,6 @@ mysqli_fetch_field() - data types/field->type --SKIPIF-- --FILE-- @@ -96,18 +95,8 @@ require_once('skipifconnectfailure.inc'); MYSQLI_TYPE_GEOMETRY => 'MYSQLI_TYPE_GEOMETRY - TODO add testing', ); - if ($IS_MYSQLND) { - $version = 50007 + 1; - } else { - $version = mysqli_get_client_version(); - } - - if ($version > 50002) { - $datatypes[MYSQLI_TYPE_NEWDECIMAL] = array('DECIMAL', '1.1'); - $datatypes[MYSQLI_TYPE_BIT] = array('BIT', 0); - } else { - $datatypes[MYSQLI_TYPE_DECIMAL] = array('DECIMAL', '1.1'); - } + $datatypes[MYSQLI_TYPE_NEWDECIMAL] = array('DECIMAL', '1.1'); + $datatypes[MYSQLI_TYPE_BIT] = array('BIT', 0); foreach ($datatypes as $php_type => $datatype) { if (is_array($datatype)) @@ -120,7 +109,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_fetch_fields.phpt b/ext/mysqli/tests/mysqli_fetch_fields.phpt index 5a16f736336de..7cfad35f87389 100644 --- a/ext/mysqli/tests/mysqli_fetch_fields.phpt +++ b/ext/mysqli/tests/mysqli_fetch_fields.phpt @@ -3,7 +3,6 @@ mysqli_fetch_fields() --SKIPIF-- --FILE-- @@ -58,7 +57,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_fetch_lengths.phpt b/ext/mysqli/tests/mysqli_fetch_lengths.phpt index 707c3691d0178..a1e4f50dbdfb9 100644 --- a/ext/mysqli/tests/mysqli_fetch_lengths.phpt +++ b/ext/mysqli/tests/mysqli_fetch_lengths.phpt @@ -3,7 +3,6 @@ mysqli_fetch_lengths() --SKIPIF-- --FILE-- @@ -38,7 +37,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- bool(false) diff --git a/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt b/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt index 18cc3839398af..6c117afc59371 100644 --- a/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_lengths_oo.phpt @@ -3,7 +3,6 @@ mysqli_result->lengths --SKIPIF-- --FILE-- @@ -34,10 +33,10 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- NULL diff --git a/ext/mysqli/tests/mysqli_fetch_object.phpt b/ext/mysqli/tests/mysqli_fetch_object.phpt index 221ad6ab3d8d9..a234aee4c8a5c 100644 --- a/ext/mysqli/tests/mysqli_fetch_object.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object.phpt @@ -3,7 +3,6 @@ mysqli_fetch_object() --SKIPIF-- --FILE-- @@ -140,7 +139,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 0 passed and exactly 2 expected diff --git a/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt b/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt index f773b7652816b..979c523199716 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_no_constructor.phpt @@ -3,7 +3,6 @@ mysqli_fetch_object() - calling constructor on class wo constructor --SKIPIF-- --FILE-- @@ -46,7 +45,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- No exception with PHP: diff --git a/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt b/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt index c12b91e68edb2..5a89d6d3f1253 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_no_object.phpt @@ -3,7 +3,6 @@ mysqli_fetch_object() --SKIPIF-- --FILE-- @@ -20,7 +19,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- %s(6) "object" diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index 18aeb264ece95..b00c485950004 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -3,7 +3,6 @@ mysqli_fetch_object() --SKIPIF-- --FILE-- @@ -129,7 +128,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_fetch_row.phpt b/ext/mysqli/tests/mysqli_fetch_row.phpt index ef52b5a48c375..09ae78aba6b1d 100644 --- a/ext/mysqli/tests/mysqli_fetch_row.phpt +++ b/ext/mysqli/tests/mysqli_fetch_row.phpt @@ -3,7 +3,6 @@ mysqli_fetch_row() --SKIPIF-- --FILE-- @@ -34,7 +33,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [004] diff --git a/ext/mysqli/tests/mysqli_field_count.phpt b/ext/mysqli/tests/mysqli_field_count.phpt index fd2549ecb2ed0..ca40616547a34 100644 --- a/ext/mysqli/tests/mysqli_field_count.phpt +++ b/ext/mysqli/tests/mysqli_field_count.phpt @@ -3,7 +3,6 @@ mysqli_field_count() --SKIPIF-- --FILE-- @@ -43,7 +42,7 @@ require_once('skipifconnectfailure.inc'); print "done!"; --CLEAN-- --EXPECT-- int(0) diff --git a/ext/mysqli/tests/mysqli_field_seek.phpt b/ext/mysqli/tests/mysqli_field_seek.phpt index bcc1e29526c54..0a0b02273efc8 100644 --- a/ext/mysqli/tests/mysqli_field_seek.phpt +++ b/ext/mysqli/tests/mysqli_field_seek.phpt @@ -3,7 +3,6 @@ mysqli_field_seek() --SKIPIF-- --FILE-- @@ -92,7 +91,11 @@ require_once('skipifconnectfailure.inc'); } var_dump(mysqli_field_tell($res)); - var_dump(mysqli_field_seek($res, 2)); + try { + var_dump(mysqli_field_seek($res, 2)); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } var_dump(mysqli_fetch_field($res)); mysqli_free_result($res); @@ -116,7 +119,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_field_seek(): Argument #2 ($field_nr) must be greater than or equal to 0 @@ -207,9 +210,7 @@ object(stdClass)#%d (13) { int(0) } int(2) - -Warning: mysqli_field_seek(): Invalid field offset in %s on line %d -bool(false) +mysqli_field_seek(): Argument #2 ($field_nr) must be less than the number of fields for this result set bool(false) bool(true) object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_field_tell.phpt b/ext/mysqli/tests/mysqli_field_tell.phpt index e8c344ec956ff..79cfc04885191 100644 --- a/ext/mysqli/tests/mysqli_field_tell.phpt +++ b/ext/mysqli/tests/mysqli_field_tell.phpt @@ -3,7 +3,6 @@ mysqli_field_tell() --SKIPIF-- --FILE-- @@ -21,7 +20,11 @@ require_once('skipifconnectfailure.inc'); var_dump(mysqli_fetch_field($res)); var_dump(mysqli_field_tell($res)); - var_dump(mysqli_field_seek($res, 2)); + try { + var_dump(mysqli_field_seek($res, 2)); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } var_dump(mysqli_field_tell($res)); try { @@ -50,7 +53,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- int(0) @@ -85,9 +88,7 @@ object(stdClass)#%d (13) { } bool(false) int(1) - -Warning: mysqli_field_seek(): Invalid field offset in %s on line %d -bool(false) +mysqli_field_seek(): Argument #2 ($field_nr) must be less than the number of fields for this result set int(1) mysqli_field_seek(): Argument #2 ($field_nr) must be greater than or equal to 0 int(1) diff --git a/ext/mysqli/tests/mysqli_fork.phpt b/ext/mysqli/tests/mysqli_fork.phpt index af9f8a1f24aab..ca5eb6230facf 100644 --- a/ext/mysqli/tests/mysqli_fork.phpt +++ b/ext/mysqli/tests/mysqli_fork.phpt @@ -3,21 +3,20 @@ Forking a child and using the same connection. --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- diff --git a/ext/mysqli/tests/mysqli_free_result.phpt b/ext/mysqli/tests/mysqli_free_result.phpt index e0f0fce78147d..8f81fffab4d57 100644 --- a/ext/mysqli/tests/mysqli_free_result.phpt +++ b/ext/mysqli/tests/mysqli_free_result.phpt @@ -3,7 +3,6 @@ mysqli_free_result() --SKIPIF-- --FILE-- @@ -50,7 +49,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- a diff --git a/ext/mysqli/tests/mysqli_get_charset.phpt b/ext/mysqli/tests/mysqli_get_charset.phpt index 4c253ec551fd3..68ee608028e5a 100644 --- a/ext/mysqli/tests/mysqli_get_charset.phpt +++ b/ext/mysqli/tests/mysqli_get_charset.phpt @@ -3,10 +3,9 @@ mysqli_get_charset() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_get_client_info.phpt b/ext/mysqli/tests/mysqli_get_client_info.phpt index 41b0870b37c32..221ce149027f1 100644 --- a/ext/mysqli/tests/mysqli_get_client_info.phpt +++ b/ext/mysqli/tests/mysqli_get_client_info.phpt @@ -3,7 +3,6 @@ mysqli_get_client_info() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_get_client_stats.phpt b/ext/mysqli/tests/mysqli_get_client_stats.phpt index 49fd7470d6c3c..78f3d05b39c27 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats.phpt @@ -3,10 +3,9 @@ mysqli_get_client_stats() --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_get_client_stats_implicit_free.phpt b/ext/mysqli/tests/mysqli_get_client_stats_implicit_free.phpt index bbf3d702c96d6..92a779b31f483 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_implicit_free.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_implicit_free.phpt @@ -3,10 +3,9 @@ mysqli_get_client_stats() - implicit_free_result --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_get_client_stats_off.phpt b/ext/mysqli/tests/mysqli_get_client_stats_off.phpt index cd713fbc9b24e..e648d6695d6a6 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_off.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_off.phpt @@ -3,10 +3,9 @@ mysqli_get_client_stats() - php_ini setting --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt b/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt index ef9042b5a3601..ce7a5e3267a13 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_ps.phpt @@ -3,10 +3,9 @@ mysqli_get_client_stats() - PS --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt b/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt index f5b03996b8d87..ef1ea86e50d1d 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats_skipped.phpt @@ -6,10 +6,9 @@ mysqlnd.collect_memory_statistics="1" --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_get_client_version.phpt b/ext/mysqli/tests/mysqli_get_client_version.phpt index 88e1e85e15603..28f4974ba1819 100644 --- a/ext/mysqli/tests/mysqli_get_client_version.phpt +++ b/ext/mysqli/tests/mysqli_get_client_version.phpt @@ -2,7 +2,6 @@ mysqli_get_client_version() --SKIPIF-- - --FILE-- --FILE-- @@ -74,7 +73,7 @@ if (!function_exists('mysqli_get_connection_stats')) { ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt b/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt index 9dcfbe795cb5c..d2b087ce9aa57 100644 --- a/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt +++ b/ext/mysqli/tests/mysqli_get_connection_stats_off.phpt @@ -6,10 +6,9 @@ mysqlnd.collect_memory_statistics="0" --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_get_host_info.phpt b/ext/mysqli/tests/mysqli_get_host_info.phpt index 072ebc87ade2b..4d9087860fb21 100644 --- a/ext/mysqli/tests/mysqli_get_host_info.phpt +++ b/ext/mysqli/tests/mysqli_get_host_info.phpt @@ -3,7 +3,6 @@ mysqli_get_host_info() --SKIPIF-- --FILE-- @@ -23,7 +22,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_proto_info.phpt b/ext/mysqli/tests/mysqli_get_proto_info.phpt index 2eeae3d03aa5f..0091993d21be8 100644 --- a/ext/mysqli/tests/mysqli_get_proto_info.phpt +++ b/ext/mysqli/tests/mysqli_get_proto_info.phpt @@ -3,7 +3,6 @@ mysqli_get_proto_info() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_get_server_info.phpt b/ext/mysqli/tests/mysqli_get_server_info.phpt index 3a1e08e02902f..88cfd47ee19e8 100644 --- a/ext/mysqli/tests/mysqli_get_server_info.phpt +++ b/ext/mysqli/tests/mysqli_get_server_info.phpt @@ -3,7 +3,6 @@ mysqli_get_server_info() --SKIPIF-- --FILE-- @@ -18,7 +17,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_get_server_version.phpt b/ext/mysqli/tests/mysqli_get_server_version.phpt index c249d708856f0..b28bd8f285ccf 100644 --- a/ext/mysqli/tests/mysqli_get_server_version.phpt +++ b/ext/mysqli/tests/mysqli_get_server_version.phpt @@ -3,7 +3,6 @@ mysqli_get_server_version() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_get_warnings.phpt b/ext/mysqli/tests/mysqli_get_warnings.phpt index 20b2607f39df9..f81baa4177cca 100644 --- a/ext/mysqli/tests/mysqli_get_warnings.phpt +++ b/ext/mysqli/tests/mysqli_get_warnings.phpt @@ -3,11 +3,10 @@ mysqli_get_warnings() - TODO --SKIPIF-- --FILE-- --INI-- diff --git a/ext/mysqli/tests/mysqli_init.phpt b/ext/mysqli/tests/mysqli_init.phpt index c8f3ac8ec5c62..56a956900ab43 100644 --- a/ext/mysqli/tests/mysqli_init.phpt +++ b/ext/mysqli/tests/mysqli_init.phpt @@ -3,7 +3,6 @@ mysqli_init() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_insert_id.phpt b/ext/mysqli/tests/mysqli_insert_id.phpt index a9fc31998dcb6..0c45a4a67699b 100644 --- a/ext/mysqli/tests/mysqli_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_insert_id.phpt @@ -3,7 +3,6 @@ mysqli_insert_id() --SKIPIF-- --FILE-- @@ -127,7 +126,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_insert_id_variation.phpt b/ext/mysqli/tests/mysqli_insert_id_variation.phpt index 16797aa94b370..b3f36d4cb0ccc 100644 --- a/ext/mysqli/tests/mysqli_insert_id_variation.phpt +++ b/ext/mysqli/tests/mysqli_insert_id_variation.phpt @@ -95,7 +95,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_insert_id_var")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt index 69f781f48a10b..105b3276d3bb4 100644 --- a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt +++ b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt @@ -6,14 +6,14 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) - die(sprintf("SKIP [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf("SKIP [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error())); $max_len = pow(2, 24); if (!$res = mysqli_query($link, "SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet'")) - die(sprintf("SKIP [%d] %s\n", mysqli_errno($link), mysqli_error($link))); + die(sprintf("SKIP [%d] %s\n", mysqli_errno($link), mysqli_error($link))); if (!mysqli_query($link, "SET NAMES 'latin1'")) - die(sprintf("SKIP [%d] %s\n", mysqli_errno($link), mysqli_error($link))); + die(sprintf("SKIP [%d] %s\n", mysqli_errno($link), mysqli_error($link))); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt index e4be618fc7fa6..40ca9eaa1af96 100644 --- a/ext/mysqli/tests/mysqli_kill.phpt +++ b/ext/mysqli/tests/mysqli_kill.phpt @@ -3,7 +3,6 @@ mysqli_kill() --SKIPIF-- --FILE-- @@ -78,7 +77,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 @@ -96,7 +95,7 @@ object(mysqli)#%d (%d) { ["connect_error"]=> NULL ["errno"]=> - int(2006) + int(%d) ["error"]=> string(%d) "%s" ["error_list"]=> @@ -104,7 +103,7 @@ object(mysqli)#%d (%d) { [0]=> array(3) { ["errno"]=> - int(2006) + int(%d) ["sqlstate"]=> string(5) "%s" ["error"]=> diff --git a/ext/mysqli/tests/mysqli_last_insert_id.phpt b/ext/mysqli/tests/mysqli_last_insert_id.phpt index b0c453d08e794..0598f29b740d9 100644 --- a/ext/mysqli/tests/mysqli_last_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_last_insert_id.phpt @@ -176,7 +176,7 @@ API vs. SQL LAST_INSERT_ID() ?> --CLEAN-- --EXPECTF-- API: %d, SQL: %d diff --git a/ext/mysqli/tests/mysqli_max_links.phpt b/ext/mysqli/tests/mysqli_max_links.phpt index 5dd7be9dccc74..21405199e5d40 100644 --- a/ext/mysqli/tests/mysqli_max_links.phpt +++ b/ext/mysqli/tests/mysqli_max_links.phpt @@ -3,7 +3,6 @@ Testing mysqli.max_links --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_more_results.phpt b/ext/mysqli/tests/mysqli_more_results.phpt index 5963934b8428b..aaa4f65f28856 100644 --- a/ext/mysqli/tests/mysqli_more_results.phpt +++ b/ext/mysqli/tests/mysqli_more_results.phpt @@ -3,7 +3,6 @@ mysqli_more_results() --SKIPIF-- --FILE-- @@ -60,7 +59,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [004] diff --git a/ext/mysqli/tests/mysqli_multi_query.phpt b/ext/mysqli/tests/mysqli_multi_query.phpt index 5f29dc6f6aa1d..0cc260a557935 100644 --- a/ext/mysqli/tests/mysqli_multi_query.phpt +++ b/ext/mysqli/tests/mysqli_multi_query.phpt @@ -3,7 +3,6 @@ mysqli_multi_query() --SKIPIF-- --FILE-- @@ -112,7 +111,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- [006] 3 diff --git a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt index 159d7d9853d42..ec424e44bda98 100644 --- a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt +++ b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt @@ -6,8 +6,8 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$IS_MYSQLND) - /* The libmysql read_timeout limit default is 365 * 24 * 3600 seconds. It cannot be altered through PHP API calls */ - die("skip mysqlnd only test"); + /* The libmysql read_timeout limit default is 365 * 24 * 3600 seconds. It cannot be altered through PHP API calls */ + die("skip mysqlnd only test"); ?> --INI-- default_socket_timeout=60 diff --git a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt index 3825cd6bd8e6d..a4459992d887d 100644 --- a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt +++ b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt @@ -3,18 +3,17 @@ mysqlnd.net_read_timeout > default_socket_timeout --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt index 9d1e316573801..5ba35270281c5 100644 --- a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt +++ b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_zero.phpt @@ -3,18 +3,17 @@ mysqlnd.net_read_timeout = 0 --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_next_result.phpt b/ext/mysqli/tests/mysqli_next_result.phpt index 090326dfa8ca3..425260b92657d 100644 --- a/ext/mysqli/tests/mysqli_next_result.phpt +++ b/ext/mysqli/tests/mysqli_next_result.phpt @@ -3,7 +3,6 @@ mysqli_next_result() --SKIPIF-- --FILE-- @@ -65,7 +64,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_no_reconnect.phpt b/ext/mysqli/tests/mysqli_no_reconnect.phpt index 1f7ca8d834052..5d54b02a2b78b 100644 --- a/ext/mysqli/tests/mysqli_no_reconnect.phpt +++ b/ext/mysqli/tests/mysqli_no_reconnect.phpt @@ -3,7 +3,6 @@ Trying implicit reconnect after wait_timeout and KILL using mysqli_ping() --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_num_fields.phpt b/ext/mysqli/tests/mysqli_num_fields.phpt index df2161f685388..083ccef4bfb90 100644 --- a/ext/mysqli/tests/mysqli_num_fields.phpt +++ b/ext/mysqli/tests/mysqli_num_fields.phpt @@ -3,7 +3,6 @@ mysqli_num_fields() --SKIPIF-- --FILE-- @@ -44,7 +43,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_result object is already closed diff --git a/ext/mysqli/tests/mysqli_num_rows.phpt b/ext/mysqli/tests/mysqli_num_rows.phpt index 4d09c256823a7..f617757d37820 100644 --- a/ext/mysqli/tests/mysqli_num_rows.phpt +++ b/ext/mysqli/tests/mysqli_num_rows.phpt @@ -3,7 +3,6 @@ mysqli_num_rows() --SKIPIF-- --FILE-- @@ -72,7 +71,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_result object is already closed @@ -80,5 +79,5 @@ mysqli_result object is already closed mysqli_result object is already closed mysqli_result object is already closed run_tests.php don't fool me with your 'ungreedy' expression '.+?'! -mysqli_num_rows() cannot be used with MYSQLI_USE_RESULT +mysqli_num_rows() cannot be used in MYSQLI_USE_RESULT mode done! diff --git a/ext/mysqli/tests/mysqli_open_bug74432.phpt b/ext/mysqli/tests/mysqli_open_bug74432.phpt index 9d529925e92fd..cb5d00a1e466f 100644 --- a/ext/mysqli/tests/mysqli_open_bug74432.phpt +++ b/ext/mysqli/tests/mysqli_open_bug74432.phpt @@ -3,7 +3,6 @@ Bug #74432, BC issue on undocumented connect string --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_options.phpt b/ext/mysqli/tests/mysqli_options.phpt index bec663a64a72c..ad129a41bbf6f 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -3,7 +3,6 @@ mysqli_options() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_options_init_command.phpt b/ext/mysqli/tests/mysqli_options_init_command.phpt index 35e98e7e47e7a..2b87083cbd483 100644 --- a/ext/mysqli/tests/mysqli_options_init_command.phpt +++ b/ext/mysqli/tests/mysqli_options_init_command.phpt @@ -3,10 +3,8 @@ mysqli_options() --SKIPIF-- - --FILE-- --CLEAN-- --EXPECTF-- Warning: mysqli_real_connect(): (%s/%d): %s in %s on line %d diff --git a/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt b/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt index 8f81d4a3e450c..0b7f8df703fae 100644 --- a/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt +++ b/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt @@ -3,12 +3,11 @@ mysqli_options() - MYSQLI_OPT_INT_AND_FLOAT_NATIVE --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_options_openbasedir.phpt b/ext/mysqli/tests/mysqli_options_openbasedir.phpt index 52dc03296d87b..5fd213c108fa6 100644 --- a/ext/mysqli/tests/mysqli_options_openbasedir.phpt +++ b/ext/mysqli/tests/mysqli_options_openbasedir.phpt @@ -3,7 +3,6 @@ mysqli_options() - MYSQLI_OPT_LOCAL_INFILE and open_basedir --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_pam_sha256.phpt b/ext/mysqli/tests/mysqli_pam_sha256.phpt index 2085ab135a4cc..8866409efeb5f 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256.phpt @@ -3,7 +3,6 @@ PAM: SHA-256 --SKIPIF-- query("SHOW PLUGINS"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } $found = false; while ($row = $res->fetch_assoc()) { - if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { - $found = true; - break; - } + if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { + $found = true; + break; + } } if (!$found) - die("skip SHA-256 server plugin unavailable"); + die("skip SHA-256 server plugin unavailable"); if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } if (!($row = $res->fetch_assoc())) { - die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); } if (strlen($row['Value']) < 100) { - die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); } if (!$link->query("SET @@session.old_passwords=2")) { - die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); + die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); } $link->query('DROP USER shatest'); @@ -55,24 +54,24 @@ $link->query("DROP USER shatest@localhost"); if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') || - !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { - die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); + !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { + die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); } if (!$link->query('SET PASSWORD FOR shatest@"%" = PASSWORD("shatest")') || - !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { - die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); + !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { + die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); } if (!$link->query("DROP TABLE IF EXISTS test") || - !$link->query("CREATE TABLE test (id INT)") || - !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + !$link->query("CREATE TABLE test (id INT)") || + !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) || - !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { - die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); + !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { + die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); } $link->close(); @@ -105,9 +104,9 @@ $link->close(); ?> --CLEAN-- query('DROP USER shatest'); - $link->query('DROP USER shatest@localhost'); + require_once("clean_table.inc"); + $link->query('DROP USER shatest'); + $link->query('DROP USER shatest@localhost'); ?> --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt index 5620d4f4e72be..86e27fbaff7d9 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt @@ -3,7 +3,6 @@ PAM: SHA-256, mysqlnd.sha256_server_public_key --SKIPIF-- query("SHOW PLUGINS"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } $found = false; while ($row = $res->fetch_assoc()) { - if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { - $found = true; - break; - } + if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { + $found = true; + break; + } } if (!$found) - die("skip SHA-256 server plugin unavailable"); + die("skip SHA-256 server plugin unavailable"); if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } if (!($row = $res->fetch_assoc())) { - die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); } $key = $row['Value']; if (strlen($key) < 100) { - die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); } /* date changes may give false positive */ $file = "test_sha256_ini"; if ((file_exists($file) && !unlink($file)) || !($fp = @fopen($file, "w"))) { - die(sprintf("skip Cannot create RSA pub key file '%s'", $file)); + die(sprintf("skip Cannot create RSA pub key file '%s'", $file)); } $key = str_replace("A", "a", $key); $key = str_replace("M", "m", $key); if (strlen($key) != fwrite($fp, $key)) { - die(sprintf("skip Failed to create pub key file")); + die(sprintf("skip Failed to create pub key file")); } if (!$link->query("SET @@session.old_passwords=2")) { - die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); + die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); } $link->query('DROP USER shatest'); @@ -68,24 +67,24 @@ $link->query("DROP USER shatest@localhost"); if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') || - !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { - die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); + !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { + die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); } if (!$link->query('SET PASSWORD FOR shatest@"%" = PASSWORD("shatest")') || - !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { - die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); + !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { + die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); } if (!$link->query("DROP TABLE IF EXISTS test") || - !$link->query("CREATE TABLE test (id INT)") || - !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + !$link->query("CREATE TABLE test (id INT)") || + !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) || - !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { - die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); + !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { + die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); } $link->close(); diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt index e0c25d607f9b1..9b5639ff9a7ad 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt @@ -3,7 +3,6 @@ PAM: SHA-256, option: MYSQLI_SERVER_PUBLIC_KEY --SKIPIF-- query("SHOW PLUGINS"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } $found = false; while ($row = $res->fetch_assoc()) { - if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { - $found = true; - break; - } + if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { + $found = true; + break; + } } if (!$found) - die("skip SHA-256 server plugin unavailable"); + die("skip SHA-256 server plugin unavailable"); if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } if (!($row = $res->fetch_assoc())) { - die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); } if (strlen($row['Value']) < 100) { - die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); } /* date changes may give false positive */ $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); if ((file_exists($file) && !unlink($file)) || !($fp = @fopen($file, "w"))) { - die(sprintf("skip Cannot create RSA pub key file '%s'", $file)); + die(sprintf("skip Cannot create RSA pub key file '%s'", $file)); } if (strlen($row['Value']) != fwrite($fp, $row['Value'])) { - die(sprintf("skip Failed to create pub key file")); + die(sprintf("skip Failed to create pub key file")); } if (!$link->query("SET @@session.old_passwords=2")) { - die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); + die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); } $link->query('DROP USER shatest'); @@ -65,24 +64,24 @@ $link->query("DROP USER shatest@localhost"); if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') || - !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { - die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); + !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { + die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); } if (!$link->query('SET PASSWORD FOR shatest@"%" = PASSWORD("shatest")') || - !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { - die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); + !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { + die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); } if (!$link->query("DROP TABLE IF EXISTS test") || - !$link->query("CREATE TABLE test (id INT)") || - !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + !$link->query("CREATE TABLE test (id INT)") || + !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) || - !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { - die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); + !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { + die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); } $link->close(); @@ -122,11 +121,11 @@ $link->close(); ?> --CLEAN-- query('DROP USER shatest'); - $link->query('DROP USER shatest@localhost'); - $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); - @unlink($file); + require_once("clean_table.inc"); + $link->query('DROP USER shatest'); + $link->query('DROP USER shatest@localhost'); + $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); + @unlink($file); ?> --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt index 8e8121f6e7294..b664179265fdd 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt @@ -3,7 +3,6 @@ PAM: SHA-256, option: MYSQLI_SERVER_PUBLIC_KEY (invalid) --SKIPIF-- query("SHOW PLUGINS"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } $found = false; while ($row = $res->fetch_assoc()) { - if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { - $found = true; - break; - } + if (($row['Name'] == 'sha256_password') && ($row['Status'] == 'ACTIVE')) { + $found = true; + break; + } } if (!$found) - die("skip SHA-256 server plugin unavailable"); + die("skip SHA-256 server plugin unavailable"); if (!($res = $link->query("SHOW STATUS LIKE 'Rsa_public_key'"))) { - die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); } if (!($row = $res->fetch_assoc())) { - die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Failed to check RSA pub key, [%d] %s\n", $link->errno, $link->error)); } if (strlen($row['Value']) < 100) { - die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); + die(sprintf("skip Server misconfiguration? RSA pub key is suspicious, [%d] %s\n", $link->errno, $link->error)); } /* date changes may give false positive */ $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); if ((file_exists($file) && !unlink($file)) || !($fp = @fopen($file, "w"))) { - die(sprintf("skip Cannot create RSA pub key file '%s'", $file)); + die(sprintf("skip Cannot create RSA pub key file '%s'", $file)); } if (strlen($row['Value']) != fwrite($fp, $row['Value'])) { - die(sprintf("skip Failed to create pub key file")); + die(sprintf("skip Failed to create pub key file")); } if (!$link->query("SET @@session.old_passwords=2")) { - die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); + die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); } $link->query('DROP USER shatest'); @@ -65,24 +64,24 @@ $link->query("DROP USER shatest@localhost"); if (!$link->query('CREATE USER shatest@"%" IDENTIFIED WITH sha256_password') || - !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { - die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); + !$link->query('CREATE USER shatest@"localhost" IDENTIFIED WITH sha256_password')) { + die(sprintf("skip CREATE USER failed [%d] %s", $link->errno, $link->error)); } if (!$link->query('SET PASSWORD FOR shatest@"%" = PASSWORD("shatest")') || - !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { - die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); + !$link->query('SET PASSWORD FOR shatest@"localhost" = PASSWORD("shatest")')) { + die(sprintf("skip SET PASSWORD failed [%d] %s", $link->errno, $link->error)); } if (!$link->query("DROP TABLE IF EXISTS test") || - !$link->query("CREATE TABLE test (id INT)") || - !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) - die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); + !$link->query("CREATE TABLE test (id INT)") || + !$link->query("INSERT INTO test(id) VALUES (1), (2), (3)")) + die(sprintf("SKIP [%d] %s\n", $link->errno, $link->error)); if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db)) || - !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { - die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); + !$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'localhost'", $db))) { + die(sprintf("skip Cannot grant SELECT to user [%d] %s", mysqli_errno($link), mysqli_error($link))); } $link->close(); @@ -166,13 +165,13 @@ $link->close(); ?> --CLEAN-- query('DROP USER shatest'); - $link->query('DROP USER shatest@localhost'); - $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); - @unlink($file); - $file_wrong = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_wrong" , @date("Ymd")); - @unlink($file_wrong); + require_once("clean_table.inc"); + $link->query('DROP USER shatest'); + $link->query('DROP USER shatest@localhost'); + $file = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_" , @date("Ymd")); + @unlink($file); + $file_wrong = sprintf("%s%s%s_%s", sys_get_temp_dir(), DIRECTORY_SEPARATOR, "test_sha256_wrong" , @date("Ymd")); + @unlink($file_wrong); ?> --EXPECTF-- Warning: mysqli::real_connect(): (HY000/1045): %s in %s on line %d diff --git a/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt b/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt index a68a6bb339af0..1a358cceaa80f 100644 --- a/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt +++ b/ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt @@ -3,7 +3,6 @@ Calling connect() on an open persistent connection to create a new persistent co --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_pconn_disabled.phpt b/ext/mysqli/tests/mysqli_pconn_disabled.phpt index a59a43cbd59a9..8320e250368c6 100644 --- a/ext/mysqli/tests/mysqli_pconn_disabled.phpt +++ b/ext/mysqli/tests/mysqli_pconn_disabled.phpt @@ -3,7 +3,6 @@ mysqli_pconnect() - mysqli.allow_persistent = 0 --SKIPIF-- diff --git a/ext/mysqli/tests/mysqli_pconn_limits.phpt b/ext/mysqli/tests/mysqli_pconn_limits.phpt index b00b99883aa5a..c78fda1a01594 100644 --- a/ext/mysqli/tests/mysqli_pconn_limits.phpt +++ b/ext/mysqli/tests/mysqli_pconn_limits.phpt @@ -3,7 +3,6 @@ Persistent connections - limits (-1, unlimited) --SKIPIF-- diff --git a/ext/mysqli/tests/mysqli_pconn_max_links.phpt b/ext/mysqli/tests/mysqli_pconn_max_links.phpt index a4f7558214b13..f48222c425336 100644 --- a/ext/mysqli/tests/mysqli_pconn_max_links.phpt +++ b/ext/mysqli/tests/mysqli_pconn_max_links.phpt @@ -2,42 +2,41 @@ Persistent connections and mysqli.max_links --SKIPIF-- --INI-- mysqli.allow_persistent=1 diff --git a/ext/mysqli/tests/mysqli_pconn_reuse.phpt b/ext/mysqli/tests/mysqli_pconn_reuse.phpt index 89600c48d9857..4f1dff27e8941 100644 --- a/ext/mysqli/tests/mysqli_pconn_reuse.phpt +++ b/ext/mysqli/tests/mysqli_pconn_reuse.phpt @@ -5,7 +5,6 @@ mysqli_pconnect() - reusing/caching persistent connections - TODO die("skip TODO - we need to add a user level way to check if CHANGE_USER gets called by pconnect"); require_once('skipif.inc'); -require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); ?> --INI-- diff --git a/ext/mysqli/tests/mysqli_pconn_twice.phpt b/ext/mysqli/tests/mysqli_pconn_twice.phpt index e388847507e94..343c5f2e8ad23 100644 --- a/ext/mysqli/tests/mysqli_pconn_twice.phpt +++ b/ext/mysqli/tests/mysqli_pconn_twice.phpt @@ -3,7 +3,6 @@ Calling connect() on an open persistent connection to create a new persistent co --SKIPIF-- diff --git a/ext/mysqli/tests/mysqli_pconnect.phpt b/ext/mysqli/tests/mysqli_pconnect.phpt index 16fbb27e31f83..2fce47885326d 100644 --- a/ext/mysqli/tests/mysqli_pconnect.phpt +++ b/ext/mysqli/tests/mysqli_pconnect.phpt @@ -3,7 +3,6 @@ mysqli_pconnect() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_phpinfo.phpt b/ext/mysqli/tests/mysqli_phpinfo.phpt index d1ecdea7966e7..fd0edd4463ab0 100644 --- a/ext/mysqli/tests/mysqli_phpinfo.phpt +++ b/ext/mysqli/tests/mysqli_phpinfo.phpt @@ -3,7 +3,6 @@ phpinfo() mysqli section --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_ping.phpt b/ext/mysqli/tests/mysqli_ping.phpt index 40a3115f3d3f8..e4d184c6210af 100644 --- a/ext/mysqli/tests/mysqli_ping.phpt +++ b/ext/mysqli/tests/mysqli_ping.phpt @@ -3,7 +3,6 @@ mysqli_ping() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_poll.phpt b/ext/mysqli/tests/mysqli_poll.phpt index cc3cc36b2f8fb..c786a8166b305 100644 --- a/ext/mysqli/tests/mysqli_poll.phpt +++ b/ext/mysqli/tests/mysqli_poll.phpt @@ -3,12 +3,11 @@ int mysqli_poll() simple --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_prepare.phpt b/ext/mysqli/tests/mysqli_prepare.phpt index 7c2ab21d6b4e8..f6676396e53a1 100644 --- a/ext/mysqli/tests/mysqli_prepare.phpt +++ b/ext/mysqli/tests/mysqli_prepare.phpt @@ -3,7 +3,6 @@ mysqli_prepare() --SKIPIF-- --FILE-- @@ -107,10 +106,10 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!mysqli_query($link, "DROP TABLE IF EXISTS test2")) - printf("[c003] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c003] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/mysqli_prepare_no_object.phpt b/ext/mysqli/tests/mysqli_prepare_no_object.phpt index 2b6a07d2ac562..42021b1b88c58 100644 --- a/ext/mysqli/tests/mysqli_prepare_no_object.phpt +++ b/ext/mysqli/tests/mysqli_prepare_no_object.phpt @@ -3,7 +3,6 @@ mysqli_prepare() - no object on failure --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_ps_select_union.phpt b/ext/mysqli/tests/mysqli_ps_select_union.phpt index 8467690776647..f13254b449ab0 100644 --- a/ext/mysqli/tests/mysqli_ps_select_union.phpt +++ b/ext/mysqli/tests/mysqli_ps_select_union.phpt @@ -3,7 +3,6 @@ Prepared Statements and SELECT UNION --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index daac374cf7976..90fc24cf9c852 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -3,7 +3,6 @@ mysqli_query() --SKIPIF-- --FILE-- @@ -108,14 +107,14 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @mysqli_query($link, "DROP FUNCTION IF EXISTS f"); @mysqli_query($link, 'DROP PROCEDURE IF EXISTS p'); mysqli_close($link); ?> ---EXPECT-- +--EXPECTF-- mysqli_query(): Argument #2 ($query) cannot be empty array(1) { ["valid"]=> @@ -126,6 +125,6 @@ array(1) { string(1) "a" } string(1) "a" -mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT with MYSQLI_ASYNC as an optional bitmask flag +mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT%S mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_query_iterators.phpt b/ext/mysqli/tests/mysqli_query_iterators.phpt index 199cddbcc57d9..3ad35363b9c40 100644 --- a/ext/mysqli/tests/mysqli_query_iterators.phpt +++ b/ext/mysqli/tests/mysqli_query_iterators.phpt @@ -3,7 +3,6 @@ mysqli iterators --SKIPIF-- --FILE-- @@ -70,7 +69,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- --- Testing default --- diff --git a/ext/mysqli/tests/mysqli_query_stored_proc.phpt b/ext/mysqli/tests/mysqli_query_stored_proc.phpt index 4a77ac91c8ef3..566dc9dc27239 100644 --- a/ext/mysqli/tests/mysqli_query_stored_proc.phpt +++ b/ext/mysqli/tests/mysqli_query_stored_proc.phpt @@ -6,10 +6,10 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); } if (mysqli_get_server_version($link) <= 50000) { - die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); + die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); } ?> --FILE-- @@ -157,7 +157,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @mysqli_query($link, "DROP PROCEDURE IS EXISTS p"); diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt index 0cec3b398a846..b62418508f106 100644 --- a/ext/mysqli/tests/mysqli_query_unicode.phpt +++ b/ext/mysqli/tests/mysqli_query_unicode.phpt @@ -3,12 +3,11 @@ mysqli_query() - unicode (cyrillic) --SKIPIF-- diff --git a/ext/mysqli/tests/mysqli_real_connect.phpt b/ext/mysqli/tests/mysqli_real_connect.phpt index 05aeca1f6fc15..f58003784411f 100644 --- a/ext/mysqli/tests/mysqli_real_connect.phpt +++ b/ext/mysqli/tests/mysqli_real_connect.phpt @@ -3,7 +3,6 @@ mysqli_real_connect() --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt new file mode 100644 index 0000000000000..0a9fa583d134d --- /dev/null +++ b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt @@ -0,0 +1,56 @@ +--TEST-- +Bug #80107 mysqli_query() fails for ~16 MB long query when compression is enabled +--SKIPIF-- +query("SHOW VARIABLES LIKE 'max_allowed_packet'"); +if ($result->fetch_assoc()['Value'] < 0xffffff) { + die('skip max_allowed_packet is less than 0xffffff'); +} +?> +--FILE-- +query("DROP TABLE IF EXISTS test"); +$mysqli->query("CREATE TABLE test (`blob` LONGBLOB NOT NULL) ENGINE=MyISAM"); + +$data = str_repeat("x", $data_size); +$mysqli->query("INSERT INTO $db.test(`blob`) VALUE ('$data')"); + +var_dump(mysqli_error_list($mysqli)); +$mysqli->close(); + +// Insert with compression enabled: + +$mysqli = mysqli_init(); +$result = my_mysqli_real_connect($mysqli, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS); + +$data = str_repeat("x", $data_size); +$mysqli->query("INSERT INTO $db.test(`blob`) VALUE ('$data')"); + +var_dump(mysqli_error_list($mysqli)); +$mysqli->close(); + +?> +--CLEAN-- + +--EXPECT-- +array(0) { +} +array(0) { +} diff --git a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt index 121504a8fd996..d49c01d3b7aef 100644 --- a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt +++ b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt @@ -3,11 +3,10 @@ mysqli_real_connect() - persistent connections --SKIPIF-- --INI-- mysqli.allow_local_infile=1 diff --git a/ext/mysqli/tests/mysqli_real_escape_string.phpt b/ext/mysqli/tests/mysqli_real_escape_string.phpt index 185d245dccddf..5e6c7d9130151 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string.phpt @@ -3,7 +3,6 @@ mysqli_real_escape_string() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_real_escape_string_big5.phpt b/ext/mysqli/tests/mysqli_real_escape_string_big5.phpt index 97113b858e8e6..2dec713db2bb9 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_big5.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_big5.phpt @@ -4,16 +4,15 @@ mysqli_real_escape_string() - big5 --FILE-- @@ -72,7 +71,7 @@ mysqli_error($link)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt b/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt index 7d51309346476..9af4ade589442 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_eucjpms.phpt @@ -4,16 +4,15 @@ mysqli_real_escape_string() - eucjpms --FILE-- @@ -65,7 +64,7 @@ mysqli_error($link)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt b/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt index 21c3f997365dc..c79302d4027b8 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_euckr.phpt @@ -4,16 +4,15 @@ mysqli_real_escape_string() - euckr --FILE-- @@ -64,7 +63,7 @@ mysqli_error($link)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt b/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt index 505c0bfa6c7a1..d84944b4bd21b 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_gb2312.phpt @@ -4,16 +4,15 @@ mysqli_real_escape_string() - gb2312 --FILE-- @@ -65,7 +64,7 @@ mysqli_error($link)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt b/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt index 3dd8c84a589b5..4da0d8a232914 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_gbk.phpt @@ -3,16 +3,15 @@ mysqli_real_escape_string() - gbk --SKIPIF-- @@ -65,7 +64,7 @@ mysqli_error($link)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt b/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt index b8e48ccf8f2ed..b48e9c02d8022 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_nobackslash.phpt @@ -3,7 +3,6 @@ mysqli_real_escape_string() - SQL Mode NO_BACKSLASH_ESCAPE --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt b/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt index 611590af27b82..034a3bd607bab 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_sjis.phpt @@ -3,16 +3,15 @@ mysqli_real_escape_string() - sjis --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt b/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt index acbbc4ed85210..4bb5ef79690f5 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt @@ -3,7 +3,6 @@ mysqli_real_escape_string() --SKIPIF-- --FILE-- @@ -72,7 +71,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_real_query.phpt b/ext/mysqli/tests/mysqli_real_query.phpt index 45df8a9edcd9c..4b429940d7d0b 100644 --- a/ext/mysqli/tests/mysqli_real_query.phpt +++ b/ext/mysqli/tests/mysqli_real_query.phpt @@ -87,7 +87,7 @@ if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @mysqli_query($link, "DROP PROCEDURE IF EXISTS p"); @mysqli_query($link, "DROP FUNCTION IF EXISTS f"); diff --git a/ext/mysqli/tests/mysqli_reap_async_query.phpt b/ext/mysqli/tests/mysqli_reap_async_query.phpt index 8f9fd5cb1cc07..b93996ef38b64 100644 --- a/ext/mysqli/tests/mysqli_reap_async_query.phpt +++ b/ext/mysqli/tests/mysqli_reap_async_query.phpt @@ -3,12 +3,11 @@ mysqli_reap_async_query() --SKIPIF-- --FILE-- --INI-- mysqli.reconnect=1 diff --git a/ext/mysqli/tests/mysqli_release_savepoint.phpt b/ext/mysqli/tests/mysqli_release_savepoint.phpt index fa46366e7cac8..44c33b39c2283 100644 --- a/ext/mysqli/tests/mysqli_release_savepoint.phpt +++ b/ext/mysqli/tests/mysqli_release_savepoint.phpt @@ -3,15 +3,14 @@ mysqli_release_savepoint() --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- mysqli_release_savepoint(): Argument #2 ($name) cannot be empty diff --git a/ext/mysqli/tests/mysqli_report.phpt b/ext/mysqli/tests/mysqli_report.phpt index 6f5733513ca3b..5aa695f8f2ae1 100644 --- a/ext/mysqli/tests/mysqli_report.phpt +++ b/ext/mysqli/tests/mysqli_report.phpt @@ -3,7 +3,6 @@ mysqli_report() --SKIPIF-- --FILE-- @@ -282,7 +281,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d diff --git a/ext/mysqli/tests/mysqli_report_new.phpt b/ext/mysqli/tests/mysqli_report_new.phpt index 5bfa260c9e356..305d70108379c 100644 --- a/ext/mysqli/tests/mysqli_report_new.phpt +++ b/ext/mysqli/tests/mysqli_report_new.phpt @@ -3,15 +3,14 @@ mysqli_report(), change user, MySQL 5.6+ --SKIPIF-- = 5.6.0"); + die("SKIP For MySQL >= 5.6.0"); ?> --FILE-- @@ -42,7 +41,7 @@ if (mysqli_get_server_version($link) < 50600) ?> --CLEAN-- --EXPECTF-- Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d diff --git a/ext/mysqli/tests/mysqli_report_wo_ps.phpt b/ext/mysqli/tests/mysqli_report_wo_ps.phpt index bf7d4500e5a0d..7f0295dd44c71 100644 --- a/ext/mysqli/tests/mysqli_report_wo_ps.phpt +++ b/ext/mysqli/tests/mysqli_report_wo_ps.phpt @@ -3,15 +3,14 @@ mysqli_report(), MySQL < 5.6 --SKIPIF-- = 50600) - die("SKIP For MySQL < 5.6.0"); + die("SKIP For MySQL < 5.6.0"); ?> --FILE-- = 50600) mysqli_multi_query($link, "BAR; FOO;"); mysqli_query($link, "FOO"); mysqli_change_user($link, "0123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-456789-70-456789-80-456789-90-456789", "password", $db); - mysqli_kill($link, -1); + try { + mysqli_kill($link, -1); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } // mysqli_ping() cannot be tested, because one would need to cause an error inside the C function to test it mysqli_real_query($link, "FOO"); @@ -64,7 +67,11 @@ if (mysqli_get_server_version($link) >= 50600) mysqli_multi_query($link, "BAR; FOO;"); mysqli_query($link, "FOO"); mysqli_change_user($link, "This might work if you accept anonymous users in your setup", "password", $db); - mysqli_kill($link, -1); + try { + mysqli_kill($link, -1); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } mysqli_real_query($link, "FOO"); mysqli_select_db($link, "Oh lord, let this be an unknown database name"); @@ -98,7 +105,7 @@ if (mysqli_get_server_version($link) >= 50600) ?> --CLEAN-- --EXPECTF-- Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d @@ -106,12 +113,10 @@ Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; ch Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d - -Warning: mysqli_kill(): processid should have positive value in %s on line %d +mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d - -Warning: mysqli_kill(): processid should have positive value in %s on line %d +mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 [011] Access denied for user '%s'@'%s' (using password: YES) [014] Access denied for user '%s'@'%s' (using password: YES) done! diff --git a/ext/mysqli/tests/mysqli_result_invalid_mode.phpt b/ext/mysqli/tests/mysqli_result_invalid_mode.phpt index 374fccfa61e81..6be779f33134b 100644 --- a/ext/mysqli/tests/mysqli_result_invalid_mode.phpt +++ b/ext/mysqli/tests/mysqli_result_invalid_mode.phpt @@ -3,7 +3,6 @@ mysqli_result(), invalid mode --SKIPIF-- --FILE-- @@ -23,7 +22,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT diff --git a/ext/mysqli/tests/mysqli_result_references.phpt b/ext/mysqli/tests/mysqli_result_references.phpt index 7084955380f25..2e97cd45d795a 100644 --- a/ext/mysqli/tests/mysqli_result_references.phpt +++ b/ext/mysqli/tests/mysqli_result_references.phpt @@ -3,7 +3,6 @@ References to result sets --SKIPIF-- --FILE-- @@ -79,7 +78,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- array(7) refcount(2){ diff --git a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt index d33c89b4dce69..3c44f8a309edc 100644 --- a/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt @@ -3,13 +3,11 @@ References to result sets - mysqlnd (no copies but references) --SKIPIF-- + die("skip Test for mysqlnd only"); +?> --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_rollback.phpt b/ext/mysqli/tests/mysqli_rollback.phpt index 92ab3e28b5c47..17f7aed05e9b4 100644 --- a/ext/mysqli/tests/mysqli_rollback.phpt +++ b/ext/mysqli/tests/mysqli_rollback.phpt @@ -2,16 +2,15 @@ mysqli_rollback() --SKIPIF-- errno, $link->error)); + if (!have_innodb($link)) + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_savepoint.phpt b/ext/mysqli/tests/mysqli_savepoint.phpt index 10016256671d3..ebe27686aca87 100644 --- a/ext/mysqli/tests/mysqli_savepoint.phpt +++ b/ext/mysqli/tests/mysqli_savepoint.phpt @@ -3,15 +3,14 @@ mysqli_savepoint() --SKIPIF-- errno, $link->error)); + die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error)); ?> --FILE-- --CLEAN-- --EXPECT-- mysqli_savepoint(): Argument #2 ($name) cannot be empty diff --git a/ext/mysqli/tests/mysqli_select_db.phpt b/ext/mysqli/tests/mysqli_select_db.phpt index 67716d06644b8..50463b810664d 100644 --- a/ext/mysqli/tests/mysqli_select_db.phpt +++ b/ext/mysqli/tests/mysqli_select_db.phpt @@ -3,7 +3,6 @@ mysqli_select_db() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_send_query.phpt b/ext/mysqli/tests/mysqli_send_query.phpt index cf271c5d07017..0289e7733e5cc 100644 --- a/ext/mysqli/tests/mysqli_send_query.phpt +++ b/ext/mysqli/tests/mysqli_send_query.phpt @@ -3,14 +3,13 @@ mysqli_send_query() --SKIPIF-- --FILE-- --FILE-- @@ -102,6 +101,20 @@ if ((($res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin1"', MYSQLI_STOR } mysqli_free_result($res); + // Make sure that set_charset throws an exception in exception mode + mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); + try { + $link->set_charset('invalid'); + } catch (\mysqli_sql_exception $exception) { + echo "Exception: " . $exception->getMessage() . "\n"; + } + + try { + $link->set_charset('ucs2'); + } catch (\mysqli_sql_exception $exception) { + echo "Exception: " . $exception->getMessage() . "\n"; + } + mysqli_close($link); try { @@ -114,8 +127,10 @@ if ((($res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin1"', MYSQLI_STOR ?> --CLEAN-- ---EXPECT-- +--EXPECTF-- +Exception: %s +Exception: Variable 'character_set_client' can't be set to the value of 'ucs2' mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_set_opt.phpt b/ext/mysqli/tests/mysqli_set_opt.phpt index c0e55dd5d604b..4fc4735b33c08 100644 --- a/ext/mysqli/tests/mysqli_set_opt.phpt +++ b/ext/mysqli/tests/mysqli_set_opt.phpt @@ -3,7 +3,6 @@ mysqli_set_opt() --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_sqlstate.phpt b/ext/mysqli/tests/mysqli_sqlstate.phpt index cf6097776350c..e871d0ff3e593 100644 --- a/ext/mysqli/tests/mysqli_sqlstate.phpt +++ b/ext/mysqli/tests/mysqli_sqlstate.phpt @@ -3,7 +3,6 @@ mysqli_sqlstate() --SKIPIF-- --FILE-- @@ -30,7 +29,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- %s(5) "00000" diff --git a/ext/mysqli/tests/mysqli_ssl_set.phpt b/ext/mysqli/tests/mysqli_ssl_set.phpt index 7f079f21ea715..2ad705bda45bf 100644 --- a/ext/mysqli/tests/mysqli_ssl_set.phpt +++ b/ext/mysqli/tests/mysqli_ssl_set.phpt @@ -3,10 +3,9 @@ mysqli_ssl_set() - test is a stub! --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt index 505acc68f1e8d..de4f73bc18ce6 100644 --- a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt @@ -3,7 +3,6 @@ mysqli_stmt_affected_rows() --SKIPIF-- --FILE-- @@ -237,7 +236,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- [009] [%d] (error message varies with the MySQL Server version, check the error code) diff --git a/ext/mysqli/tests/mysqli_stmt_attr_get.phpt b/ext/mysqli/tests/mysqli_stmt_attr_get.phpt index 6179155e777b1..aea6c91ad00de 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_get.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_get.phpt @@ -3,7 +3,6 @@ mysqli_stmt_attr_get() --SKIPIF-- --FILE-- @@ -12,12 +11,11 @@ require_once('skipifconnectfailure.inc'); require('table.inc'); - $valid_attr = array("max_length" => MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH); - if (mysqli_get_client_version() > 50003) - $valid_attr["cursor_type"] = MYSQLI_STMT_ATTR_CURSOR_TYPE; - - if ($IS_MYSQLND && mysqli_get_client_version() > 50007) - $valid_attr["prefetch_rows"] = MYSQLI_STMT_ATTR_PREFETCH_ROWS; + $valid_attr = array( + "max_length" => MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, + "cursor_type" => MYSQLI_STMT_ATTR_CURSOR_TYPE, + "prefetch_rows" => MYSQLI_STMT_ATTR_PREFETCH_ROWS, + ); $stmt = mysqli_stmt_init($link); mysqli_stmt_prepare($stmt, 'SELECT * FROM test'); @@ -51,7 +49,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt_attr_get(): Argument #2 ($attr) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE diff --git a/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt b/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt index 2781810d9b10c..9ef46151f90c7 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_get_prefetch.phpt @@ -3,7 +3,6 @@ mysqli_stmt_attr_get() - prefetch --SKIPIF-- @@ -23,7 +22,7 @@ die("SKIP: prefetch isn't supported at the moment"); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt index 870960e602f9a..16d789f37f7fd 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt @@ -3,7 +3,6 @@ mysqli_stmt_attr_set() - mysqlnd does not check for invalid codes --SKIPIF-- --FILE-- @@ -13,16 +12,12 @@ require_once("connect.inc"); require('table.inc'); $valid_attr = array(MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH); - if ((mysqli_get_client_version() > 50003) || $IS_MYSQLND) { - $valid_attr[] = MYSQLI_STMT_ATTR_CURSOR_TYPE; - $valid_attr[] = MYSQLI_CURSOR_TYPE_NO_CURSOR; - $valid_attr[] = MYSQLI_CURSOR_TYPE_READ_ONLY; - $valid_attr[] = MYSQLI_CURSOR_TYPE_FOR_UPDATE; - $valid_attr[] = MYSQLI_CURSOR_TYPE_SCROLLABLE; - } - - if ((mysqli_get_client_version() > 50007) || $IS_MYSQLND) - $valid_attr[] = MYSQLI_STMT_ATTR_PREFETCH_ROWS; + $valid_attr[] = MYSQLI_STMT_ATTR_CURSOR_TYPE; + $valid_attr[] = MYSQLI_CURSOR_TYPE_NO_CURSOR; + $valid_attr[] = MYSQLI_CURSOR_TYPE_READ_ONLY; + $valid_attr[] = MYSQLI_CURSOR_TYPE_FOR_UPDATE; + $valid_attr[] = MYSQLI_CURSOR_TYPE_SCROLLABLE; + $valid_attr[] = MYSQLI_STMT_ATTR_PREFETCH_ROWS; $stmt = mysqli_stmt_init($link); @@ -110,78 +105,75 @@ require_once("connect.inc"); // Cursors // - if (mysqli_get_client_version() > 50003) { - - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT id, label FROM test"); - // Invalid cursor type - try { - $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, -1); - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; - } + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT id, label FROM test"); - if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE))) - printf("[011] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); + // Invalid cursor type + try { + $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, -1); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } - if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_SCROLLABLE))) - printf("[012] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); + if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE))) + printf("[011] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR))) - printf("[013] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_SCROLLABLE))) + printf("[012] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY))) - printf("[014] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR))) + printf("[013] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt->close(); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY))) + printf("[014] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT id, label FROM test"); - $stmt->execute(); - $id = $label = NULL; - $stmt->bind_result($id, $label); - $results = array(); - while ($stmt->fetch()) - $results[$id] = $label; - $stmt->close(); - if (empty($results)) - printf("[015] Results should not be empty, subsequent tests will probably fail!\n"); + $stmt->close(); - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT id, label FROM test"); - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR))) - printf("[016] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt->execute(); - $id = $label = NULL; - $stmt->bind_result($id, $label); - $results2 = array(); - while ($stmt->fetch()) - $results2[$id] = $label; - $stmt->close(); - if ($results != $results2) { - printf("[017] Results should not differ. Dumping both result sets.\n"); - var_dump($results); - var_dump($results2); - } + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT id, label FROM test"); + $stmt->execute(); + $id = $label = NULL; + $stmt->bind_result($id, $label); + $results = array(); + while ($stmt->fetch()) + $results[$id] = $label; + $stmt->close(); + if (empty($results)) + printf("[015] Results should not be empty, subsequent tests will probably fail!\n"); - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT id, label FROM test"); - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY))) - printf("[018] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt->execute(); - $id = $label = NULL; - $stmt->bind_result($id, $label); - $results2 = array(); - while ($stmt->fetch()) - $results2[$id] = $label; - $stmt->close(); - if ($results != $results2) { - printf("[019] Results should not differ. Dumping both result sets.\n"); - var_dump($results); - var_dump($results2); - } + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT id, label FROM test"); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR))) + printf("[016] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + $stmt->execute(); + $id = $label = NULL; + $stmt->bind_result($id, $label); + $results2 = array(); + while ($stmt->fetch()) + $results2[$id] = $label; + $stmt->close(); + if ($results != $results2) { + printf("[017] Results should not differ. Dumping both result sets.\n"); + var_dump($results); + var_dump($results2); + } + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT id, label FROM test"); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY))) + printf("[018] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + $stmt->execute(); + $id = $label = NULL; + $stmt->bind_result($id, $label); + $results2 = array(); + while ($stmt->fetch()) + $results2[$id] = $label; + $stmt->close(); + if ($results != $results2) { + printf("[019] Results should not differ. Dumping both result sets.\n"); + var_dump($results); + var_dump($results2); } @@ -189,68 +181,64 @@ require_once("connect.inc"); // MYSQLI_STMT_ATTR_PREFETCH_ROWS // - if (mysqli_get_client_version() > 50007) { - - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT id, label FROM test"); - // Invalid prefetch value - try { - $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 0); - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; - } - - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 1))) - printf("[020] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt->execute(); - $id = $label = NULL; - $stmt->bind_result($id, $label); - $results = array(); - while ($stmt->fetch()) - $results[$id] = $label; - $stmt->close(); - if (empty($results)) - printf("[021] Results should not be empty, subsequent tests will probably fail!\n"); + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT id, label FROM test"); + // Invalid prefetch value + try { + $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 0); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } - /* prefetch is not supported - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT label FROM test"); - if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, -1))) - printf("[022] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - $stmt->close(); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 1))) + printf("[020] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + $stmt->execute(); + $id = $label = NULL; + $stmt->bind_result($id, $label); + $results = array(); + while ($stmt->fetch()) + $results[$id] = $label; + $stmt->close(); + if (empty($results)) + printf("[021] Results should not be empty, subsequent tests will probably fail!\n"); - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT label FROM test"); - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, PHP_INT_MAX))) - printf("[023] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt->close(); + /* prefetch is not supported + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT label FROM test"); + if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, -1))) + printf("[022] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); + $stmt->close(); - $stmt = mysqli_stmt_init($link); - $stmt->prepare("SELECT id, label FROM test"); - if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 2))) - printf("[024] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - $stmt->execute(); - $id = $label = NULL; - $stmt->bind_result($id, $label); - $results2 = array(); - while ($stmt->fetch()) - $results2[$id] = $label; - $stmt->close(); - if ($results != $results2) { - printf("[025] Results should not differ. Dumping both result sets.\n"); - var_dump($results); - var_dump($results2); - } - */ + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT label FROM test"); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, PHP_INT_MAX))) + printf("[023] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + $stmt->close(); + $stmt = mysqli_stmt_init($link); + $stmt->prepare("SELECT id, label FROM test"); + if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 2))) + printf("[024] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); + $stmt->execute(); + $id = $label = NULL; + $stmt->bind_result($id, $label); + $results2 = array(); + while ($stmt->fetch()) + $results2[$id] = $label; + $stmt->close(); + if ($results != $results2) { + printf("[025] Results should not differ. Dumping both result sets.\n"); + var_dump($results); + var_dump($results2); } + */ mysqli_close($link); print "done!"; ?> --CLEAN-- --EXPECT-- Error: mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt index afc34c27b4aa4..75351b0983c8e 100644 --- a/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt +++ b/ext/mysqli/tests/mysqli_stmt_big_prepare.phpt @@ -3,7 +3,6 @@ mysqli_stmt_prepare() --SKIPIF-- --FILE-- @@ -44,7 +43,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt b/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt index 44ab45c25748e..f9eca0f333919 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_limits.phpt @@ -3,7 +3,6 @@ Bind limits --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param.phpt index a12e01dc4203a..237b722646750 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_param() --SKIPIF-- --FILE-- @@ -413,7 +412,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- The number of variables must match the number of parameters in the prepared statement diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt index 3de2910fd43be..4db8db655ea32 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_call_user_func.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_param used with call_user_func_array() (see also bug #43568) --SKIPIF-- --FILE-- @@ -326,7 +325,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- Regular, procedural, using variables diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt index 4b243ef3d6010..b3a4bfe223625 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_param() - checking whether the parameters are modified (bug#443 --SKIPIF-- --FILE-- @@ -64,7 +63,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- Test 1: diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt index efe86972d98f9..137670235a6cc 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_many_columns.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_param() - Binding with very high number of columns --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt index f05e46fe9ddd9..b622f254d1ed5 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_param() - playing with references --SKIPIF-- --FILE-- @@ -201,7 +200,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt index 5a8dd90577aab..617e6e2cb0bad 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_type_juggling.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_param() - binding variable twice --SKIPIF-- --FILE-- @@ -121,7 +120,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt index f9556ad0f6380..5c4d43375de0d 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_result() --SKIPIF-- --FILE-- @@ -309,7 +308,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt index 39a2f503f8b16..f24c5856ed04e 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_bit.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_result() --SKIPIF-- --FILE-- @@ -153,7 +152,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt index 62a3e499aede9..ae778472ed1e8 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt @@ -3,7 +3,6 @@ Playing with SELECT FORMAT(...) AS _format - see also bugs.php.net/42378 --SKIPIF-- --INI-- diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt index 8040f35bcab58..8ac3a049a16b8 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_result() - playing with references --SKIPIF-- --FILE-- @@ -243,7 +242,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- plain vanilla... diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt index f1a68e3c0e099..00dcae479cc1a 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_zerofill.phpt @@ -3,7 +3,6 @@ mysqli_stmt_bind_result() - ZEROFILL --SKIPIF-- --FILE-- @@ -91,7 +90,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_close.phpt b/ext/mysqli/tests/mysqli_stmt_close.phpt index fd91eaecd1289..ba0dcd7140d5a 100644 --- a/ext/mysqli/tests/mysqli_stmt_close.phpt +++ b/ext/mysqli/tests/mysqli_stmt_close.phpt @@ -3,7 +3,6 @@ mysqli_stmt_close() --SKIPIF-- --FILE-- @@ -78,7 +77,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_data_seek.phpt b/ext/mysqli/tests/mysqli_stmt_data_seek.phpt index 5594600747792..a16aa631e4a6e 100644 --- a/ext/mysqli/tests/mysqli_stmt_data_seek.phpt +++ b/ext/mysqli/tests/mysqli_stmt_data_seek.phpt @@ -3,7 +3,6 @@ mysqli_stmt_data_seek() --SKIPIF-- --FILE-- @@ -83,7 +82,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt b/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt index 4bffb7cab75a3..14f1ebbe506ed 100644 --- a/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt +++ b/ext/mysqli/tests/mysqli_stmt_datatype_change.phpt @@ -3,7 +3,6 @@ Playing with datatype change between prepare and execute --SKIPIF-- --FILE-- @@ -61,7 +60,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS type_change")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_close($link); ?> diff --git a/ext/mysqli/tests/mysqli_stmt_errno.phpt b/ext/mysqli/tests/mysqli_stmt_errno.phpt index 9928d0c1f3f14..b65770c444c63 100644 --- a/ext/mysqli/tests/mysqli_stmt_errno.phpt +++ b/ext/mysqli/tests/mysqli_stmt_errno.phpt @@ -3,7 +3,6 @@ mysqli_stmt_errno() --SKIPIF-- --FILE-- @@ -55,7 +54,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_error.phpt b/ext/mysqli/tests/mysqli_stmt_error.phpt index 98e61026555dc..0bf93edaa972f 100644 --- a/ext/mysqli/tests/mysqli_stmt_error.phpt +++ b/ext/mysqli/tests/mysqli_stmt_error.phpt @@ -3,7 +3,6 @@ mysqli_stmt_error() --SKIPIF-- --FILE-- @@ -55,7 +54,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_execute.phpt b/ext/mysqli/tests/mysqli_stmt_execute.phpt index d3f404aa3d3ac..a939a93d31e25 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute.phpt @@ -3,13 +3,12 @@ mysqli_stmt_execute() --SKIPIF-- --FILE-- @@ -134,7 +133,7 @@ if (mysqli_get_server_version($link) <= 40100) { ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt index 33e6cd1c8b021..b26c16f98ae7c 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt @@ -6,10 +6,10 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); } if (mysqli_get_server_version($link) <= 50000) { - die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); + die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($link))); } ?> --FILE-- @@ -188,7 +188,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch")) - printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @mysqli_query($link, 'DROP PROCEDURE IF EXISTS p'); diff --git a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_next_result.phpt b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_next_result.phpt index f322a1a76c36f..86a703c6412b9 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_next_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_next_result.phpt @@ -6,10 +6,10 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); } if (mysqli_get_server_version($link) < 50503) { - die(sprintf('skip Needs MySQL 5.5.3+, found version %d.', mysqli_get_server_version($link))); + die(sprintf('skip Needs MySQL 5.5.3+, found version %d.', mysqli_get_server_version($link))); } ?> --FILE-- diff --git a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_out.phpt b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_out.phpt index 7cbbc74988e9b..667268b3aa1ef 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_out.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc_out.phpt @@ -6,14 +6,14 @@ require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); require_once('connect.inc'); if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); + die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error())); } if (mysqli_get_server_version($link) < 50503) { - die(sprintf('skip Needs MySQL 5.5.3+, found version %d.', mysqli_get_server_version($link))); + die(sprintf('skip Needs MySQL 5.5.3+, found version %d.', mysqli_get_server_version($link))); } /* if ($IS_MYSQLND) { - die(sprintf("skip WHY ?!")); + die(sprintf("skip WHY ?!")); } */ ?> diff --git a/ext/mysqli/tests/mysqli_stmt_fetch.phpt b/ext/mysqli/tests/mysqli_stmt_fetch.phpt index 4dce9dfefade5..64b4862653ad3 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch.phpt @@ -3,7 +3,6 @@ mysqli_stmt_fetch() --SKIPIF-- --FILE-- @@ -79,7 +78,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt b/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt index b3c74e4af2fdb..1e25a77a6b643 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt @@ -2,17 +2,13 @@ Fetching BIT column values using the PS API --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt b/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt index fe5d2f3799d6d..073a48c228cc5 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch_fields_win32_unicode.phpt @@ -3,7 +3,6 @@ mysqli_stmt_fetch_fields() unicode, win32 --SKIPIF-- --FILE-- @@ -48,7 +47,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- OK: 1 diff --git a/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt b/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt index 8c87199602b06..432d72fe545b1 100644 --- a/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt +++ b/ext/mysqli/tests/mysqli_stmt_fetch_geom.phpt @@ -2,12 +2,11 @@ mysqli_stmt_fetch - geometry / spatial types --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_field_count.phpt index 5c725cd063109..4424248c48f2a 100644 --- a/ext/mysqli/tests/mysqli_stmt_field_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_field_count.phpt @@ -3,7 +3,6 @@ mysqli_stmt_field_counts() --SKIPIF-- --FILE-- @@ -93,7 +92,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_free_result.phpt b/ext/mysqli/tests/mysqli_stmt_free_result.phpt index b43afce5c9cae..867a8193d4160 100644 --- a/ext/mysqli/tests/mysqli_stmt_free_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_free_result.phpt @@ -3,7 +3,6 @@ mysqli_stmt_free_result() --SKIPIF-- --FILE-- @@ -73,7 +72,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_get_result.phpt b/ext/mysqli/tests/mysqli_stmt_get_result.phpt index 09c63ab7f8738..2dee92d9ae9d3 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result.phpt @@ -3,11 +3,10 @@ mysqli_stmt_get_result() --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_get_result2.phpt b/ext/mysqli/tests/mysqli_stmt_get_result2.phpt index bbcb926c014e5..99fabb89d8fdf 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result2.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result2.phpt @@ -3,10 +3,9 @@ mysqli_stmt_get_result() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt index 7c4292de007a0..dace91f4c89e9 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt @@ -2,21 +2,17 @@ Fetching BIT column values using the PS API --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt index 2d58ca20d386a..300a1e3397ceb 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_field_count.phpt @@ -2,12 +2,11 @@ mysqli_stmt_get_result() - meta data, field_count() --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- 2 2 diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt index 9b8369a7ca83f..2105a590d436c 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_geom.phpt @@ -2,15 +2,14 @@ mysqli_stmt_get_result - geometry / spatial types --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt index 9e6ddec044b4f..2fe305ed21ceb 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_metadata.phpt @@ -3,11 +3,10 @@ mysqli_stmt_get_result() - meta data --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- array(2) { diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt index 1c5d3ecbc7c55..0c9f0dfe23e7a 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt @@ -3,11 +3,10 @@ mysqli_stmt_get_result() - meta data, field info --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt index 23254e1755816..f2428aeb92785 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_non_select.phpt @@ -3,11 +3,10 @@ mysqli_stmt_get_result() - SHOW, DESCRIBE, EXPLAIN --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt index cf9e634cc9e31..8c3d6e1e35d60 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_seek.phpt @@ -3,11 +3,10 @@ mysqli_stmt_get_result() - seeking --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- mysqli_result::data_seek(): Argument #1 ($offset) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt b/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt index 30b49df4e5193..b188ed1d844b1 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_result_types.phpt @@ -2,12 +2,11 @@ mysqli_stmt_get_result - data types --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt b/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt index c37c45af7d124..3787a13386c07 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt @@ -3,22 +3,21 @@ mysqli_stmt_get_warnings() - TODO --SKIPIF-- errno, $link->error)); + !mysqli_query($link, "CREATE TABLE test(id SMALLINT)")) + die(sprintf("skip [%d] %s\n", $link->errno, $link->error)); if (!@mysqli_query($link, "SET sql_mode=''") || !@mysqli_query($link, "INSERT INTO test(id) VALUES (100001)")) - die("skip Strict sql mode seems to be active. We won't get a warning to check for."); + die("skip Strict sql mode seems to be active. We won't get a warning to check for."); mysqli_query($link, "DROP TABLE IF EXISTS test"); ?> @@ -97,7 +96,7 @@ mysqli_query($link, "DROP TABLE IF EXISTS test"); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_init.phpt b/ext/mysqli/tests/mysqli_stmt_init.phpt index e68b405acc608..22a21a64d27c1 100644 --- a/ext/mysqli/tests/mysqli_stmt_init.phpt +++ b/ext/mysqli/tests/mysqli_stmt_init.phpt @@ -3,7 +3,6 @@ mysqli_stmt_init() --SKIPIF-- --FILE-- @@ -41,7 +40,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_insert_id.phpt b/ext/mysqli/tests/mysqli_stmt_insert_id.phpt index fe5e794e57dbc..d49bd1b094324 100644 --- a/ext/mysqli/tests/mysqli_stmt_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_stmt_insert_id.phpt @@ -3,7 +3,6 @@ mysqli_stmt_insert_id() --SKIPIF-- --FILE-- @@ -67,7 +66,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_multires.phpt b/ext/mysqli/tests/mysqli_stmt_multires.phpt index abb9ecbfb2797..73af79e2b166e 100644 --- a/ext/mysqli/tests/mysqli_stmt_multires.phpt +++ b/ext/mysqli/tests/mysqli_stmt_multires.phpt @@ -94,10 +94,10 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- query('DROP PROCEDURE IF EXISTS p123')) { - printf("[001] [%d] %s\n", $link->error, $link->errno); - } + require_once("connect.inc"); + if (!$link->query('DROP PROCEDURE IF EXISTS p123')) { + printf("[001] [%d] %s\n", $link->error, $link->errno); + } ?> --EXPECT-- string(4) "pre:" diff --git a/ext/mysqli/tests/mysqli_stmt_num_rows.phpt b/ext/mysqli/tests/mysqli_stmt_num_rows.phpt index 33d9dfe552e28..8b932dc053469 100644 --- a/ext/mysqli/tests/mysqli_stmt_num_rows.phpt +++ b/ext/mysqli/tests/mysqli_stmt_num_rows.phpt @@ -3,7 +3,6 @@ mysqli_stmt_num_rows() --SKIPIF-- --FILE-- @@ -103,7 +102,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- run_tests.php don't fool me with your 'ungreedy' expression '.+?'! diff --git a/ext/mysqli/tests/mysqli_stmt_param_count.phpt b/ext/mysqli/tests/mysqli_stmt_param_count.phpt index 421854a480f97..50886949359fe 100644 --- a/ext/mysqli/tests/mysqli_stmt_param_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_param_count.phpt @@ -3,7 +3,6 @@ mysqli_stmt_param_count() --SKIPIF-- --FILE-- @@ -54,7 +53,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_prepare.phpt index 0f89a705c9261..36ce473f3da1d 100644 --- a/ext/mysqli/tests/mysqli_stmt_prepare.phpt +++ b/ext/mysqli/tests/mysqli_stmt_prepare.phpt @@ -3,7 +3,6 @@ mysqli_stmt_prepare() --SKIPIF-- --FILE-- @@ -40,7 +39,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_reset.phpt b/ext/mysqli/tests/mysqli_stmt_reset.phpt index ac557b0c2023e..933f0774bf0d7 100644 --- a/ext/mysqli/tests/mysqli_stmt_reset.phpt +++ b/ext/mysqli/tests/mysqli_stmt_reset.phpt @@ -3,7 +3,6 @@ mysqli_stmt_reset() --SKIPIF-- --FILE-- @@ -98,7 +97,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt b/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt index aedcc5d9aa392..250e93ed001ca 100644 --- a/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt +++ b/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt @@ -3,7 +3,6 @@ mysqli_stmt_result_metadata() --SKIPIF-- --FILE-- @@ -87,7 +86,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECTF-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt b/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt index a07719b906bb8..929e9df645d01 100644 --- a/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt +++ b/ext/mysqli/tests/mysqli_stmt_result_metadata_sqltests.phpt @@ -3,7 +3,6 @@ mysqli_stmt_result_metadata() - non SELECT statements --SKIPIF-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index 705f19e8c2178..b9139cb6e1979 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt @@ -3,7 +3,6 @@ mysqli_stmt_send_long_data() --SKIPIF-- --FILE-- @@ -106,7 +105,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt_send_long_data(): Argument #2 ($param_nr) must be greater than or equal to 0 diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt index 63c1f59bfe49b..b191df602254b 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt @@ -3,11 +3,10 @@ mysqli_stmt_send_long_data() - exceed packet size, libmysql - bug #26824 --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt index 927d07c5cfaa4..c7376afdd3051 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt @@ -3,11 +3,10 @@ mysqli_stmt_send_long_data() - exceed packet size, mysqlnd --SKIPIF-- --FILE-- --CLEAN-- --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt index a365d4eb9e02c..edad2b9c3f90c 100644 --- a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt +++ b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt @@ -3,7 +3,6 @@ mysqli_stmt_sqlstate() --SKIPIF-- --FILE-- @@ -47,7 +46,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_store_result.phpt b/ext/mysqli/tests/mysqli_stmt_store_result.phpt index 3c6ebe66b47c6..d8f4c4769f78d 100644 --- a/ext/mysqli/tests/mysqli_stmt_store_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_store_result.phpt @@ -3,7 +3,6 @@ mysqli_stmt_store_result() --SKIPIF-- --FILE-- @@ -78,7 +77,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli_stmt object is not fully initialized diff --git a/ext/mysqli/tests/mysqli_stmt_unclonable.phpt b/ext/mysqli/tests/mysqli_stmt_unclonable.phpt index 722295b177eb8..0d77780022814 100644 --- a/ext/mysqli/tests/mysqli_stmt_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_stmt_unclonable.phpt @@ -3,7 +3,6 @@ Trying to clone mysqli_stmt object --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_store_result.phpt b/ext/mysqli/tests/mysqli_store_result.phpt index 2213047a6c932..8d4e72bdf9be2 100644 --- a/ext/mysqli/tests/mysqli_store_result.phpt +++ b/ext/mysqli/tests/mysqli_store_result.phpt @@ -3,7 +3,6 @@ mysqli_store_result() --SKIPIF-- --FILE-- @@ -51,7 +50,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt b/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt index 31645b026c54f..70a864270d9af 100644 --- a/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt +++ b/ext/mysqli/tests/mysqli_store_result_buffered_c.phpt @@ -3,11 +3,11 @@ mysqli_store_result() --SKIPIF-- ---INI-- -mysqlnd.debug="d:t:O,{TMP}/mysqlnd.trace" --FILE-- --FILE-- @@ -31,7 +30,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_thread_safe.phpt b/ext/mysqli/tests/mysqli_thread_safe.phpt index 3f45127095cce..d4ab11a956e77 100644 --- a/ext/mysqli/tests/mysqli_thread_safe.phpt +++ b/ext/mysqli/tests/mysqli_thread_safe.phpt @@ -3,7 +3,6 @@ mysqli_thread_safe() --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_use_result.phpt b/ext/mysqli/tests/mysqli_use_result.phpt index c309d3e3910b5..a333891bba211 100644 --- a/ext/mysqli/tests/mysqli_use_result.phpt +++ b/ext/mysqli/tests/mysqli_use_result.phpt @@ -3,7 +3,6 @@ mysqli_use_result() --SKIPIF-- --FILE-- @@ -53,9 +52,9 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- -mysqli_data_seek() cannot be used with MYSQLI_USE_RESULT +mysqli_data_seek() cannot be used in MYSQLI_USE_RESULT mode mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_warning_count.phpt b/ext/mysqli/tests/mysqli_warning_count.phpt index 18e80ac92d80d..5ad0e10334917 100644 --- a/ext/mysqli/tests/mysqli_warning_count.phpt +++ b/ext/mysqli/tests/mysqli_warning_count.phpt @@ -3,7 +3,6 @@ mysqli_warning_count() --SKIPIF-- --FILE-- @@ -36,7 +35,7 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- --EXPECT-- mysqli object is already closed diff --git a/ext/mysqli/tests/mysqli_warning_unclonable.phpt b/ext/mysqli/tests/mysqli_warning_unclonable.phpt index e68cd962126ce..e33bdb7d3a338 100644 --- a/ext/mysqli/tests/mysqli_warning_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_warning_unclonable.phpt @@ -3,11 +3,10 @@ Trying to clone mysqli_warning object --SKIPIF-- --FILE-- --CLEAN-- --EXPECTF-- Fatal error: Trying to clone an uncloneable object of class mysqli_warning in %s on line %d diff --git a/ext/mysqli/tests/skipifemb.inc b/ext/mysqli/tests/skipifemb.inc deleted file mode 100644 index 2b7941d8254c3..0000000000000 --- a/ext/mysqli/tests/skipifemb.inc +++ /dev/null @@ -1,5 +0,0 @@ -embedded) - die("skip test doesn't run with embedded server"); -?> diff --git a/ext/mysqli/tests/skipifnotemb.inc b/ext/mysqli/tests/skipifnotemb.inc deleted file mode 100644 index e88e4238360cc..0000000000000 --- a/ext/mysqli/tests/skipifnotemb.inc +++ /dev/null @@ -1,5 +0,0 @@ -embedded) - die("skip test for with embedded server only"); -?> diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 252c05f676dd2..5915e1266e5d4 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -1152,8 +1152,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c DBG_INF_FMT("conn=%llu cs=%s", conn->thread_id, csname); if (!charset) { - SET_CLIENT_ERROR(conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, - "Invalid characterset or character set not supported"); + SET_CLIENT_ERROR(conn->error_info, CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Invalid character set was provided"); DBG_RETURN(ret); } @@ -1161,9 +1160,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c char * query; size_t query_len = mnd_sprintf(&query, 0, "SET NAMES %s", csname); - if (FAIL == (ret = conn->m->query(conn, query, query_len))) { - php_error_docref(NULL, E_WARNING, "Error executing query"); - } else if (conn->error_info->error_no) { + if (FAIL == (ret = conn->m->query(conn, query, query_len)) || conn->error_info->error_no) { ret = FAIL; } else { conn->charset = charset; @@ -2132,23 +2129,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi } smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1); } - if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) { - zend_ulong server_version = conn->m->get_server_version(conn); - if (server_version < 50605L) { - php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required"); - smart_str_free(&tmp_str); - break; - } else if (mode & TRANS_START_READ_WRITE) { - if (tmp_str.s && ZSTR_LEN(tmp_str.s)) { - smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); - } - smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1); - } else if (mode & TRANS_START_READ_ONLY) { - if (tmp_str.s && ZSTR_LEN(tmp_str.s)) { - smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); - } - smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1); + if (mode & TRANS_START_READ_WRITE) { + if (tmp_str.s && ZSTR_LEN(tmp_str.s)) { + smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); } + smart_str_appendl(&tmp_str, "READ WRITE", sizeof("READ WRITE") - 1); + } else if (mode & TRANS_START_READ_ONLY) { + if (tmp_str.s && ZSTR_LEN(tmp_str.s)) { + smart_str_appendl(&tmp_str, ", ", sizeof(", ") - 1); + } + smart_str_appendl(&tmp_str, "READ ONLY", sizeof("READ ONLY") - 1); } smart_str_0(&tmp_str); @@ -2167,6 +2157,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi } ret = conn->m->query(conn, query, query_len); mnd_sprintf_free(query); + if (ret && mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY) && + mysqlnd_stmt_errno(conn) == 1064) { + php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required"); + break; + } } } while (0); conn->m->local_tx_end(conn, this_func, ret); diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index ab02d5645a7f9..55590f45c97ad 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -523,7 +523,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const if (i + 1 < mode_len && mode[i+1] == ',') { unsigned int j = i + 2; #ifdef PHP_WIN32 - if (i+4 < mode_len && mode[i+3] == ':' && (mode[i+4] == '\\' || mode[i+5] == '/')) { + if (i+4 < mode_len && mode[i+3] == ':' && (mode[i+4] == '\\' || mode[i+4] == '/')) { j = i + 5; } #endif diff --git a/ext/mysqlnd/mysqlnd_protocol_frame_codec.c b/ext/mysqlnd/mysqlnd_protocol_frame_codec.c index 5ec7dd03e316c..f562e8fa5e19f 100644 --- a/ext/mysqlnd/mysqlnd_protocol_frame_codec.c +++ b/ext/mysqlnd/mysqlnd_protocol_frame_codec.c @@ -48,6 +48,57 @@ MYSQLND_METHOD(mysqlnd_pfc, reset)(MYSQLND_PFC * const pfc, MYSQLND_STATS * cons #define STORE_HEADER_SIZE(safe_storage, buffer) COPY_HEADER((safe_storage), (buffer)) #define RESTORE_HEADER_SIZE(buffer, safe_storage) STORE_HEADER_SIZE((safe_storage), (buffer)) +#ifdef MYSQLND_COMPRESSION_ENABLED +static ssize_t write_compressed_packet( + const MYSQLND_PFC *pfc, MYSQLND_VIO *vio, + MYSQLND_STATS *conn_stats, MYSQLND_ERROR_INFO *error_info, + zend_uchar *uncompressed_payload, size_t to_be_sent, zend_uchar *compress_buf) { + DBG_ENTER("write_compressed_packet"); + /* here we need to compress the data and then write it, first comes the compressed header */ + size_t tmp_complen = to_be_sent; + size_t payload_size; + if (PASS == pfc->data->m.encode((compress_buf + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE), &tmp_complen, + uncompressed_payload, to_be_sent)) + { + int3store(compress_buf + MYSQLND_HEADER_SIZE, to_be_sent); + payload_size = tmp_complen; + } else { + int3store(compress_buf + MYSQLND_HEADER_SIZE, 0); + memcpy(compress_buf + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, uncompressed_payload, to_be_sent); + payload_size = to_be_sent; + } + + int3store(compress_buf, payload_size); + int1store(compress_buf + 3, pfc->data->compressed_envelope_packet_no); + DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE); + + ssize_t bytes_sent = vio->data->m.network_write(vio, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, conn_stats, error_info); + pfc->data->compressed_envelope_packet_no++; +#ifdef WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY + if (res == Z_OK) { + size_t decompressed_size = left + MYSQLND_HEADER_SIZE; + zend_uchar * decompressed_data = mnd_malloc(decompressed_size); + int error = pfc->data->m.decode(decompressed_data, decompressed_size, + compress_buf + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, payload_size); + if (error == Z_OK) { + int i; + DBG_INF("success decompressing"); + for (i = 0 ; i < decompressed_size; i++) { + if (i && (i % 30 == 0)) { + printf("\n\t\t"); + } + printf("%.2X ", (int)*((char*)&(decompressed_data[i]))); + DBG_INF_FMT("%.2X ", (int)*((char*)&(decompressed_data[i]))); + } + } else { + DBG_INF("error decompressing"); + } + mnd_free(decompressed_data); + } +#endif /* WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY */ + DBG_RETURN(bytes_sent); +} +#endif /* {{{ mysqlnd_pfc::send */ /* @@ -90,53 +141,27 @@ MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const v DBG_INF_FMT("packet_no=%u", pfc->data->packet_no); #ifdef MYSQLND_COMPRESSION_ENABLED if (pfc->data->compressed == TRUE) { - /* here we need to compress the data and then write it, first comes the compressed header */ - size_t tmp_complen = to_be_sent; - size_t payload_size; zend_uchar * uncompressed_payload = p; /* should include the header */ - STORE_HEADER_SIZE(safe_storage, uncompressed_payload); int3store(uncompressed_payload, to_be_sent); int1store(uncompressed_payload + 3, pfc->data->packet_no); - if (PASS == pfc->data->m.encode((compress_buf + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE), &tmp_complen, - uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE)) - { - int3store(compress_buf + MYSQLND_HEADER_SIZE, to_be_sent + MYSQLND_HEADER_SIZE); - payload_size = tmp_complen; + if (to_be_sent <= MYSQLND_MAX_PACKET_SIZE - MYSQLND_HEADER_SIZE) { + bytes_sent = write_compressed_packet( + pfc, vio, conn_stats, error_info, + uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE, compress_buf); } else { - int3store(compress_buf + MYSQLND_HEADER_SIZE, 0); - memcpy(compress_buf + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE); - payload_size = to_be_sent + MYSQLND_HEADER_SIZE; + /* The uncompressed size including the header would overflow. Split into two + * compressed packets. The size of the first one is relatively arbitrary here. */ + const size_t split_off_bytes = 8192; + bytes_sent = write_compressed_packet( + pfc, vio, conn_stats, error_info, + uncompressed_payload, split_off_bytes, compress_buf); + bytes_sent = write_compressed_packet( + pfc, vio, conn_stats, error_info, + uncompressed_payload + split_off_bytes, + to_be_sent + MYSQLND_HEADER_SIZE - split_off_bytes, compress_buf); } RESTORE_HEADER_SIZE(uncompressed_payload, safe_storage); - - int3store(compress_buf, payload_size); - int1store(compress_buf + 3, pfc->data->packet_no); - DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE); - bytes_sent = vio->data->m.network_write(vio, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, conn_stats, error_info); - pfc->data->compressed_envelope_packet_no++; - #ifdef WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY - if (res == Z_OK) { - size_t decompressed_size = left + MYSQLND_HEADER_SIZE; - zend_uchar * decompressed_data = mnd_malloc(decompressed_size); - int error = pfc->data->m.decode(decompressed_data, decompressed_size, - compress_buf + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, payload_size); - if (error == Z_OK) { - int i; - DBG_INF("success decompressing"); - for (i = 0 ; i < decompressed_size; i++) { - if (i && (i % 30 == 0)) { - printf("\n\t\t"); - } - printf("%.2X ", (int)*((char*)&(decompressed_data[i]))); - DBG_INF_FMT("%.2X ", (int)*((char*)&(decompressed_data[i]))); - } - } else { - DBG_INF("error decompressing"); - } - mnd_free(decompressed_data); - } - #endif /* WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY */ } else #endif /* MYSQLND_COMPRESSION_ENABLED */ { diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index ab7fc61f94771..515526d11df58 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -2144,7 +2144,9 @@ size_t php_mysqlnd_cached_sha2_result_write(MYSQLND_CONN_DATA * conn, void * _pa int1store(buffer + MYSQLND_HEADER_SIZE, '\2'); sent = pfc->data->m.send(pfc, vio, buffer, 1, stats, error_info); } else { - memcpy(buffer + MYSQLND_HEADER_SIZE, packet->password, packet->password_len); + if (packet->password_len != 0) { + memcpy(buffer + MYSQLND_HEADER_SIZE, packet->password, packet->password_len); + } sent = pfc->data->m.send(pfc, vio, buffer, packet->password_len, stats, error_info); } diff --git a/ext/oci8/oci8.stub.php b/ext/oci8/oci8.stub.php index 917225f562655..419df17be0956 100644 --- a/ext/oci8/oci8.stub.php +++ b/ext/oci8/oci8.stub.php @@ -320,50 +320,50 @@ function ocifreecursor($statement_resource): bool {} /** * @param resource $connection_resource */ -function oci_close($connection_resource): bool|null {} +function oci_close($connection_resource): ?bool {} /** * @param resource $connection_resource * @alias oci_close * @deprecated */ -function ocilogoff($connection_resource): bool|null {} +function ocilogoff($connection_resource): ?bool {} /** * @return resource|false */ -function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {} +function oci_new_connect(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {} /** * @return resource|false * @alias oci_new_connect * @deprecated */ -function ocinlogon(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {} +function ocinlogon(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {} /** * @return resource|false */ -function oci_connect(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {} +function oci_connect(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {} /** * @return resource|false * @alias oci_connect * @deprecated */ -function ocilogon(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {} +function ocilogon(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {} /** * @return resource|false */ -function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {} +function oci_pconnect(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {} /** * @return resource|false * @alias oci_pconnect * @deprecated */ -function ociplogon(string $username, string $password, ?string $connection_string = null, string $character_set = '', int $session_mode = OCI_DEFAULT) {} +function ociplogon(string $username, string $password, ?string $connection_string = null, string $character_set = "", int $session_mode = OCI_DEFAULT) {} /** * @param resource|null $connection_or_statement_resource diff --git a/ext/oci8/oci8_arginfo.h b/ext/oci8/oci8_arginfo.h index 0bcc18f06a1fc..bd6c7bc310d60 100644 --- a/ext/oci8/oci8_arginfo.h +++ b/ext/oci8/oci8_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6cdc7c967ce80c39eaef1c860ba8f8aa2cb3c979 */ + * Stub hash: 154cd2128ba63d5d361b1f2f6ff55ae1659c59b9 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_oci_define_by_name, 0, 3, _IS_BOOL, 0) ZEND_ARG_INFO(0, statement_resource) @@ -255,7 +255,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_connect, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_string, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, character_set, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, character_set, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, session_mode, IS_LONG, 0, "OCI_DEFAULT") ZEND_END_ARG_INFO() diff --git a/ext/oci8/tests/conn_attr_1.phpt b/ext/oci8/tests/conn_attr_1.phpt index ce23b2b5aace5..bcfb1e8515a56 100644 --- a/ext/oci8/tests/conn_attr_1.phpt +++ b/ext/oci8/tests/conn_attr_1.phpt @@ -11,7 +11,7 @@ if ($test_drcp) die("skip output might vary with DRCP"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } ?> --FILE-- diff --git a/ext/oci8/tests/conn_attr_2.phpt b/ext/oci8/tests/conn_attr_2.phpt index 61d59093b150a..0005faa9a35f5 100644 --- a/ext/oci8/tests/conn_attr_2.phpt +++ b/ext/oci8/tests/conn_attr_2.phpt @@ -10,7 +10,7 @@ if ($test_drcp) die("skip output might vary with DRCP"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } ?> --INI-- diff --git a/ext/oci8/tests/conn_attr_3.phpt b/ext/oci8/tests/conn_attr_3.phpt index a116be0fab289..bcab76b80c2e4 100644 --- a/ext/oci8/tests/conn_attr_3.phpt +++ b/ext/oci8/tests/conn_attr_3.phpt @@ -10,7 +10,7 @@ if ($test_drcp) die("skip output might vary with DRCP"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } ?> --FILE-- diff --git a/ext/oci8/tests/conn_attr_5.phpt b/ext/oci8/tests/conn_attr_5.phpt index 4a58f917d3393..006b49ab1e341 100644 --- a/ext/oci8/tests/conn_attr_5.phpt +++ b/ext/oci8/tests/conn_attr_5.phpt @@ -10,7 +10,7 @@ if ($test_drcp) die("skip output might vary with DRCP"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] >= 10)) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } ?> --FILE-- diff --git a/ext/oci8/tests/connect_without_oracle_home.phpt b/ext/oci8/tests/connect_without_oracle_home.phpt index 203fd57e92350..57d348082bd95 100644 --- a/ext/oci8/tests/connect_without_oracle_home.phpt +++ b/ext/oci8/tests/connect_without_oracle_home.phpt @@ -8,7 +8,7 @@ phpinfo(INFO_MODULES); $phpinfo = ob_get_clean(); $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { - die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); + die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!isset($matches[0]) || !($matches[1] == 10 && $matches[2] == 2)) { diff --git a/ext/oci8/tests/connect_without_oracle_home_11.phpt b/ext/oci8/tests/connect_without_oracle_home_11.phpt index 85ac993877088..51e5ef38ac54a 100644 --- a/ext/oci8/tests/connect_without_oracle_home_11.phpt +++ b/ext/oci8/tests/connect_without_oracle_home_11.phpt @@ -8,7 +8,7 @@ phpinfo(INFO_MODULES); $phpinfo = ob_get_clean(); $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov != 1) { - die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); + die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/oci8/tests/edition_1.phpt b/ext/oci8/tests/edition_1.phpt index b75dfe4350f08..c013a687eb73a 100644 --- a/ext/oci8/tests/edition_1.phpt +++ b/ext/oci8/tests/edition_1.phpt @@ -15,7 +15,7 @@ if (!(isset($matches[0]) && (($matches[1] == 11 && $matches[2] >= 2) || ($matches[1] >= 12) ))) { - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/oci8/tests/edition_2.phpt b/ext/oci8/tests/edition_2.phpt index a556fb4a17d8b..4aab1c36bca01 100644 --- a/ext/oci8/tests/edition_2.phpt +++ b/ext/oci8/tests/edition_2.phpt @@ -13,7 +13,7 @@ if (!(isset($matches[0]) && (($matches[1] == 11 && $matches[2] >= 2) || ($matches[1] >= 12) ))) { - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/oci8/tests/password_new.phpt b/ext/oci8/tests/password_new.phpt index 8c7acd471feaa..cdc79b1057bf3 100644 --- a/ext/oci8/tests/password_new.phpt +++ b/ext/oci8/tests/password_new.phpt @@ -16,7 +16,7 @@ if (!(isset($matches_sv[0]) && isset($matches[0]) && $matches_sv[3] == $matches[3] && $matches_sv[4] == $matches[4])) { // Avoid diffs due to cross version protocol changes (e.g. like 11.2.0.2-11.2.0.3) and bugs like Oracle bug: 6277160 - die ("skip test only runs when database client libraries and database server are the same version"); + die ("skip test only runs when database client libraries and database server are the same version"); } // This test in Oracle 12c needs a non-CDB or the root container diff --git a/ext/oci8/tests/pecl_bug16035.phpt b/ext/oci8/tests/pecl_bug16035.phpt index 2fdef268317ed..37e725a9b7d03 100644 --- a/ext/oci8/tests/pecl_bug16035.phpt +++ b/ext/oci8/tests/pecl_bug16035.phpt @@ -8,7 +8,7 @@ phpinfo(INFO_MODULES); $phpinfo = ob_get_clean(); $ov = preg_match('/Compile-time ORACLE_HOME/', $phpinfo); if ($ov !== 1) { - die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); + die ("skip Test only valid when OCI8 is built with an ORACLE_HOME"); } ?> --ENV-- diff --git a/ext/oci8/tests/refcur_prefetch_1.phpt b/ext/oci8/tests/refcur_prefetch_1.phpt index 0297401f995dc..5f8fe821d40a6 100644 --- a/ext/oci8/tests/refcur_prefetch_1.phpt +++ b/ext/oci8/tests/refcur_prefetch_1.phpt @@ -7,7 +7,7 @@ require(__DIR__."/connect.inc"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && ($matches[1] >= 10))) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/oci8/tests/refcur_prefetch_2.phpt b/ext/oci8/tests/refcur_prefetch_2.phpt index 69146914a4bf7..de8197a5cb549 100644 --- a/ext/oci8/tests/refcur_prefetch_2.phpt +++ b/ext/oci8/tests/refcur_prefetch_2.phpt @@ -7,7 +7,7 @@ require(__DIR__."/connect.inc"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && ($matches[1] >= 10))) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/oci8/tests/refcur_prefetch_3.phpt b/ext/oci8/tests/refcur_prefetch_3.phpt index bfc2faf5bf097..719f765b4f440 100644 --- a/ext/oci8/tests/refcur_prefetch_3.phpt +++ b/ext/oci8/tests/refcur_prefetch_3.phpt @@ -11,7 +11,7 @@ if (!(isset($matches[0]) && (($matches[1] == 11 && $matches[2] >= 2) || ($matches[1] >= 12) ))) { - die("skip expected output only valid when using Oracle 11gR2 or greater database server"); + die("skip expected output only valid when using Oracle 11gR2 or greater database server"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/oci8/tests/refcur_prefetch_4.phpt b/ext/oci8/tests/refcur_prefetch_4.phpt index 6c0b1b26d077e..64ccfbe166028 100644 --- a/ext/oci8/tests/refcur_prefetch_4.phpt +++ b/ext/oci8/tests/refcur_prefetch_4.phpt @@ -7,7 +7,7 @@ require(__DIR__."/connect.inc"); preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && ($matches[1] >= 10))) { - die("skip expected output only valid when using Oracle 10g or greater database server"); + die("skip expected output only valid when using Oracle 10g or greater database server"); } preg_match('/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/', oci_client_version(), $matches); if (!(isset($matches[0]) && diff --git a/ext/odbc/odbc.stub.php b/ext/odbc/odbc.stub.php index cb318f7ac9d4f..9316f1d7e41ce 100644 --- a/ext/odbc/odbc.stub.php +++ b/ext/odbc/odbc.stub.php @@ -61,7 +61,7 @@ function odbc_fetch_row($result_id, int $row_number = UNKNOWN): bool {} function odbc_result($result_id, string|int $field): string|bool|null {} /** @param resource $result_id */ -function odbc_result_all($result_id, string $format = ''): int|false {} +function odbc_result_all($result_id, string $format = ""): int|false {} /** @param resource $result_id */ function odbc_free_result($result_id): bool {} diff --git a/ext/odbc/odbc_arginfo.h b/ext/odbc/odbc_arginfo.h index 778ab242a0b10..7d42c63530a09 100644 --- a/ext/odbc/odbc_arginfo.h +++ b/ext/odbc/odbc_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: cf17952d8c3b88f218bbb8d1c21ba40079574c04 */ + * Stub hash: 57db79b23d127851f985d9b6280b113637384a68 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() @@ -75,7 +75,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_odbc_result_all, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_INFO(0, result_id) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_free_result, 0, 1, _IS_BOOL, 0) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 98b079c60310a..6636a810433d7 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -523,7 +523,7 @@ PHP_MINFO_FUNCTION(odbc) php_info_print_table_row(2, "Active Links", buf); php_info_print_table_row(2, "ODBC library", PHP_ODBC_TYPE); #ifdef ODBCVER - snprintf(buf, sizeof(buf), "0x%0.4x", ODBCVER); + snprintf(buf, sizeof(buf), "0x%.4x", ODBCVER); php_info_print_table_row(2, "ODBCVER", buf); #endif #ifndef PHP_WIN32 @@ -560,7 +560,7 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS) while(henv != SQL_NULL_HENV){ do { */ - rc = SQLError(henv, conn, stmt, ODBCG(laststate), &error, ODBCG(lasterrormsg), sizeof(ODBCG(lasterrormsg))-1, &errormsgsize); + rc = SQLError(henv, conn, stmt, (SQLCHAR *) ODBCG(laststate), &error, (SQLCHAR *) ODBCG(lasterrormsg), sizeof(ODBCG(lasterrormsg))-1, &errormsgsize); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { snprintf(ODBCG(laststate), sizeof(ODBCG(laststate)), "HY000"); snprintf(ODBCG(lasterrormsg), sizeof(ODBCG(lasterrormsg)), "Failed to fetch error message"); @@ -912,7 +912,7 @@ PHP_FUNCTION(odbc_prepare) } #endif - rc = SQLPrepare(result->stmt, query, SQL_NTS); + rc = SQLPrepare(result->stmt, (SQLCHAR *) query, SQL_NTS); switch (rc) { case SQL_SUCCESS: break; @@ -1197,7 +1197,7 @@ PHP_FUNCTION(odbc_cursor) if (max_len > 0) { cursorname = emalloc(max_len + 1); - rc = SQLGetCursorName(result->stmt,cursorname,(SQLSMALLINT)max_len,&len); + rc = SQLGetCursorName(result->stmt, (SQLCHAR *) cursorname, (SQLSMALLINT)max_len, &len); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { char state[6]; /* Not used */ SQLINTEGER error; /* Not used */ @@ -1205,11 +1205,11 @@ PHP_FUNCTION(odbc_cursor) SQLSMALLINT errormsgsize; /* Not used */ SQLError( result->conn_ptr->henv, result->conn_ptr->hdbc, - result->stmt, state, &error, errormsg, + result->stmt, (SQLCHAR *) state, &error, (SQLCHAR *) errormsg, sizeof(errormsg)-1, &errormsgsize); if (!strncmp(state,"S1015",5)) { snprintf(cursorname, max_len+1, "php_curs_" ZEND_ULONG_FMT, (zend_ulong)result->stmt); - if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { + if (SQLSetCursorName(result->stmt, (SQLCHAR *) cursorname, SQL_NTS) != SQL_SUCCESS) { odbc_sql_error(result->conn_ptr, result->stmt, "SQLSetCursorName"); RETVAL_FALSE; } else { @@ -1282,8 +1282,8 @@ PHP_FUNCTION(odbc_data_source) array_init(return_value); - add_assoc_string_ex(return_value, "server", sizeof("server")-1, server_name); - add_assoc_string_ex(return_value, "description", sizeof("description")-1, desc); + add_assoc_string_ex(return_value, "server", sizeof("server")-1, (char *) server_name); + add_assoc_string_ex(return_value, "description", sizeof("description")-1, (char *) desc); } /* }}} */ @@ -1343,7 +1343,7 @@ PHP_FUNCTION(odbc_exec) } #endif - rc = SQLExecDirect(result->stmt, query, SQL_NTS); + rc = SQLExecDirect(result->stmt, (SQLCHAR *) query, SQL_NTS); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && rc != SQL_NO_DATA_FOUND) { /* XXX FIXME we should really check out SQLSTATE with SQLError * in case rc is SQL_SUCCESS_WITH_INFO here. @@ -2131,7 +2131,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int * #ifdef HAVE_EMPRESS */ { int direct = 0; - char dsnbuf[1024]; + SQLCHAR dsnbuf[1024]; short dsnbuflen; char *ldb = 0; int ldb_len = 0; @@ -2148,9 +2148,9 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int } if (direct) { - rc = SQLDriverConnect((*conn)->hdbc, NULL, ldb, strlen(ldb), dsnbuf, sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT); + rc = SQLDriverConnect((*conn)->hdbc, NULL, (SQLCHAR *) ldb, strlen(ldb), dsnbuf, sizeof(dsnbuf) - 1, &dsnbuflen, SQL_DRIVER_NOPROMPT); } else { - rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); + rc = SQLConnect((*conn)->hdbc, (SQLCHAR *) db, SQL_NTS, (SQLCHAR *) uid, SQL_NTS, (SQLCHAR *) pwd, SQL_NTS); } if (ldb) { @@ -2158,7 +2158,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int } } #else - rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); + rc = SQLConnect((*conn)->hdbc, (SQLCHAR *) db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); #endif #endif if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { @@ -2787,10 +2787,10 @@ PHP_FUNCTION(odbc_tables) } rc = SQLTables(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table), - type, SAFE_SQL_NTS(type)); + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) table, SAFE_SQL_NTS(table), + (SQLCHAR *) type, SAFE_SQL_NTS(type)); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTables"); @@ -2857,10 +2857,10 @@ PHP_FUNCTION(odbc_columns) } rc = SQLColumns(result->stmt, - cat, (SQLSMALLINT) cat_len, - schema, (SQLSMALLINT) schema_len, - table, (SQLSMALLINT) table_len, - column, (SQLSMALLINT) column_len); + (SQLCHAR *) cat, (SQLSMALLINT) cat_len, + (SQLCHAR *) schema, (SQLSMALLINT) schema_len, + (SQLCHAR *) table, (SQLSMALLINT) table_len, + (SQLCHAR *) column, (SQLSMALLINT) column_len); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumns"); @@ -2921,10 +2921,10 @@ PHP_FUNCTION(odbc_columnprivileges) } rc = SQLColumnPrivileges(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table), - column, SAFE_SQL_NTS(column)); + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) table, SAFE_SQL_NTS(table), + (SQLCHAR *) column, SAFE_SQL_NTS(column)); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumnPrivileges"); @@ -2998,12 +2998,12 @@ PHP_FUNCTION(odbc_foreignkeys) } rc = SQLForeignKeys(result->stmt, - pcat, SAFE_SQL_NTS(pcat), - pschema, SAFE_SQL_NTS(pschema), - ptable, SAFE_SQL_NTS(ptable), - fcat, SAFE_SQL_NTS(fcat), - fschema, SAFE_SQL_NTS(fschema), - ftable, SAFE_SQL_NTS(ftable) ); + (SQLCHAR *) pcat, SAFE_SQL_NTS(pcat), + (SQLCHAR *) pschema, SAFE_SQL_NTS(pschema), + (SQLCHAR *) ptable, SAFE_SQL_NTS(ptable), + (SQLCHAR *) fcat, SAFE_SQL_NTS(fcat), + (SQLCHAR *) fschema, SAFE_SQL_NTS(fschema), + (SQLCHAR *) ftable, SAFE_SQL_NTS(ftable) ); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLForeignKeys"); @@ -3123,9 +3123,9 @@ PHP_FUNCTION(odbc_primarykeys) } rc = SQLPrimaryKeys(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table) ); + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) table, SAFE_SQL_NTS(table) ); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLPrimaryKeys"); @@ -3190,10 +3190,10 @@ PHP_FUNCTION(odbc_procedurecolumns) } rc = SQLProcedureColumns(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - proc, SAFE_SQL_NTS(proc), - col, SAFE_SQL_NTS(col) ); + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) proc, SAFE_SQL_NTS(proc), + (SQLCHAR *) col, SAFE_SQL_NTS(col) ); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedureColumns"); @@ -3258,9 +3258,9 @@ PHP_FUNCTION(odbc_procedures) } rc = SQLProcedures(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - proc, SAFE_SQL_NTS(proc) ); + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) proc, SAFE_SQL_NTS(proc) ); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedures"); @@ -3326,11 +3326,10 @@ PHP_FUNCTION(odbc_specialcolumns) RETURN_FALSE; } - rc = SQLSpecialColumns(result->stmt, - type, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - name, SAFE_SQL_NTS(name), + rc = SQLSpecialColumns(result->stmt, type, + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) name, SAFE_SQL_NTS(name), scope, nullable); @@ -3397,9 +3396,9 @@ PHP_FUNCTION(odbc_statistics) } rc = SQLStatistics(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - name, SAFE_SQL_NTS(name), + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) name, SAFE_SQL_NTS(name), unique, reserved); @@ -3461,9 +3460,9 @@ PHP_FUNCTION(odbc_tableprivileges) } rc = SQLTablePrivileges(result->stmt, - cat, SAFE_SQL_NTS(cat), - schema, SAFE_SQL_NTS(schema), - table, SAFE_SQL_NTS(table)); + (SQLCHAR *) cat, SAFE_SQL_NTS(cat), + (SQLCHAR *) schema, SAFE_SQL_NTS(schema), + (SQLCHAR *) table, SAFE_SQL_NTS(table)); if (rc == SQL_ERROR) { odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTablePrivileges"); diff --git a/ext/odbc/tests/bug60616.phpt b/ext/odbc/tests/bug60616.phpt index 9d98d46b08c59..d453efb010bbd 100644 --- a/ext/odbc/tests/bug60616.phpt +++ b/ext/odbc/tests/bug60616.phpt @@ -3,9 +3,9 @@ odbc_exec(): Getting accurate unicode data from query --SKIPIF-- --FILE-- --FILE-- --FILE-- cache_size; op_array->cache_size += sizeof(zval); } - } else if (opline->opcode != ZEND_RECV && opline->opcode != ZEND_EXT_NOP) { + } else if (opline->opcode != ZEND_RECV) { break; } opline++; diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c index c2f7550e91c68..91c9665d1daae 100644 --- a/ext/opcache/Optimizer/dce.c +++ b/ext/opcache/Optimizer/dce.c @@ -152,7 +152,6 @@ static inline zend_bool may_have_side_effects( case ZEND_EXT_STMT: case ZEND_EXT_FCALL_BEGIN: case ZEND_EXT_FCALL_END: - case ZEND_EXT_NOP: case ZEND_TICKS: case ZEND_YIELD: case ZEND_YIELD_FROM: diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c index 127fca5dca879..0560bcf2d5caa 100644 --- a/ext/opcache/Optimizer/zend_cfg.c +++ b/ext/opcache/Optimizer/zend_cfg.c @@ -426,7 +426,6 @@ int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t b case ZEND_FUNC_GET_ARGS: flags |= ZEND_FUNC_VARARG; break; - case ZEND_EXT_NOP: case ZEND_EXT_STMT: flags |= ZEND_FUNC_HAS_EXTENDED_STMT; break; diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index edbc068dda2ec..6b8cb33f5690b 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -942,11 +942,10 @@ uint32_t zend_get_func_info( int zend_func_info_startup(void) { - zend_extension dummy; size_t i; if (zend_func_info_rid == -1) { - zend_func_info_rid = zend_get_resource_handle(&dummy); + zend_func_info_rid = zend_get_resource_handle("Zend Optimizer"); if (zend_func_info_rid < 0) { return FAILURE; } diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index c71e7c040ba6a..b0efcc902602d 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -844,7 +844,9 @@ zend_function *zend_optimizer_get_called_func( case ZEND_INIT_METHOD_CALL: if (opline->op1_type == IS_UNUSED && opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_STRING - && op_array->scope && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) { + && op_array->scope + && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE) + && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) { zend_string *method_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1); zend_function *fbc = zend_hash_find_ptr( &op_array->scope->function_table, method_name); @@ -884,6 +886,8 @@ uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args) return ZEND_FUNC_INDIRECT_VAR_ACCESS; } else if (zend_string_equals_literal(name, "get_defined_vars")) { return ZEND_FUNC_INDIRECT_VAR_ACCESS; + } else if (zend_string_equals_literal(name, "db2_execute")) { + return ZEND_FUNC_INDIRECT_VAR_ACCESS; } else if (zend_string_equals_literal(name, "func_num_args")) { return ZEND_FUNC_VARARG; } else if (zend_string_equals_literal(name, "func_get_arg")) { diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 46363acb7b2e1..23ea50a4e3c49 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -44,7 +44,6 @@ #include "zend_accelerator_util_funcs.h" #include "zend_accelerator_hash.h" #include "zend_file_cache.h" -#include "zend_observer.h" #include "ext/pcre/php_pcre.h" #include "ext/standard/md5.h" #include "ext/hash/php_hash.h" @@ -107,7 +106,6 @@ ZEND_TSRMLS_CACHE_DEFINE() zend_accel_shared_globals *accel_shared_globals = NULL; /* true globals, no need for thread safety */ -char accel_system_id[32]; #ifdef ZEND_WIN32 char accel_uname_id[32]; #endif @@ -127,7 +125,6 @@ static zif_handler orig_chdir = NULL; static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL; static zend_result (*orig_post_startup_cb)(void); -static void accel_gen_system_id(void); static zend_result accel_post_startup(void); static int accel_finish_startup(void); @@ -2710,46 +2707,6 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals) memset(accel_globals, 0, sizeof(zend_accel_globals)); } -#define ZEND_BIN_ID "BIN_" ZEND_TOSTR(SIZEOF_INT) ZEND_TOSTR(SIZEOF_LONG) ZEND_TOSTR(SIZEOF_SIZE_T) ZEND_TOSTR(SIZEOF_ZEND_LONG) ZEND_TOSTR(ZEND_MM_ALIGNMENT) - -static void accel_gen_system_id(void) -{ - PHP_MD5_CTX context; - unsigned char digest[16]; - zend_module_entry *module; - zend_extension *extension; - zend_llist_position pos; - - PHP_MD5Init(&context); - PHP_MD5Update(&context, PHP_VERSION, sizeof(PHP_VERSION)-1); - PHP_MD5Update(&context, ZEND_EXTENSION_BUILD_ID, sizeof(ZEND_EXTENSION_BUILD_ID)-1); - PHP_MD5Update(&context, ZEND_BIN_ID, sizeof(ZEND_BIN_ID)-1); - if (strstr(PHP_VERSION, "-dev") != 0) { - /* Development versions may be changed from build to build */ - PHP_MD5Update(&context, __DATE__, sizeof(__DATE__)-1); - PHP_MD5Update(&context, __TIME__, sizeof(__TIME__)-1); - } - /* Modules may have changed after restart which can cause dangling pointers from - * custom opcode handlers in the second-level cache files - */ - ZEND_HASH_FOREACH_PTR(&module_registry, module) { - PHP_MD5Update(&context, module->name, strlen(module->name)); - if (module->version != NULL) { - PHP_MD5Update(&context, module->version, strlen(module->version)); - } - } ZEND_HASH_FOREACH_END(); - extension = (zend_extension *) zend_llist_get_first_ex(&zend_extensions, &pos); - while (extension) { - PHP_MD5Update(&context, extension->name, strlen(extension->name)); - if (extension->version != NULL) { - PHP_MD5Update(&context, extension->version, strlen(extension->version)); - } - extension = (zend_extension *) zend_llist_get_next_ex(&zend_extensions, &pos); - } - PHP_MD5Final(digest, &context); - php_hash_bin2hex(accel_system_id, digest, sizeof digest); -} - #ifdef HAVE_HUGE_CODE_PAGES # ifndef _WIN32 # include @@ -2934,8 +2891,6 @@ static int accel_startup(zend_extension *extension) # endif #endif - accel_gen_system_id(); - if (start_accel_module() == FAILURE) { accel_startup_ok = 0; zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!"); @@ -2998,15 +2953,6 @@ static zend_result accel_post_startup(void) } } -#ifdef HAVE_JIT - /* TODO Observer support for JIT */ - if (ZEND_OBSERVER_ENABLED) { - JIT_G(enabled) = 0; - JIT_G(on) = 0; - zend_accel_error(ACCEL_LOG_INFO, "Observer extension present. Disabling JIT."); - } -#endif - /* Initialize zend_func_info_rid */ zend_optimizer_startup(); diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 500647265cb96..b9e3f2a81de83 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -289,7 +289,6 @@ typedef struct _zend_accel_shared_globals { zend_string_table interned_strings; } zend_accel_shared_globals; -extern char accel_system_id[32]; #ifdef ZEND_WIN32 extern char accel_uname_id[32]; #endif diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 0ad3d3883eea7..348f15c4fccdf 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -24,6 +24,7 @@ #include "Zend/zend_constants.h" #include "Zend/zend_closures.h" #include "Zend/zend_ini.h" +#include "Zend/zend_observer.h" #include "zend_smart_str.h" #include "jit/zend_jit.h" @@ -120,8 +121,17 @@ static uint32_t zend_jit_trace_get_exit_point(const zend_op *to_opline, uint32_t static const void *zend_jit_trace_get_exit_addr(uint32_t n); static void zend_jit_trace_add_code(const void *start, uint32_t size); +static zend_bool dominates(const zend_basic_block *blocks, int a, int b) { + while (blocks[b].level > blocks[a].level) { + b = blocks[b].idom; + } + return a == b; +} + static zend_bool zend_ssa_is_last_use(const zend_op_array *op_array, const zend_ssa *ssa, int var, int use) { + int next_use; + if (ssa->vars[var].phi_use_chain) { zend_ssa_phi *phi = ssa->vars[var].phi_use_chain; do { @@ -132,8 +142,24 @@ static zend_bool zend_ssa_is_last_use(const zend_op_array *op_array, const zend_ } while (phi); } - use = zend_ssa_next_use(ssa->ops, var, use); - return use < 0 || zend_ssa_is_no_val_use(op_array->opcodes + use, ssa->ops + use, var); + next_use = zend_ssa_next_use(ssa->ops, var, use); + if (next_use < 0) { + int b = ssa->cfg.map[use]; + int prev_use = ssa->vars[var].use_chain; + + while (prev_use >= 0 && prev_use != use) { + if (b != ssa->cfg.map[prev_use] + && dominates(ssa->cfg.blocks, b, ssa->cfg.map[prev_use]) + && !zend_ssa_is_no_val_use(op_array->opcodes + prev_use, ssa->ops + prev_use, var)) { + return 0; + } + prev_use = zend_ssa_next_use(ssa->ops, var, prev_use); + } + return 1; + } else if (zend_ssa_is_no_val_use(op_array->opcodes + next_use, ssa->ops + next_use, var)) { + return 1; + } + return 0; } static zend_bool zend_ival_is_last_use(const zend_lifetime_interval *ival, int use) @@ -4045,7 +4071,7 @@ ZEND_EXT_API int zend_jit_startup(void *buf, size_t size, zend_bool reattached) return FAILURE; } - zend_jit_profile_counter_rid = zend_get_op_array_extension_handle(); + zend_jit_profile_counter_rid = zend_get_op_array_extension_handle(ACCELERATOR_PRODUCT_NAME); #ifdef HAVE_GDB zend_jit_gdb_init(); diff --git a/ext/opcache/jit/zend_jit_disasm_x86.c b/ext/opcache/jit/zend_jit_disasm_x86.c index 07884ad03a52c..a470179917e6d 100644 --- a/ext/opcache/jit/zend_jit_disasm_x86.c +++ b/ext/opcache/jit/zend_jit_disasm_x86.c @@ -399,9 +399,11 @@ static int zend_jit_disasm_init(void) REGISTER_HELPER(zend_jit_find_func_helper); REGISTER_HELPER(zend_jit_find_ns_func_helper); REGISTER_HELPER(zend_jit_find_method_helper); + REGISTER_HELPER(zend_jit_find_method_tmp_helper); REGISTER_HELPER(zend_jit_push_static_metod_call_frame); REGISTER_HELPER(zend_jit_push_static_metod_call_frame_tmp); REGISTER_HELPER(zend_jit_invalid_method_call); + REGISTER_HELPER(zend_jit_invalid_method_call_tmp); REGISTER_HELPER(zend_jit_unref_helper); REGISTER_HELPER(zend_jit_extend_stack_helper); REGISTER_HELPER(zend_jit_int_extend_stack_helper); diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 03e4041f0aab1..22904a8e1d3bc 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -107,9 +107,15 @@ static ZEND_COLD void ZEND_FASTCALL zend_jit_invalid_method_call(zval *object) } zend_throw_error(NULL, "Call to a member function %s() on %s", Z_STRVAL_P(function_name), zend_zval_type_name(object)); - if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { - zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); - } +} + +static ZEND_COLD void ZEND_FASTCALL zend_jit_invalid_method_call_tmp(zval *object) +{ + zend_execute_data *execute_data = EG(current_execute_data); + const zend_op *opline = EX(opline); + + zend_jit_invalid_method_call(object); + zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); } static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_undefined_method(const zend_class_entry *ce, const zend_string *method) @@ -136,17 +142,13 @@ static zend_function* ZEND_FASTCALL zend_jit_find_method_helper(zend_object *obj zend_execute_data *execute_data = EG(current_execute_data); const zend_op *opline = EX(opline); zend_class_entry *called_scope = obj->ce; - zend_object *orig_obj = obj; zend_function *fbc; - fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), function_name + 1); + fbc = obj->handlers->get_method(obj_ptr, Z_STR_P(function_name), function_name + 1); if (UNEXPECTED(fbc == NULL)) { if (EXPECTED(!EG(exception))) { zend_undefined_method(called_scope, Z_STR_P(function_name)); } - if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) { - zend_objects_store_del(orig_obj); - } return NULL; } @@ -154,14 +156,7 @@ static zend_function* ZEND_FASTCALL zend_jit_find_method_helper(zend_object *obj zend_init_func_run_time_cache(&fbc->op_array); } - if (UNEXPECTED(obj != orig_obj)) { - if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { - GC_ADDREF(obj); - if (GC_DELREF(orig_obj) == 0) { - zend_objects_store_del(orig_obj); - } - } - *obj_ptr = obj; + if (UNEXPECTED(obj != *obj_ptr)) { return fbc; } @@ -172,6 +167,24 @@ static zend_function* ZEND_FASTCALL zend_jit_find_method_helper(zend_object *obj return fbc; } +static zend_function* ZEND_FASTCALL zend_jit_find_method_tmp_helper(zend_object *obj, zval *function_name, zend_object **obj_ptr) +{ + zend_function *fbc; + + fbc = zend_jit_find_method_helper(obj, function_name, obj_ptr); + if (!fbc) { + if (GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + } + } else if (obj != *obj_ptr) { + GC_ADDREF(*obj_ptr); + if (GC_DELREF(obj) == 0) { + zend_objects_store_del(obj); + } + } + return fbc; +} + static zend_execute_data* ZEND_FASTCALL zend_jit_push_static_metod_call_frame(zend_object *obj, zend_function *fbc, uint32_t num_args) { zend_class_entry *scope = obj->ce; diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index e8cc51cd7f3a7..4edb08e08f9b0 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2827,7 +2827,10 @@ static zend_bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ss } opline = ssa_opcodes[use]; - if (opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) { + if (opline->opcode == ZEND_INIT_METHOD_CALL) { + return (opline->op2_type == IS_CONST && + Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_STRING); + } else if (opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) { if (!JIT_G(current_frame) || !JIT_G(current_frame)->call || !JIT_G(current_frame)->call->func @@ -2837,7 +2840,12 @@ static zend_bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ss } else if (opline->opcode != ZEND_FETCH_OBJ_R && opline->opcode != ZEND_FETCH_OBJ_IS && opline->opcode != ZEND_FETCH_OBJ_W - && opline->opcode != ZEND_ASSIGN_OBJ) { + && opline->opcode != ZEND_ASSIGN_OBJ + && opline->opcode != ZEND_ASSIGN_OBJ_OP + && opline->opcode != ZEND_PRE_INC_OBJ + && opline->opcode != ZEND_PRE_DEC_OBJ + && opline->opcode != ZEND_POST_INC_OBJ + && opline->opcode != ZEND_POST_DEC_OBJ) { return 0; } @@ -5001,9 +5009,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par op1_addr = 0; } else { op1_info = OP1_INFO(); - if (!(op1_info & MAY_BE_OBJECT)) { - goto generic_dynamic_call; - } op1_addr = OP1_REG_ADDR(); if (orig_op1_type != IS_UNKNOWN && (orig_op1_type & IS_TRACE_REFERENCE)) { @@ -5304,17 +5309,23 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par frame->call_opline = opline; /* Check if SEND_UNPACK/SEND_ARRAY may cause enter at different opline */ - if (opline > op_array->opcodes - && ((opline-1)->opcode == ZEND_SEND_ARRAY - || (opline-1)->opcode == ZEND_SEND_UNPACK - || (opline-1)->opcode == ZEND_CHECK_UNDEF_ARGS) - && p->op_array->num_args - && (p->op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0 - && ((p+1)->op == ZEND_JIT_TRACE_VM - || (p+1)->op == ZEND_JIT_TRACE_END) - && TRACE_FRAME_NUM_ARGS(call) < p->op_array->num_args - && !zend_jit_trace_opline_guard(&dasm_state, (p+1)->opline)) { - goto jit_failure; + if (opline > op_array->opcodes) { + const zend_op *prev_opline = opline - 1; + + while (prev_opline->opcode == ZEND_EXT_FCALL_BEGIN || prev_opline->opcode == ZEND_TICKS) { + prev_opline--; + } + if ((prev_opline->opcode == ZEND_SEND_ARRAY + || prev_opline->opcode == ZEND_SEND_UNPACK + || prev_opline->opcode == ZEND_CHECK_UNDEF_ARGS) + && p->op_array->num_args + && (p->op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0 + && ((p+1)->op == ZEND_JIT_TRACE_VM + || (p+1)->op == ZEND_JIT_TRACE_END) + && TRACE_FRAME_NUM_ARGS(call) < p->op_array->num_args + && !zend_jit_trace_opline_guard(&dasm_state, (p+1)->opline)) { + goto jit_failure; + } } } diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 927ed9081f14a..c689359272ede 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -8477,7 +8477,7 @@ typedef struct _zend_closure { zif_handler orig_internal_handler; } zend_closure; -static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, zend_function *func, zend_bool is_closure) +static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, zend_function *func, zend_bool is_closure, zend_bool use_this) { uint32_t used_stack; @@ -8599,7 +8599,7 @@ static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, zen | // Z_PTR(call->This) = obj; | mov r1, aword T1 | mov aword EX:RX->This.value.ptr, r1 - if (opline->op1_type == IS_UNUSED) { + if (opline->op1_type == IS_UNUSED || use_this) { | // call->call_info |= ZEND_CALL_HAS_THIS; if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) { | mov dword EX:RX->This.u1.type_info, ZEND_CALL_HAS_THIS @@ -9038,7 +9038,7 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t |3: } - if (!zend_jit_push_call_frame(Dst, opline, func, 0)) { + if (!zend_jit_push_call_frame(Dst, opline, func, 0, 0)) { return 0; } @@ -9116,7 +9116,11 @@ static int zend_jit_init_method_call(dasm_State **Dst, | LOAD_ZVAL_ADDR FCARG1a, op1_addr } | SET_EX_OPLINE opline, r0 - | EXT_CALL zend_jit_invalid_method_call, r0 + if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) { + | EXT_CALL zend_jit_invalid_method_call_tmp, r0 + } else { + | EXT_CALL zend_jit_invalid_method_call, r0 + } | jmp ->exception_handler |.code } @@ -9169,7 +9173,11 @@ static int zend_jit_init_method_call(dasm_State **Dst, | push r0 |.endif | SET_EX_OPLINE opline, r0 - | EXT_CALL zend_jit_find_method_helper, r0 + if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) { + | EXT_CALL zend_jit_find_method_tmp_helper, r0 + } else { + | EXT_CALL zend_jit_find_method_helper, r0 + } | test r0, r0 | jz ->exception_handler |.if not(X64) @@ -9247,7 +9255,7 @@ static int zend_jit_init_method_call(dasm_State **Dst, | sub r4, 12 | push opline->extended_value |.endif - if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { + if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) { | EXT_CALL zend_jit_push_static_metod_call_frame_tmp, r0 } else { | EXT_CALL zend_jit_push_static_metod_call_frame, r0 @@ -9255,7 +9263,7 @@ static int zend_jit_init_method_call(dasm_State **Dst, |.if not(X64) | add r4, 12 |.endif - if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { + if ((opline->op1_type & (IS_VAR|IS_TMP_VAR) && !use_this)) { | test r0, r0 | jz ->exception_handler } @@ -9268,7 +9276,7 @@ static int zend_jit_init_method_call(dasm_State **Dst, } if (!func || (func->common.fn_flags & ZEND_ACC_STATIC) == 0) { - if (!zend_jit_push_call_frame(Dst, opline, func, 0)) { + if (!zend_jit_push_call_frame(Dst, opline, func, 0, use_this)) { return 0; } } @@ -9366,7 +9374,7 @@ static int zend_jit_init_closure_call(dasm_State **Dst, } } - if (!zend_jit_push_call_frame(Dst, opline, func, 1)) { + if (!zend_jit_push_call_frame(Dst, opline, func, 1, 0)) { return 0; } @@ -9425,6 +9433,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend uint32_t call_num_args = 0; zend_bool unknown_num_args = 0; const void *exit_addr = NULL; + const zend_op *prev_opline; if (RETURN_VALUE_USED(opline)) { res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var); @@ -9433,8 +9442,12 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R4, TMP_ZVAL_OFFSET); } - if ((opline-1)->opcode == ZEND_SEND_UNPACK || (opline-1)->opcode == ZEND_SEND_ARRAY || - (opline-1)->opcode == ZEND_CHECK_UNDEF_ARGS) { + prev_opline = opline - 1; + while (prev_opline->opcode == ZEND_EXT_FCALL_BEGIN || prev_opline->opcode == ZEND_TICKS) { + prev_opline--; + } + if (prev_opline->opcode == ZEND_SEND_UNPACK || prev_opline->opcode == ZEND_SEND_ARRAY || + prev_opline->opcode == ZEND_CHECK_UNDEF_ARGS) { unknown_num_args = 1; } @@ -9676,6 +9689,10 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend if (!trace && op_array == &func->op_array) { /* recursive call */ + if (ZEND_OBSERVER_ENABLED) { + | mov FCARG1a, FP + | EXT_CALL zend_observer_fcall_begin, r0 + } #ifdef CONTEXT_THREADED_JIT | call >1 |.cold_code @@ -9780,6 +9797,11 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend |3: } + if (ZEND_OBSERVER_ENABLED) { + | mov FCARG1a, FP + | EXT_CALL zend_observer_fcall_begin, r0 + } + if (trace) { if (!func && (opline->opcode != ZEND_DO_UCALL)) { | jmp >9 @@ -11157,6 +11179,11 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o if (return_value_used == 0) { |9: + if (ZEND_OBSERVER_ENABLED) { + | xor FCARG2a, FCARG2a + | mov FCARG1a, FP + | EXT_CALL zend_observer_fcall_end, r0 + } return 1; } @@ -11219,6 +11246,11 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o } |9: + if (ZEND_OBSERVER_ENABLED) { + | LOAD_ZVAL_ADDR FCARG2a, ret_addr + | mov FCARG1a, FP + | EXT_CALL zend_observer_fcall_end, r0 + } return 1; } @@ -15177,6 +15209,9 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend if (!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-(MAY_BE_LONG|MAY_BE_DOUBLE))) && !(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-(MAY_BE_LONG|MAY_BE_DOUBLE)))) { regset = ZEND_REGSET_EMPTY; + if (!(opline->result_type & (IS_SMART_BRANCH_JMPZ|IS_SMART_BRANCH_JMPNZ))) { + ZEND_REGSET_INCL(regset, ZREG_R0); + } if ((op1_info & MAY_BE_LONG) && (op2_info & MAY_BE_LONG) && opline->op1_type != IS_CONST && opline->op2_type != IS_CONST) { if (ssa_op->op1_use != current_var && diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c index 6cda6471044af..06df5270d4b7b 100644 --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@ -24,6 +24,7 @@ #include "zend_shared_alloc.h" #include "zend_accelerator_util_funcs.h" #include "zend_execute.h" +#include "zend_system_id.h" #include "SAPI.h" #include "tsrm_win32.h" #include "win32/winutil.h" @@ -71,7 +72,7 @@ static void zend_win_error_message(int type, char *msg, int err) static char *create_name_with_username(char *name) { static char newname[MAXPATHLEN + 32 + 4 + 1 + 32 + 21]; - snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.20s@%.32s", name, accel_uname_id, sapi_module.name, accel_system_id); + snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.20s@%.32s", name, accel_uname_id, sapi_module.name, zend_system_id); return newname; } diff --git a/ext/opcache/tests/bug78185.phpt b/ext/opcache/tests/bug78185.phpt index 120f2b61090b8..56c0ae5586f3b 100644 --- a/ext/opcache/tests/bug78185.phpt +++ b/ext/opcache/tests/bug78185.phpt @@ -22,17 +22,17 @@ foreach (glob($pattern) as $p) { --CLEAN-- strlen(__DIR__)) { - rmdir($p); - $p = dirname($p); - } + unlink($p); + $p = dirname($p); + while(strlen($p) > strlen(__DIR__)) { + rmdir($p); + $p = dirname($p); + } } ?> --EXPECTF-- diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 581ef6a3921bb..62a2d261ff27b 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -22,6 +22,7 @@ #include "zend_vm.h" #include "zend_interfaces.h" #include "zend_attributes.h" +#include "zend_system_id.h" #include "php.h" #ifdef ZEND_WIN32 @@ -884,7 +885,7 @@ static void zend_file_cache_serialize(zend_persistent_script *script, zend_persistent_script *new_script; memcpy(info->magic, "OPCACHE", 8); - memcpy(info->system_id, accel_system_id, 32); + memcpy(info->system_id, zend_system_id, 32); info->mem_size = script->size; info->str_size = 0; info->script_offset = (char*)script - (char*)script->mem; @@ -914,7 +915,7 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path) filename = emalloc(len + 33 + ZSTR_LEN(script_path) + sizeof(SUFFIX)); memcpy(filename, ZCG(accel_directives).file_cache, len); filename[len] = '/'; - memcpy(filename + len + 1, accel_system_id, 32); + memcpy(filename + len + 1, zend_system_id, 32); memcpy(filename + len + 33, ZSTR_VAL(script_path), ZSTR_LEN(script_path)); memcpy(filename + len + 33 + ZSTR_LEN(script_path), SUFFIX, sizeof(SUFFIX)); #else @@ -928,7 +929,7 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path) len += 1 + 32; filename[len] = '\\'; - memcpy(filename + len + 1, accel_system_id, 32); + memcpy(filename + len + 1, zend_system_id, 32); if (ZSTR_LEN(script_path) >= 7 && ':' == ZSTR_VAL(script_path)[4] && '/' == ZSTR_VAL(script_path)[5] && '/' == ZSTR_VAL(script_path)[6]) { /* phar:// or file:// */ @@ -1688,7 +1689,7 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl efree(filename); return NULL; } - if (memcmp(info.system_id, accel_system_id, 32) != 0) { + if (memcmp(info.system_id, zend_system_id, 32) != 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot read from file '%s' (wrong \"system_id\")\n", filename); zend_file_cache_flock(fd, LOCK_UN); close(fd); diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt index 87b6d4b26465f..067cde083bf21 100644 --- a/ext/openssl/tests/openssl_decrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt @@ -3,9 +3,9 @@ openssl_decrypt() with CCM cipher algorithm tests --SKIPIF-- --FILE-- --FILE-- --FILE-- --EXPECT-- diff --git a/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt b/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt index 43d51753a01a2..e7ee13caf6da6 100644 --- a/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt @@ -40,7 +40,7 @@ try { --EXPECTF-- diff --git a/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt b/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt index 92d7f2789ebc7..f65822e535d39 100644 --- a/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt +++ b/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt @@ -23,7 +23,7 @@ var_dump(openssl_pkcs12_export_to_file($cert, '.', $priv, $pass)); --EXPECTF-- diff --git a/ext/pcntl/tests/001.phpt b/ext/pcntl/tests/001.phpt index cdfdb0733f9e9..16601cdb51c1f 100644 --- a/ext/pcntl/tests/001.phpt +++ b/ext/pcntl/tests/001.phpt @@ -2,8 +2,8 @@ Test pcntl wait functionality --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/pcre/tests/backtrack_limit.phpt b/ext/pcre/tests/backtrack_limit.phpt index 3f0d8e64468a0..3b6f7786a2c50 100644 --- a/ext/pcre/tests/backtrack_limit.phpt +++ b/ext/pcre/tests/backtrack_limit.phpt @@ -3,7 +3,7 @@ Backtracking limit --SKIPIF-- --INI-- diff --git a/ext/pcre/tests/bug27103.phpt b/ext/pcre/tests/bug27103.phpt index 0b706010a04f2..9ba70f7a64428 100644 --- a/ext/pcre/tests/bug27103.phpt +++ b/ext/pcre/tests/bug27103.phpt @@ -3,7 +3,7 @@ Bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets) --SKIPIF-- --FILE-- diff --git a/ext/pcre/tests/bug72463.phpt b/ext/pcre/tests/bug72463.phpt index b40a721998398..156b692ab0f84 100644 --- a/ext/pcre/tests/bug72463.phpt +++ b/ext/pcre/tests/bug72463.phpt @@ -3,7 +3,7 @@ Bug #72463 mail fails with invalid argument --SKIPIF-- --INI-- diff --git a/ext/pcre/tests/bug72463_2.phpt b/ext/pcre/tests/bug72463_2.phpt index 1baeb0f2a1154..3cc87b47ac5a4 100644 --- a/ext/pcre/tests/bug72463_2.phpt +++ b/ext/pcre/tests/bug72463_2.phpt @@ -3,7 +3,7 @@ Bug #72463 mail fails with invalid argument --SKIPIF-- --INI-- diff --git a/ext/pcre/tests/bug76850.phpt b/ext/pcre/tests/bug76850.phpt index 50c62ad1b335c..acceb2da7185b 100644 --- a/ext/pcre/tests/bug76850.phpt +++ b/ext/pcre/tests/bug76850.phpt @@ -2,10 +2,10 @@ Bug #76850 Exit code mangled by set locale/preg_match --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/pcre/tests/bug77193.phpt b/ext/pcre/tests/bug77193.phpt index 4fdb603b8591a..ddceb6141fefd 100644 --- a/ext/pcre/tests/bug77193.phpt +++ b/ext/pcre/tests/bug77193.phpt @@ -2,9 +2,9 @@ Bug #77193 Infinite loop in preg_replace_callback --SKIPIF-- --FILE-- +--EXPECT-- +string(11) "00000 00000" +string(11) "lower0UPPER" diff --git a/ext/pcre/tests/check_jit_enabled.phpt b/ext/pcre/tests/check_jit_enabled.phpt index de6e263e7018a..9cd249ea924f5 100644 --- a/ext/pcre/tests/check_jit_enabled.phpt +++ b/ext/pcre/tests/check_jit_enabled.phpt @@ -3,7 +3,7 @@ Check for JIT enablement status --SKIPIF-- --INI-- diff --git a/ext/pcre/tests/errors05.phpt b/ext/pcre/tests/errors05.phpt index 13fabc4f30f4c..dc60c24938e51 100644 --- a/ext/pcre/tests/errors05.phpt +++ b/ext/pcre/tests/errors05.phpt @@ -3,7 +3,7 @@ Test preg_match() function : error conditions - jit stacklimit exhausted --SKIPIF-- --INI-- diff --git a/ext/pcre/tests/invalid_utf8.phpt b/ext/pcre/tests/invalid_utf8.phpt index f24042a3bdf12..1a5124daaac3b 100644 --- a/ext/pcre/tests/invalid_utf8.phpt +++ b/ext/pcre/tests/invalid_utf8.phpt @@ -3,7 +3,7 @@ preg_replace() and invalid UTF8 --SKIPIF-- --FILE-- diff --git a/ext/pcre/tests/invalid_utf8_offset.phpt b/ext/pcre/tests/invalid_utf8_offset.phpt index 2b9e7fa239b16..311a6d73d6682 100644 --- a/ext/pcre/tests/invalid_utf8_offset.phpt +++ b/ext/pcre/tests/invalid_utf8_offset.phpt @@ -3,7 +3,7 @@ preg_replace() and invalid UTF8 offset --SKIPIF-- --FILE-- diff --git a/ext/pcre/tests/pcre_anchored.phpt b/ext/pcre/tests/pcre_anchored.phpt index c03d13501a7e4..7852cd6d62ff7 100644 --- a/ext/pcre/tests/pcre_anchored.phpt +++ b/ext/pcre/tests/pcre_anchored.phpt @@ -3,7 +3,7 @@ A (PCRE_ANCHORED) modifier --SKIPIF-- --FILE-- diff --git a/ext/pcre/tests/preg_match_error3.phpt b/ext/pcre/tests/preg_match_error3.phpt index 8b9d59fc58bd7..cf9c29a112cec 100644 --- a/ext/pcre/tests/preg_match_error3.phpt +++ b/ext/pcre/tests/preg_match_error3.phpt @@ -3,7 +3,7 @@ Test preg_match() function : error conditions - jit stacklimit exhausted --SKIPIF-- --INI-- diff --git a/ext/pcre/tests/preg_replace2.phpt b/ext/pcre/tests/preg_replace2.phpt index ac88e876e698c..e38c4788cb997 100644 --- a/ext/pcre/tests/preg_replace2.phpt +++ b/ext/pcre/tests/preg_replace2.phpt @@ -3,7 +3,7 @@ preg_replace() --SKIPIF-- --FILE-- diff --git a/ext/pcre/tests/recursion_limit.phpt b/ext/pcre/tests/recursion_limit.phpt index 294931388d6fc..5d08f1771bc27 100644 --- a/ext/pcre/tests/recursion_limit.phpt +++ b/ext/pcre/tests/recursion_limit.phpt @@ -3,7 +3,7 @@ PCRE Recursion limit --SKIPIF-- --INI-- diff --git a/ext/pdo/pdo_stmt.stub.php b/ext/pdo/pdo_stmt.stub.php index d0141ceb45eaf..b280f73ffdb3d 100644 --- a/ext/pdo/pdo_stmt.stub.php +++ b/ext/pdo/pdo_stmt.stub.php @@ -19,7 +19,7 @@ public function closeCursor() {} /** @return int|false */ public function columnCount() {} - /** @return false|null */ + /** @return bool|null */ public function debugDumpParams() {} /** @return string|false|null */ diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h index c05606c6faac7..116449ad3aefe 100644 --- a/ext/pdo/pdo_stmt_arginfo.h +++ b/ext/pdo/pdo_stmt_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 18f2af62bebcbbbf0e298f781860c251cfa07930 */ + * Stub hash: a35e66ccff5e569f07ae8372e661e005943dfbc7 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2) ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) diff --git a/ext/pdo/tests/bug_44159.phpt b/ext/pdo/tests/bug_44159.phpt index 5f23f910eb6ec..0e1116d58863e 100644 --- a/ext/pdo/tests/bug_44159.phpt +++ b/ext/pdo/tests/bug_44159.phpt @@ -4,9 +4,9 @@ PDO Common: Bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NUL --FILE-- diff --git a/ext/pdo/tests/bug_44861.phpt b/ext/pdo/tests/bug_44861.phpt index 6ca5b175636b6..73c2675c1a333 100644 --- a/ext/pdo/tests/bug_44861.phpt +++ b/ext/pdo/tests/bug_44861.phpt @@ -8,12 +8,12 @@ if (false == $dir) die('skip no driver'); $allowed = array('oci', 'pgsql'); $ok = false; foreach ($allowed as $driver) { - if (!strncasecmp(getenv('PDOTEST_DSN'), $driver, strlen($driver))) { - $ok = true; - } + if (!strncasecmp(getenv('PDOTEST_DSN'), $driver, strlen($driver))) { + $ok = true; + } } if (!$ok) { - die("skip Scrollable cursors not supported"); + die("skip Scrollable cursors not supported"); } require_once $dir . 'pdo_test.inc'; PDOTest::skip(); diff --git a/ext/pdo/tests/bug_47769.phpt b/ext/pdo/tests/bug_47769.phpt index 2c308d9113213..daac15574a85d 100644 --- a/ext/pdo/tests/bug_47769.phpt +++ b/ext/pdo/tests/bug_47769.phpt @@ -3,7 +3,7 @@ PDO Common: Bug #47769 (Strange extends PDO) --SKIPIF-- --FILE-- getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { - require_once(__DIR__ . DIRECTORY_SEPARATOR . '../../pdo_mysql/tests/mysql_pdo_test.inc'); - if (false === MySQLPDOTest::detect_transactional_mysql_engine($db)) { - die('skip your mysql configuration does not support working transactions'); - } + require_once(__DIR__ . DIRECTORY_SEPARATOR . '../../pdo_mysql/tests/mysql_pdo_test.inc'); + if (false === MySQLPDOTest::detect_transactional_mysql_engine($db)) { + die('skip your mysql configuration does not support working transactions'); + } } ?> --FILE-- diff --git a/ext/pdo/tests/pdo_dsn_containing_credentials.phpt b/ext/pdo/tests/pdo_dsn_containing_credentials.phpt index 7c67bc32273a4..e3d530ba49ee5 100644 --- a/ext/pdo/tests/pdo_dsn_containing_credentials.phpt +++ b/ext/pdo/tests/pdo_dsn_containing_credentials.phpt @@ -8,7 +8,7 @@ if (false == $dir) die('skip no driver'); $driver = substr(getenv('PDOTEST_DSN'), 0, strpos(getenv('PDOTEST_DSN'), ':')); if (!in_array($driver, array('mssql','sybase','dblib','firebird','mysql','oci'))) - die('skip not supported'); + die('skip not supported'); require_once $dir . 'pdo_test.inc'; PDOTest::skip(); diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 index 622c1e55b8ea0..d8b94877235f4 100644 --- a/ext/pdo_mysql/config.m4 +++ b/ext/pdo_mysql/config.m4 @@ -58,13 +58,8 @@ if test "$PHP_PDO_MYSQL" != "no"; then if test "x$SED" = "x"; then AC_PATH_PROG(SED, sed) fi - if test "$enable_zts" = "yes"; then - PDO_MYSQL_LIBNAME=mysqlclient_r - PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"` - else - PDO_MYSQL_LIBNAME=mysqlclient - PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"` - fi + PDO_MYSQL_LIBNAME=mysqlclient + PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"` PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"` elif test -n "$PDO_MYSQL_DIR"; then AC_MSG_RESULT([not found]) diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 9596bdd04f45c..95f719a6150f3 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -291,6 +291,11 @@ static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, size_t * } /* }}} */ +#if defined(PDO_USE_MYSQLND) || MYSQL_VERSION_ID < 50707 || defined(MARIADB_BASE_VERSION) +# define mysql_real_escape_string_quote(mysql, to, from, length, quote) \ + mysql_real_escape_string(mysql, to, from, length) +#endif + /* {{{ mysql_handle_quoter */ static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, size_t unquotedlen, char **quoted, size_t *quotedlen, enum pdo_param_type paramtype ) { @@ -313,13 +318,13 @@ static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, size_t unqu *quoted = safe_emalloc(2, unquotedlen, 3 + (use_national_character_set ? 1 : 0)); if (use_national_character_set) { - *quotedlen = mysql_real_escape_string(H->server, *quoted + 2, unquoted, unquotedlen); + *quotedlen = mysql_real_escape_string_quote(H->server, *quoted + 2, unquoted, unquotedlen, '\''); (*quoted)[0] = 'N'; (*quoted)[1] = '\''; ++*quotedlen; /* N prefix */ } else { - *quotedlen = mysql_real_escape_string(H->server, *quoted + 1, unquoted, unquotedlen); + *quotedlen = mysql_real_escape_string_quote(H->server, *quoted + 1, unquoted, unquotedlen, '\''); (*quoted)[0] = '\''; } @@ -353,7 +358,7 @@ static int mysql_handle_rollback(pdo_dbh_t *dbh) { PDO_DBG_ENTER("mysql_handle_rollback"); PDO_DBG_INF_FMT("dbh=%p", dbh); - PDO_DBG_RETURN(0 <= mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server)); + PDO_DBG_RETURN(0 == mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server)); } /* }}} */ @@ -363,7 +368,7 @@ static inline int mysql_handle_autocommit(pdo_dbh_t *dbh) PDO_DBG_ENTER("mysql_handle_autocommit"); PDO_DBG_INF_FMT("dbh=%p", dbh); PDO_DBG_INF_FMT("dbh->autocommit=%d", dbh->auto_commit); - PDO_DBG_RETURN(0 <= mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit)); + PDO_DBG_RETURN(0 == mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit)); } /* }}} */ @@ -515,11 +520,11 @@ static int pdo_mysql_check_liveness(pdo_dbh_t *dbh) /* {{{ pdo_mysql_request_shutdown */ static void pdo_mysql_request_shutdown(pdo_dbh_t *dbh) { - pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - PDO_DBG_ENTER("pdo_mysql_request_shutdown"); PDO_DBG_INF_FMT("dbh=%p", dbh); + #ifdef PDO_USE_MYSQLND + pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; if (H->server) { mysqlnd_end_psession(H->server); } @@ -634,7 +639,6 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* handle MySQL options */ if (driver_options) { zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30); - unsigned int local_infile = (unsigned int) pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0); zend_string *init_cmd = NULL; #ifndef PDO_USE_MYSQLND zend_string *default_file = NULL, *default_group = NULL; @@ -668,12 +672,13 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) goto cleanup; } -#ifndef PDO_USE_MYSQLND +#if defined(MYSQL_OPT_LOCAL_INFILE) || defined(PDO_USE_MYSQLND) + unsigned int local_infile = (unsigned int) pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0); +# ifndef PDO_USE_MYSQLND if (PG(open_basedir) && PG(open_basedir)[0] != '\0') { local_infile = 0; } -#endif -#if defined(MYSQL_OPT_LOCAL_INFILE) || defined(PDO_USE_MYSQLND) +# endif if (mysql_options(H->server, MYSQL_OPT_LOCAL_INFILE, (const char *)&local_infile)) { pdo_mysql_error(dbh); goto cleanup; diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index 4abb25bddce89..cfe1d68e495de 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -25,6 +25,9 @@ # define PDO_MYSQL_PARAM_BIND MYSQLND_PARAM_BIND #else # include +#if MYSQL_VERSION_ID >= 80000 && MYSQL_VERSION_ID < 100000 +typedef _Bool my_bool; +#endif # define PDO_MYSQL_PARAM_BIND MYSQL_BIND #endif @@ -120,7 +123,7 @@ typedef struct { #ifdef PDO_USE_MYSQLND const size_t *current_lengths; #else - zend_long *current_lengths; + unsigned long *current_lengths; #endif pdo_mysql_error_info einfo; #ifdef PDO_USE_MYSQLND diff --git a/ext/pdo_mysql/tests/bug70389.phpt b/ext/pdo_mysql/tests/bug70389.phpt index f2be259543b22..7815b21255740 100644 --- a/ext/pdo_mysql/tests/bug70389.phpt +++ b/ext/pdo_mysql/tests/bug70389.phpt @@ -22,9 +22,9 @@ new PDO(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, $flags); var_dump($flags); ?> ---EXPECT-- +--EXPECTF-- array(3) { - [1005]=> + [%d]=> bool(true) [1001]=> bool(true) diff --git a/ext/pdo_mysql/tests/bug_39858.phpt b/ext/pdo_mysql/tests/bug_39858.phpt index 9328c0f20d22e..e33415eb675a9 100644 --- a/ext/pdo_mysql/tests/bug_39858.phpt +++ b/ext/pdo_mysql/tests/bug_39858.phpt @@ -11,12 +11,12 @@ $db = MySQLPDOTest::factory(); $row = $db->query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 50000) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --XFAIL-- nextRowset() problem with stored proc & emulation mode & mysqlnd diff --git a/ext/pdo_mysql/tests/bug_41125.phpt b/ext/pdo_mysql/tests/bug_41125.phpt index c86cad2b51063..e7db01c8e3218 100644 --- a/ext/pdo_mysql/tests/bug_41125.phpt +++ b/ext/pdo_mysql/tests/bug_41125.phpt @@ -10,13 +10,13 @@ $db = MySQLPDOTest::factory(); $row = $db->query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; die("skip $version"); if ($version < 40100) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --FILE-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 50000) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --FILE-- query('SELECT VERSION() as _version'); $row = $stmt->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 41000) - die(sprintf("skip Need MySQL Server 4.1.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 4.1.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); --FILE-- query('SELECT VERSION() as _version'); $row = $stmt->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 41000) - die(sprintf("skip Will work different with MySQL Server < 4.1.0, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Will work different with MySQL Server < 4.1.0, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --FILE-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 40106) - die(sprintf("skip Need MySQL Server 4.1.6+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 4.1.6+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --FILE-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 50000) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --FILE-- --INI-- pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock" diff --git a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt index 99754c9058307..1838336050a36 100644 --- a/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt @@ -6,7 +6,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc'); require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); MySQLPDOTest::skip(); if (MySQLPDOTest::isPDOMySQLnd()) - die("skip libmysql only options") + die("skip libmysql only options") ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- @@ -27,7 +27,6 @@ if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) { "MYSQL_ATTR_SSL_CIPHER" => true, "MYSQL_ATTR_COMPRESS" => true, "MYSQL_ATTR_MULTI_STATEMENTS" => true, - "MYSQL_ATTR_SSL_VERIFY_SERVER_CERT" => true, ); if (!MySQLPDOTest::isPDOMySQLnd()) { @@ -37,6 +36,7 @@ if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) { } if (extension_loaded('mysqlnd')) { + $expected['MYSQL_ATTR_SSL_VERIFY_SERVER_CERT'] = true; $expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true; } else if (extension_loaded('mysqli')) { if (mysqli_get_client_version() > 50605) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt index 9dec5700b6dd3..506be6475f35c 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_commit.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_commit.phpt @@ -7,7 +7,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); MySQLPDOTest::skip(); $db = MySQLPDOTest::factory(); if (false == MySQLPDOTest::detect_transactional_mysql_engine($db)) - die("skip Transactional engine not found"); + die("skip Transactional engine not found"); ?> --FILE-- query('SELECT USER() as _user'); $row = $stmt->fetch(PDO::FETCH_ASSOC); $tmp = explode('@', $row['_user']); if (count($tmp) < 2) - die("skip Cannot detect if test is run against local or remote database server"); + die("skip Cannot detect if test is run against local or remote database server"); if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) - die("skip Test cannot be run against remote database server"); + die("skip Test cannot be run against remote database server"); $stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'"); if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { - if (!is_writable($row['value'])) - die("skip secure_file_priv directory not writable: {$row['value']}"); + if (!is_writable($row['value'])) + die("skip secure_file_priv directory not writable: {$row['value']}"); - $filename = $row['value'] . DIRECTORY_SEPARATOR . "pdo_mysql_exec_load_data.csv"; + $filename = $row['value'] . DIRECTORY_SEPARATOR . "pdo_mysql_exec_load_data.csv"; - if (file_exists($filename) && !is_writable($filename)) - die("skip {$filename} not writable"); + if (file_exists($filename) && !is_writable($filename)) + die("skip {$filename} not writable"); } ?> diff --git a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt index 386dfb1e1eb44..80c6a23db8239 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_get_attribute.phpt @@ -7,7 +7,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); MySQLPDOTest::skip(); $db = MySQLPDOTest::factory(); if (false == MySQLPDOTest::detect_transactional_mysql_engine($db)) - die("skip Transactional engine not found"); + die("skip Transactional engine not found"); ?> --FILE-- --FILE-- --FILE-- --FILE-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 50000) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); if (!MySQLPDOTest::isPDOMySQLnd()) - die("skip This will not work with libmysql"); + die("skip This will not work with libmysql"); ?> --FILE-- query('SELECT USER() as _user'); $row = $stmt->fetch(PDO::FETCH_ASSOC); $tmp = explode('@', $row['_user']); if (count($tmp) < 2) - die("skip Cannot detect if test is run against local or remote database server"); + die("skip Cannot detect if test is run against local or remote database server"); if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) - die("skip Test cannot be run against remote database server"); + die("skip Test cannot be run against remote database server"); $stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'"); if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt index 96e77a1326af6..d27aefc6be46a 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_rollback.phpt @@ -7,7 +7,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); MySQLPDOTest::skip(); $db = MySQLPDOTest::factory(); if (false == MySQLPDOTest::detect_transactional_mysql_engine($db)) - die("skip Transactional engine not found"); + die("skip Transactional engine not found"); ?> --FILE-- diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt index 31ee2a3e07341..8e9e60b99e3a6 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt @@ -8,14 +8,14 @@ MySQLPDOTest::skip(); $db = MySQLPDOTest::factory(); try { - $query = "SELECT '', NULL, \"\" FROM DUAL"; - $stmt = $db->prepare($query); - $ok = @$stmt->execute(); + $query = "SELECT '', NULL, \"\" FROM DUAL"; + $stmt = $db->prepare($query); + $ok = @$stmt->execute(); } catch (PDOException $e) { - die("skip: Test cannot be run with SQL mode ANSI"); + die("skip: Test cannot be run with SQL mode ANSI"); } if (!$ok) - die("skip: Test cannot be run with SQL mode ANSI"); + die("skip: Test cannot be run with SQL mode ANSI"); ?> --FILE-- query('SELECT VERSION() as _version'); $row = $stmt->fetch(PDO::FETCH_ASSOC); $version = ((int)substr($row['_version'], 0, 1) * 10) + (int)substr($row['_version'], 2, 1); if ($version < 51) - die("skip Test needs MySQL 5.1+"); + die("skip Test needs MySQL 5.1+"); ?> --FILE-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 50000) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); if (!MySQLPDOTest::isPDOMySQLnd()) - die("skip This will not work with libmysql"); + die("skip This will not work with libmysql"); ?> --FILE-- --FILE-- query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC); $matches = array(); if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches)) - die(sprintf("skip Cannot determine MySQL Server version\n")); + die(sprintf("skip Cannot determine MySQL Server version\n")); $version = $matches[1] * 10000 + $matches[2] * 100 + $matches[3]; if ($version < 50000) - die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", - $matches[1], $matches[2], $matches[3], $version)); + die(sprintf("skip Need MySQL Server 5.0.0+, found %d.%02d.%02d (%d)\n", + $matches[1], $matches[2], $matches[3], $version)); ?> --FILE-- exec("DROP USER IF EXISTS $user"); - $db->exec("CREATE USER $user WITH PASSWORD '$pass'"); + $db->exec("DROP USER IF EXISTS $user"); + $db->exec("CREATE USER $user WITH PASSWORD '$pass'"); } catch (PDOException $e) { - die("skip You need CREATEUSER permissions to run the test"); + die("skip You need CREATEUSER permissions to run the test"); } // Peer authentication might prevent the test from properly running try { - $testConn = new PDO($dsn, $user, $pass); + $testConn = new PDO($dsn, $user, $pass); } catch (PDOException $e) { - echo "skip ".$e->getMessage(); + echo "skip ".$e->getMessage(); } $db->exec("DROP USER $user"); diff --git a/ext/pdo_pgsql/tests/bug68199.phpt b/ext/pdo_pgsql/tests/bug68199.phpt index 0c79faeeb963a..25a200365a1a4 100644 --- a/ext/pdo_pgsql/tests/bug68199.phpt +++ b/ext/pdo_pgsql/tests/bug68199.phpt @@ -9,7 +9,7 @@ PDOTest::skip(); $db = PDOTest::factory(); if (version_compare($db->getAttribute(PDO::ATTR_SERVER_VERSION), '9.0.0') < 0) { - die("skip Requires 9.0+"); + die("skip Requires 9.0+"); } ?> diff --git a/ext/pdo_pgsql/tests/bug69362.phpt b/ext/pdo_pgsql/tests/bug69362.phpt index 1fd4e80e7d669..c1ed7e615f485 100644 --- a/ext/pdo_pgsql/tests/bug69362.phpt +++ b/ext/pdo_pgsql/tests/bug69362.phpt @@ -19,17 +19,17 @@ $pass = 'testpass'; // Assume that if we can't create or drop a user, this test needs to be skipped try { - $db->exec("DROP USER IF EXISTS $user"); - $db->exec("CREATE USER $user WITH PASSWORD '$pass'"); + $db->exec("DROP USER IF EXISTS $user"); + $db->exec("CREATE USER $user WITH PASSWORD '$pass'"); } catch (PDOException $e) { - die("skip You need CREATEUSER permissions to run the test"); + die("skip You need CREATEUSER permissions to run the test"); } // Peer authentication might prevent the test from properly running try { - $testConn = new PDO($dsn, $user, $pass); + $testConn = new PDO($dsn, $user, $pass); } catch (PDOException $e) { - echo "skip ".$e->getMessage(); + echo "skip ".$e->getMessage(); } $db->exec("DROP USER $user"); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt index 0023f9103158c..aca253f7b717a 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt @@ -20,7 +20,7 @@ var_dump($db->exec('CREATE TABLE test2 (id INT);')); --EXPECTF-- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 314f28404a615..31bb83431474d 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -729,7 +729,7 @@ PHP_FUNCTION(pg_close) zval *pgsql_link = NULL; zend_resource *link; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pgsql_link) == FAILURE) { RETURN_THROWS(); } @@ -769,16 +769,15 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type { zend_resource *link; zval *pgsql_link = NULL; - int argc = ZEND_NUM_ARGS(); PGconn *pgsql; char *msgbuf; char *result; - if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pgsql_link) == FAILURE) { RETURN_THROWS(); } - if (argc == 0) { + if (!pgsql_link) { link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); } else { @@ -937,7 +936,7 @@ PHP_FUNCTION(pg_ping) PGresult *res; zend_resource *link; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pgsql_link) == FAILURE) { RETURN_THROWS(); } @@ -983,13 +982,13 @@ PHP_FUNCTION(pg_query) ExecStatusType status; if (argc == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) { + if (zend_parse_parameters(argc, "s", &query, &query_len) == FAILURE) { RETURN_THROWS(); } link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); } else { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &query, &query_len) == FAILURE) { + if (zend_parse_parameters(argc, "rs", &pgsql_link, &query, &query_len) == FAILURE) { RETURN_THROWS(); } link = Z_RES_P(pgsql_link); @@ -2227,17 +2226,16 @@ PHP_FUNCTION(pg_trace) char *z_filename, *mode = "w"; size_t z_filename_len, mode_len; zval *pgsql_link = NULL; - int argc = ZEND_NUM_ARGS(); PGconn *pgsql; FILE *fp = NULL; php_stream *stream; zend_resource *link; - if (zend_parse_parameters(argc, "p|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sr!", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) { RETURN_THROWS(); } - if (argc < 3) { + if (!pgsql_link) { link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); } else { @@ -2271,7 +2269,7 @@ PHP_FUNCTION(pg_untrace) PGconn *pgsql; zend_resource *link; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pgsql_link) == FAILURE) { RETURN_THROWS(); } @@ -2622,16 +2620,16 @@ PHP_FUNCTION(pg_lo_write) zval *pgsql_id; char *str; zend_long z_len; + zend_bool z_len_is_null = 1; size_t str_len, nbytes; size_t len; pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l!", &pgsql_id, &str, &str_len, &z_len, &z_len_is_null) == FAILURE) { RETURN_THROWS(); } - if (argc > 2) { + if (!z_len_is_null) { if (z_len < 0) { zend_argument_value_error(3, "must be greater than or equal to 0"); RETURN_THROWS(); @@ -2840,9 +2838,8 @@ PHP_FUNCTION(pg_lo_seek) zval *pgsql_id = NULL; zend_long result, offset = 0, whence = SEEK_CUR; pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &pgsql_id, &offset, &whence) == FAILURE) { RETURN_THROWS(); } if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) { @@ -2877,9 +2874,8 @@ PHP_FUNCTION(pg_lo_tell) zval *pgsql_id = NULL; zend_long offset = 0; pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "r", &pgsql_id) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_id) == FAILURE) { RETURN_THROWS(); } @@ -2906,10 +2902,9 @@ PHP_FUNCTION(pg_lo_truncate) zval *pgsql_id = NULL; size_t size; pgLofp *pgsql; - int argc = ZEND_NUM_ARGS(); int result; - if (zend_parse_parameters(argc, "rl", &pgsql_id, &size) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pgsql_id, &size) == FAILURE) { RETURN_THROWS(); } @@ -3006,7 +3001,7 @@ PHP_FUNCTION(pg_client_encoding) PGconn *pgsql; zend_resource *link; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pgsql_link) == FAILURE) { RETURN_THROWS(); } @@ -3035,7 +3030,7 @@ PHP_FUNCTION(pg_end_copy) int result = 0; zend_resource *link; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pgsql_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pgsql_link) == FAILURE) { RETURN_THROWS(); } @@ -3107,9 +3102,8 @@ PHP_FUNCTION(pg_copy_to) PGresult *pgsql_result; ExecStatusType status; char *csv = (char *)NULL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rs|ss", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|ss", &pgsql_link, &table_name, &table_name_len, &pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) { RETURN_THROWS(); @@ -3198,9 +3192,8 @@ PHP_FUNCTION(pg_copy_from) PGconn *pgsql; PGresult *pgsql_result; ExecStatusType status; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rsa|ss", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa|ss", &pgsql_link, &table_name, &table_name_len, &pg_rows, &pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) { RETURN_THROWS(); @@ -3372,7 +3365,7 @@ PHP_FUNCTION(pg_unescape_bytea) char *from = NULL, *to = NULL, *tmp = NULL; size_t to_len; size_t from_len; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &from, &from_len) == FAILURE) { RETURN_THROWS(); } @@ -5461,9 +5454,8 @@ PHP_FUNCTION(pg_insert) PGresult *pg_result; ExecStatusType status; zend_string *sql = NULL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rsa|l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa|l", &pgsql_link, &table, &table_len, &values, &option) == FAILURE) { RETURN_THROWS(); } @@ -5678,9 +5670,8 @@ PHP_FUNCTION(pg_update) zend_ulong option = PGSQL_DML_EXEC; PGconn *pg_link; zend_string *sql = NULL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rsaa|l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsaa|l", &pgsql_link, &table, &table_len, &values, &ids, &option) == FAILURE) { RETURN_THROWS(); } @@ -5775,9 +5766,8 @@ PHP_FUNCTION(pg_delete) zend_ulong option = PGSQL_DML_EXEC; PGconn *pg_link; zend_string *sql; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rsa|l", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa|l", &pgsql_link, &table, &table_len, &ids, &option) == FAILURE) { RETURN_THROWS(); } diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index 3d8ce3a701468..0995e0463ff9e 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -11,41 +11,41 @@ function pg_pconnect(string $connection_string, int $connection_type = 0) {} /** @param resource $connection */ function pg_connect_poll($connection): int {} -/** @param resource $connection */ -function pg_close($connection = UNKNOWN): bool {} +/** @param resource|null $connection */ +function pg_close($connection = null): bool {} -/** @param resource $connection */ -function pg_dbname($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_dbname($connection = null): string {} -/** @param resource $connection */ -function pg_last_error($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_last_error($connection = null): string {} /** - * @param resource $connection + * @param resource|null $connection * @alias pg_last_error */ -function pg_errormessage($connection = UNKNOWN): string {} +function pg_errormessage($connection = null): string {} -/** @param resource $connection */ -function pg_options($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_options($connection = null): string {} -/** @param resource $connection */ -function pg_port($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_port($connection = null): string {} -/** @param resource $connection */ -function pg_tty($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_tty($connection = null): string {} -/** @param resource $connection */ -function pg_host($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_host($connection = null): string {} -/** @param resource $connection */ -function pg_version($connection = UNKNOWN): array {} +/** @param resource|null $connection */ +function pg_version($connection = null): array {} /** @param resource|string $connection */ function pg_parameter_status($connection, string $param_name = UNKNOWN): string|false {} -/** @param resource $connection */ -function pg_ping($connection = UNKNOWN): bool {} +/** @param resource|null $connection */ +function pg_ping($connection = null): bool {} /** * @param resource|string $connection @@ -236,11 +236,11 @@ function pg_last_oid($result): string|int|false {} */ function pg_getlastoid($result): string|int|false {} -/** @param resource $connection */ -function pg_trace(string $filename, string $mode = "w", $connection = UNKNOWN): bool {} +/** @param resource|null $connection */ +function pg_trace(string $filename, string $mode = "w", $connection = null): bool {} -/** @param resource $connection */ -function pg_untrace($connection = UNKNOWN): bool {} +/** @param resource|null $connection */ +function pg_untrace($connection = null): bool {} /** * @param resource $connection @@ -302,13 +302,13 @@ function pg_lo_read($large_object, int $len = 8192): string|false {} function pg_loread($large_object, int $len = 8192): string|false {} /** @param resource $large_object */ -function pg_lo_write($large_object, string $buf, int $len = UNKNOWN): int|false {} +function pg_lo_write($large_object, string $buf, ?int $len = null): int|false {} /** * @param resource $large_object * @alias pg_lo_write */ -function pg_lowrite($large_object, string $buf, int $len = UNKNOWN): int|false {} +function pg_lowrite($large_object, string $buf, ?int $len = null): int|false {} /** @param resource $large_object */ function pg_lo_read_all($large_object): int {} @@ -374,17 +374,17 @@ function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {} */ function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {} -/** @param resource $connection */ -function pg_client_encoding($connection = UNKNOWN): string {} +/** @param resource|null $connection */ +function pg_client_encoding($connection = null): string {} /** - * @param resource $connection + * @param resource|null $connection * @alias pg_client_encoding */ -function pg_clientencoding($connection = UNKNOWN): string {} +function pg_clientencoding($connection = null): string {} -/** @param resource $connection */ -function pg_end_copy($connection = UNKNOWN): bool {} +/** @param resource|null $connection */ +function pg_end_copy($connection = null): bool {} /** @param resource|string $connection */ function pg_put_line($connection, string $query = UNKNOWN): bool {} @@ -401,7 +401,7 @@ function pg_escape_string($connection, string $data = UNKNOWN): string {} /** @param resource|string $connection */ function pg_escape_bytea($connection, string $data = UNKNOWN): string {} -function pg_unescape_bytea(string $data = UNKNOWN): string|false {} +function pg_unescape_bytea(?string $data = null): string|false {} /** @param resource|string $connection */ function pg_escape_literal($connection, string $data = UNKNOWN): string|false {} diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 0c9234acdc5c5..544e0ad4a6a2e 100644 --- a/ext/pgsql/pgsql_arginfo.h +++ b/ext/pgsql/pgsql_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 90dd576049fe13617343fe689000b94b20f47655 */ + * Stub hash: 907a616e7138369e6e3ccbbb10e6c0f2a380fe93 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connect, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) @@ -13,11 +13,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_connect_poll, 0, 1, IS_LONG, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_close, 0, 0, _IS_BOOL, 0) - ZEND_ARG_INFO(0, connection) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_dbname, 0, 0, IS_STRING, 0) - ZEND_ARG_INFO(0, connection) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection, "null") ZEND_END_ARG_INFO() #define arginfo_pg_last_error arginfo_pg_dbname @@ -33,7 +33,7 @@ ZEND_END_ARG_INFO() #define arginfo_pg_host arginfo_pg_dbname ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_version, 0, 0, IS_ARRAY, 0) - ZEND_ARG_INFO(0, connection) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_parameter_status, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) @@ -197,7 +197,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_trace, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"w\"") - ZEND_ARG_INFO(0, connection) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection, "null") ZEND_END_ARG_INFO() #define arginfo_pg_untrace arginfo_pg_close @@ -240,7 +240,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_lo_write, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_INFO(0, large_object) ZEND_ARG_TYPE_INFO(0, buf, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, len, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #define arginfo_pg_lowrite arginfo_pg_lo_write @@ -326,7 +326,7 @@ ZEND_END_ARG_INFO() #define arginfo_pg_escape_bytea arginfo_pg_escape_string ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_unescape_bytea, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_escape_literal, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) diff --git a/ext/phar/tests/024-opcache-win32.phpt b/ext/phar/tests/024-opcache-win32.phpt index b9d80929cc8b0..7887a24072325 100644 --- a/ext/phar/tests/024-opcache-win32.phpt +++ b/ext/phar/tests/024-opcache-win32.phpt @@ -5,8 +5,8 @@ Phar: phar:// include with Opcache --INI-- phar.require_hash=0 diff --git a/ext/phar/tests/bug77022.phpt b/ext/phar/tests/bug77022.phpt index c287bb339f09b..40d908f1eeb01 100644 --- a/ext/phar/tests/bug77022.phpt +++ b/ext/phar/tests/bug77022.phpt @@ -1,8 +1,8 @@ --TEST-- Phar: Bug #77022: PharData always creates new files with mode 0666 --SKIPIF-- - --FILE-- diff --git a/ext/phar/tests/bug79082.phpt b/ext/phar/tests/bug79082.phpt index 9ced140b28f91..512c4fb95c48c 100644 --- a/ext/phar/tests/bug79082.phpt +++ b/ext/phar/tests/bug79082.phpt @@ -1,8 +1,8 @@ --TEST-- Phar: Bug #79082: Files added to tar with Phar::buildFromIterator have all-access permissions --SKIPIF-- - --FILE-- diff --git a/ext/phar/tests/phar_buildfromdirectory2-win.phpt b/ext/phar/tests/phar_buildfromdirectory2-win.phpt index e67d03638805e..99d1ee7a060b3 100644 --- a/ext/phar/tests/phar_buildfromdirectory2-win.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2-win.phpt @@ -2,8 +2,8 @@ Phar::buildFromDirectory() - non-directory passed as first parameter --SKIPIF-- --INI-- phar.require_hash=0 diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt index d02d6146d64cb..0d25a60afad5e 100644 --- a/ext/phar/tests/phar_buildfromdirectory2.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2.phpt @@ -2,8 +2,8 @@ Phar::buildFromDirectory() - non-directory passed as first parameter --SKIPIF-- --INI-- phar.require_hash=0 diff --git a/ext/posix/tests/posix_ctermid.phpt b/ext/posix/tests/posix_ctermid.phpt index 1d277659c49ec..b6e064801439f 100644 --- a/ext/posix/tests/posix_ctermid.phpt +++ b/ext/posix/tests/posix_ctermid.phpt @@ -8,7 +8,7 @@ Falko Menge, mail at falko-menge dot de PHP Testfest Berlin 2009-05-10 --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/posix/tests/posix_getpgrp_basic.phpt b/ext/posix/tests/posix_getpgrp_basic.phpt index ceb78bb700bfc..84da54d56307d 100644 --- a/ext/posix/tests/posix_getpgrp_basic.phpt +++ b/ext/posix/tests/posix_getpgrp_basic.phpt @@ -2,7 +2,7 @@ Test posix_getpgrp() function : basic functionality --SKIPIF-- --FILE-- --FILE-- --FILE-- User Group: PHPSP #phptestfestbrasil --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/posix/tests/posix_kill_error.phpt b/ext/posix/tests/posix_kill_error.phpt index e378fa241f8ff..9f0ca0b158a50 100644 --- a/ext/posix/tests/posix_kill_error.phpt +++ b/ext/posix/tests/posix_kill_error.phpt @@ -2,7 +2,7 @@ Test posix_kill() function : error conditions --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/posix/tests/posix_times_basic.phpt b/ext/posix/tests/posix_times_basic.phpt index 49da6b8aebd05..fd06320b0c2b4 100644 --- a/ext/posix/tests/posix_times_basic.phpt +++ b/ext/posix/tests/posix_times_basic.phpt @@ -2,7 +2,7 @@ Test posix_times() function : basic functionality --SKIPIF-- --FILE-- diff --git a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt index 98488f68d19fc..9d070d8ec313d 100644 --- a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt +++ b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt @@ -9,10 +9,10 @@ Falko Menge, mail at falko-menge dot de PHP Testfest Berlin 2009-05-10 --SKIPIF-- diff --git a/ext/posix/tests/posix_uname_basic.phpt b/ext/posix/tests/posix_uname_basic.phpt index 49c2cf5609184..4133b745a4493 100644 --- a/ext/posix/tests/posix_uname_basic.phpt +++ b/ext/posix/tests/posix_uname_basic.phpt @@ -2,7 +2,7 @@ Test posix_uname() function : basic functionality --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/readline/tests/libedit_info_001-win32.phpt b/ext/readline/tests/libedit_info_001-win32.phpt index d14c7a2f46265..3a558b11eb662 100644 --- a/ext/readline/tests/libedit_info_001-win32.phpt +++ b/ext/readline/tests/libedit_info_001-win32.phpt @@ -4,7 +4,7 @@ readline_info(): Basic test --FILE-- diff --git a/ext/readline/tests/libedit_info_001.phpt b/ext/readline/tests/libedit_info_001.phpt index 4c77e7a97c0c3..46618120fba8a 100644 --- a/ext/readline/tests/libedit_info_001.phpt +++ b/ext/readline/tests/libedit_info_001.phpt @@ -4,7 +4,7 @@ readline_info(): Basic test --FILE-- diff --git a/ext/readline/tests/libedit_write_history_001-win32.phpt b/ext/readline/tests/libedit_write_history_001-win32.phpt index 28af4cbfddc53..6cc94bd1294f5 100644 --- a/ext/readline/tests/libedit_write_history_001-win32.phpt +++ b/ext/readline/tests/libedit_write_history_001-win32.phpt @@ -4,7 +4,7 @@ readline_write_history(): Basic test --FILE-- diff --git a/ext/readline/tests/libedit_write_history_001.phpt b/ext/readline/tests/libedit_write_history_001.phpt index 14c3282e6d173..96424e232f6b9 100644 --- a/ext/readline/tests/libedit_write_history_001.phpt +++ b/ext/readline/tests/libedit_write_history_001.phpt @@ -4,7 +4,7 @@ readline_write_history(): Basic test --FILE-- diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt index 8a1951062ff29..e4546bdb78fbe 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt @@ -33,14 +33,14 @@ var_dump($rcB->getStaticPropertyValue("publicOverridden")); echo "\nRetrieving non-existent values from A with no default value:\n"; try { - var_dump($rcA->getStaticPropertyValue("protectedDoesNotExist")); + var_dump($rcA->getStaticPropertyValue("protectedDoesNotExist")); echo "you should not see this"; } catch (Exception $e) { echo $e->getMessage() . "\n"; } try { - var_dump($rcA->getStaticPropertyValue("privateDoesNotExist")); + var_dump($rcA->getStaticPropertyValue("privateDoesNotExist")); echo "you should not see this"; } catch (Exception $e) { echo $e->getMessage() . "\n"; diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt index 1414cfadb7a3a..2c855a0436747 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt @@ -35,14 +35,14 @@ print_r($rcB->getStaticProperties()); echo "\nSet non-existent values from A with no default value:\n"; try { - var_dump($rcA->setStaticPropertyValue("protectedDoesNotExist", "new value 8")); + var_dump($rcA->setStaticPropertyValue("protectedDoesNotExist", "new value 8")); echo "you should not see this"; } catch (Exception $e) { echo $e->getMessage() . "\n"; } try { - var_dump($rcA->setStaticPropertyValue("privateDoesNotExist", "new value 9")); + var_dump($rcA->setStaticPropertyValue("privateDoesNotExist", "new value 9")); echo "you should not see this"; } catch (Exception $e) { echo $e->getMessage() . "\n"; diff --git a/ext/session/tests/bug42596.phpt b/ext/session/tests/bug42596.phpt index 094bd31bcfd59..f27e86387e4fa 100644 --- a/ext/session/tests/bug42596.phpt +++ b/ext/session/tests/bug42596.phpt @@ -2,8 +2,8 @@ Bug #42596 (session.save_path MODE option will not set "write" bit for group or world) --SKIPIF-- --INI-- session.use_cookies=0 diff --git a/ext/session/tests/session_save_path_variation5.phpt b/ext/session/tests/session_save_path_variation5.phpt index 5388f82f45b7a..446a472ab4690 100644 --- a/ext/session/tests/session_save_path_variation5.phpt +++ b/ext/session/tests/session_save_path_variation5.phpt @@ -3,7 +3,7 @@ Test session_save_path() function : variation --SKIPIF-- --INI-- session.save_handler=files diff --git a/ext/shmop/tests/001.phpt b/ext/shmop/tests/001.phpt index 4cac82d2f0c8b..a0f85922eef8d 100644 --- a/ext/shmop/tests/001.phpt +++ b/ext/shmop/tests/001.phpt @@ -2,9 +2,9 @@ shmop extension test --SKIPIF-- --FILE-- --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/ext/skeleton/tests/002.phpt b/ext/skeleton/tests/002.phpt index dcbdd8f2b28b1..6b42a28db3d6e 100644 --- a/ext/skeleton/tests/002.phpt +++ b/ext/skeleton/tests/002.phpt @@ -3,7 +3,7 @@ test1() Basic test --SKIPIF-- --FILE-- diff --git a/ext/skeleton/tests/003.phpt b/ext/skeleton/tests/003.phpt index 84c9fe160204a..0aca2155b5548 100644 --- a/ext/skeleton/tests/003.phpt +++ b/ext/skeleton/tests/003.phpt @@ -3,7 +3,7 @@ --SKIPIF-- --FILE-- diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php index e7592ee67b997..28cdd5f4f7155 100644 --- a/ext/snmp/snmp.stub.php +++ b/ext/snmp/snmp.stub.php @@ -60,7 +60,7 @@ public function __construct(int $version, string $host, string $community, int $ public function close() {} /** @return bool */ - public function setSecurity(string $sec_level, string $auth_protocol = '', string $auth_passphrase = '', string $priv_protocol = '', string $priv_passphrase = '', string $contextName = '', string $contextEngineID = '') {} + public function setSecurity(string $sec_level, string $auth_protocol = "", string $auth_passphrase = "", string $priv_protocol = "", string $priv_passphrase = "", string $contextName = "", string $contextEngineID = "") {} /** @return array|bool */ public function get(array|string $object_id, bool $use_orignames = false) {} diff --git a/ext/snmp/snmp_arginfo.h b/ext/snmp/snmp_arginfo.h index 8bfd40833ff8c..69d404bef733a 100644 --- a/ext/snmp/snmp_arginfo.h +++ b/ext/snmp/snmp_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 759c8a5e721d1c6c9cb63e59ae14f85831396a4d */ + * Stub hash: 31a125dde8e52e7849c8cd62ac410be9249a80df */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) @@ -129,12 +129,12 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_setSecurity, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, sec_level, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_protocol, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_passphrase, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, priv_protocol, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, priv_passphrase, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextName, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextEngineID, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_protocol, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_passphrase, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, priv_protocol, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, priv_passphrase, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextName, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, contextEngineID, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SNMP_get, 0, 0, 1) diff --git a/ext/snmp/tests/bug64124.phpt b/ext/snmp/tests/bug64124.phpt index 9dac2c9e1bba4..5ad75353db86b 100644 --- a/ext/snmp/tests/bug64124.phpt +++ b/ext/snmp/tests/bug64124.phpt @@ -8,7 +8,7 @@ require_once(__DIR__.'/skipif.inc'); $packed = str_repeat(chr(0), 15) . chr(1); if (@inet_ntop($packed) === false) { - die("skip no IPv6 support"); + die("skip no IPv6 support"); } ?> --FILE-- diff --git a/ext/snmp/tests/ipv6.phpt b/ext/snmp/tests/ipv6.phpt index 38bf7ffcb60c4..a4ae028e42e9b 100644 --- a/ext/snmp/tests/ipv6.phpt +++ b/ext/snmp/tests/ipv6.phpt @@ -8,7 +8,7 @@ require_once(__DIR__.'/skipif.inc'); $packed = str_repeat(chr(0), 15) . chr(1); if (@inet_ntop($packed) === false) { - die("skip no IPv6 support"); + die("skip no IPv6 support"); } ?> --FILE-- diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 03fcc46776ea2..1da286ad875f8 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -21,6 +21,7 @@ #include "ext/standard/md5.h" #include "ext/standard/php_random.h" +static char *get_http_header_value_nodup(char *headers, char *type, size_t *len); static char *get_http_header_value(char *headers, char *type); static zend_string *get_http_body(php_stream *socketd, int close, char *headers); static zend_string *get_http_headers(php_stream *socketd); @@ -348,6 +349,7 @@ int make_http_soap_request(zval *this_ptr, int use_ssl; zend_string *http_body; char *content_type, *http_version, *cookie_itt; + size_t cookie_len; int http_close; zend_string *http_headers; char *connection; @@ -958,8 +960,9 @@ int make_http_soap_request(zval *this_ptr, we shouldn't be changing urls so path doesn't matter too much */ - cookie_itt = strstr(ZSTR_VAL(http_headers), "Set-Cookie: "); - while (cookie_itt) { + cookie_itt = ZSTR_VAL(http_headers); + + while ((cookie_itt = get_http_header_value_nodup(cookie_itt, "Set-Cookie: ", &cookie_len))) { char *cookie; char *eqpos, *sempos; zval *cookies; @@ -971,7 +974,7 @@ int make_http_soap_request(zval *this_ptr, cookies = zend_hash_str_update(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies")-1, &tmp_cookies); } - cookie = get_http_header_value(cookie_itt,"Set-Cookie: "); + cookie = estrndup(cookie_itt, cookie_len); eqpos = strstr(cookie, "="); sempos = strstr(cookie, ";"); @@ -1029,7 +1032,7 @@ int make_http_soap_request(zval *this_ptr, smart_str_free(&name); } - cookie_itt = strstr(cookie_itt + sizeof("Set-Cookie: "), "Set-Cookie: "); + cookie_itt = cookie_itt + cookie_len; efree(cookie); } @@ -1347,7 +1350,7 @@ int make_http_soap_request(zval *this_ptr, return TRUE; } -static char *get_http_header_value(char *headers, char *type) +static char *get_http_header_value_nodup(char *headers, char *type, size_t *len) { char *pos, *tmp = NULL; int typelen, headerslen; @@ -1384,7 +1387,9 @@ static char *get_http_header_value(char *headers, char *type) eol--; } } - return estrndup(tmp, eol - tmp); + + *len = eol - tmp; + return tmp; } /* find next line */ @@ -1398,6 +1403,20 @@ static char *get_http_header_value(char *headers, char *type) return NULL; } +static char *get_http_header_value(char *headers, char *type) +{ + size_t len; + char *value; + + value = get_http_header_value_nodup(headers, type, &len); + + if (value) { + return estrndup(value, len); + } + + return NULL; +} + static zend_string* get_http_body(php_stream *stream, int close, char *headers) { zend_string *http_buf = NULL; diff --git a/ext/soap/tests/bug47021.phpt b/ext/soap/tests/bug47021.phpt index 757e74ef15ee3..b05505dd19ed7 100644 --- a/ext/soap/tests/bug47021.phpt +++ b/ext/soap/tests/bug47021.phpt @@ -4,12 +4,9 @@ Bug #47021 SoapClient (SoapClient stumbles over WSDL delivered with "Transfer-En soap.wsdl_cache_enabled=0 --SKIPIF-- +require __DIR__.'/../../standard/tests/http/server.inc'; +http_server_skipif(); --FILE-- $pid, 'uri' => $uri] = http_server($responses); $options = [ 'trace' => true, - 'location' => 'http://127.0.0.1:12342/', + 'location' => $uri, ]; class BugSoapClient extends SoapClient @@ -68,13 +65,12 @@ class BugSoapClient extends SoapClient } } -$client = new BugSoapClient('http://127.0.0.1:12342/', $options); +$client = new BugSoapClient($uri, $options); var_dump(count($client->getItems())); http_server_kill($pid); -?> --EXPECT-- int(1291) int(10) diff --git a/ext/soap/tests/bug73037.phpt b/ext/soap/tests/bug73037.phpt index d835f2a2805f7..4e7293286244e 100644 --- a/ext/soap/tests/bug73037.phpt +++ b/ext/soap/tests/bug73037.phpt @@ -4,14 +4,14 @@ Bug #73037 SoapServer reports Bad Request when gzipped, var 0 server --SKIPIF-- --FILE-- --FILE-- --CONFLICTS-- server diff --git a/ext/soap/tests/schema/schema064.phpt b/ext/soap/tests/schema/schema064.phpt index 88f58cf8cec35..b52a0519f6374 100644 --- a/ext/soap/tests/schema/schema064.phpt +++ b/ext/soap/tests/schema/schema064.phpt @@ -3,7 +3,7 @@ SOAP XML Schema 64: standard date/time types --SKIPIF-- --FILE-- diff --git a/ext/soap/tests/server009.phpt b/ext/soap/tests/server009.phpt index 28d195a3ce401..c8367f1b624fb 100644 --- a/ext/soap/tests/server009.phpt +++ b/ext/soap/tests/server009.phpt @@ -2,10 +2,10 @@ SOAP Server 9: setclass and setpersistence(SOAP_PERSISTENCE_SESSION) --SKIPIF-- --INI-- session.auto_start=1 diff --git a/ext/soap/tests/server019.phpt b/ext/soap/tests/server019.phpt index 132b4dc1a5044..7838a824bc325 100644 --- a/ext/soap/tests/server019.phpt +++ b/ext/soap/tests/server019.phpt @@ -2,9 +2,9 @@ SOAP Server 19: compressed request (gzip) --SKIPIF-- --INI-- precision=14 diff --git a/ext/soap/tests/server020.phpt b/ext/soap/tests/server020.phpt index 69eb4f097b57a..c98517edeac5a 100644 --- a/ext/soap/tests/server020.phpt +++ b/ext/soap/tests/server020.phpt @@ -2,9 +2,9 @@ SOAP Server 20: compressed request (deflate) --SKIPIF-- --INI-- precision=14 diff --git a/ext/soap/tests/server029.phpt b/ext/soap/tests/server029.phpt index f5b28699a53da..7a75a2fec3d55 100644 --- a/ext/soap/tests/server029.phpt +++ b/ext/soap/tests/server029.phpt @@ -14,8 +14,8 @@ SOAP Server 29-CGI: new/addfunction/handle --SKIPIF-- --FILE-- --FILE-- --FILE-- '224.0.0.23', - "interface" => 'lo', + "group" => '224.0.0.23', + "interface" => 'lo', )); if ($so === false) { die('skip interface \'lo\' is unavailable.'); diff --git a/ext/sockets/tests/mcast_ipv4_send.phpt b/ext/sockets/tests/mcast_ipv4_send.phpt index e1e88aca416fe..027c07f1b8158 100644 --- a/ext/sockets/tests/mcast_ipv4_send.phpt +++ b/ext/sockets/tests/mcast_ipv4_send.phpt @@ -7,7 +7,7 @@ if (!extension_loaded('sockets')) { } $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("err"); if (socket_set_option($s, IPPROTO_IP, IP_MULTICAST_IF, 1) === false) { - die("skip interface 1 either doesn't exist or has no ipv4 address"); + die("skip interface 1 either doesn't exist or has no ipv4 address"); } --FILE-- 'ff01::114', - "interface" => 0, + "group" => 'ff01::114', + "interface" => 0, )); if ($so === false) { die('skip unable to join multicast group on any interface.'); } $r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); if ($r === false) { - die('skip unable to send multicast packet.'); + die('skip unable to send multicast packet.'); } if (!defined("MCAST_JOIN_SOURCE_GROUP")) die('skip source operations are unavailable'); $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, + "group" => 'ff01::114', + "interface" => 0, )); $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, - "source" => '2001::dead:beef', + "group" => 'ff01::114', + "interface" => 0, + "source" => '2001::dead:beef', )); if ($so === false) { die('skip protocol independent multicast API is unavailable.'); diff --git a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt index 9bf0bbf91492a..247c41b19d577 100644 --- a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt +++ b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt @@ -6,7 +6,7 @@ if (!extension_loaded('sockets')) { die('skip sockets extension not available.'); } if (!defined('IPPROTO_IPV6')) { - die('skip IPv6 not available.'); + die('skip IPv6 not available.'); } $s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); $br = socket_bind($s, '::', 3000); @@ -14,29 +14,29 @@ $br = socket_bind($s, '::', 3000); * troublesome to send multicast traffic from lo, which we must since * we're dealing with interface-local traffic... */ $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, + "group" => 'ff01::114', + "interface" => 0, )); if ($so === false) { die('skip unable to join multicast group on any interface.'); } $r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); if ($r === false) { - die('skip unable to send multicast packet.'); + die('skip unable to send multicast packet.'); } $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, + "group" => 'ff01::114', + "interface" => 0, )); if (defined("MCAST_JOIN_SOURCE_GROUP")) { - $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, - "source" => '2001::dead:beef', - )); - if ($so !== false) { - die('skip protocol independent multicast API is available.'); - } + $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( + "group" => 'ff01::114', + "interface" => 0, + "source" => '2001::dead:beef', + )); + if ($so !== false) { + die('skip protocol independent multicast API is available.'); + } } --FILE-- --FILE-- diff --git a/ext/sockets/tests/socket_abstract_path_sendmsg.phpt b/ext/sockets/tests/socket_abstract_path_sendmsg.phpt index ca9ab3f5348b0..796b406e26e69 100644 --- a/ext/sockets/tests/socket_abstract_path_sendmsg.phpt +++ b/ext/sockets/tests/socket_abstract_path_sendmsg.phpt @@ -3,10 +3,10 @@ Support for paths in the abstract namespace (bind, sendmsg, recvmsg) --SKIPIF-- --FILE-- diff --git a/ext/sockets/tests/socket_clear_error-win32.phpt b/ext/sockets/tests/socket_clear_error-win32.phpt index 3a0b1ea162a7a..c875cfd2e80fa 100644 --- a/ext/sockets/tests/socket_clear_error-win32.phpt +++ b/ext/sockets/tests/socket_clear_error-win32.phpt @@ -8,7 +8,7 @@ if (!extension_loaded('sockets')) { die('SKIP sockets extension not available.'); } if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); + die('skip windows only test'); } ?> --FILE-- diff --git a/ext/sockets/tests/socket_clear_error.phpt b/ext/sockets/tests/socket_clear_error.phpt index 273f7a0ca8d4e..9ea770954d539 100644 --- a/ext/sockets/tests/socket_clear_error.phpt +++ b/ext/sockets/tests/socket_clear_error.phpt @@ -8,7 +8,7 @@ if (!extension_loaded('sockets')) { die('SKIP sockets extension not available.'); } if(substr(PHP_OS, 0, 3) == 'WIN' ) { - die('skip windows only test'); + die('skip windows only test'); } ?> --FILE-- diff --git a/ext/sockets/tests/socket_create_listen-win32.phpt b/ext/sockets/tests/socket_create_listen-win32.phpt index 89d8dde0b2b83..73cc857617c9e 100644 --- a/ext/sockets/tests/socket_create_listen-win32.phpt +++ b/ext/sockets/tests/socket_create_listen-win32.phpt @@ -3,7 +3,7 @@ Test if socket binds on 31338 --SKIPIF-- '224.0.0.23', - "interface" => "lo", + "group" => '224.0.0.23', + "interface" => "lo", )); if ($so === false) - die("SKIP joining group 224.0.0.23 on interface lo failed"); + die("SKIP joining group 224.0.0.23 on interface lo failed"); --FILE-- --INI-- report_memleaks=0 diff --git a/ext/sockets/tests/socket_getpeername_ipv6loop.phpt b/ext/sockets/tests/socket_getpeername_ipv6loop.phpt index 3dab562bbbf66..c5f61ec5470aa 100644 --- a/ext/sockets/tests/socket_getpeername_ipv6loop.phpt +++ b/ext/sockets/tests/socket_getpeername_ipv6loop.phpt @@ -6,7 +6,7 @@ Tatjana Andersen tatjana.andersen@redpill-linpro.com --SKIPIF-- diff --git a/ext/sockets/tests/socket_import_stream-1.phpt b/ext/sockets/tests/socket_import_stream-1.phpt index 9931535721a33..a89ccf807e272 100644 --- a/ext/sockets/tests/socket_import_stream-1.phpt +++ b/ext/sockets/tests/socket_import_stream-1.phpt @@ -3,7 +3,7 @@ socket_import_stream: Basic test --SKIPIF-- '224.0.0.23', - "interface" => "lo", + "group" => '224.0.0.23', + "interface" => "lo", )); if ($so === false) - die("SKIP joining group 224.0.0.23 on interface lo failed"); + die("SKIP joining group 224.0.0.23 on interface lo failed"); --FILE-- --INI-- report_memleaks=0 diff --git a/ext/sockets/tests/socket_listen-wrongparams.phpt b/ext/sockets/tests/socket_listen-wrongparams.phpt index 5262d5e4b3340..c7c066b5edc0d 100644 --- a/ext/sockets/tests/socket_listen-wrongparams.phpt +++ b/ext/sockets/tests/socket_listen-wrongparams.phpt @@ -3,7 +3,7 @@ Test parameter handling in socket_listen(). --SKIPIF-- diff --git a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt index 6e063c5b52018..a355a2486411f 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt @@ -3,7 +3,7 @@ Test if socket_recvfrom() receives data sent by socket_sendto() through a Unix d --SKIPIF-- --FILE-- diff --git a/ext/sockets/tests/socket_shutdown-win32.phpt b/ext/sockets/tests/socket_shutdown-win32.phpt index aced74b7f8ec3..cc16c3a215871 100644 --- a/ext/sockets/tests/socket_shutdown-win32.phpt +++ b/ext/sockets/tests/socket_shutdown-win32.phpt @@ -8,7 +8,7 @@ if (!extension_loaded('sockets')) { die('SKIP sockets extension not available.'); } if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); + die('skip windows only test'); } ?> --FILE-- diff --git a/ext/sockets/tests/socket_shutdown.phpt b/ext/sockets/tests/socket_shutdown.phpt index 3dc62bc270731..7c12b616c1669 100644 --- a/ext/sockets/tests/socket_shutdown.phpt +++ b/ext/sockets/tests/socket_shutdown.phpt @@ -9,7 +9,7 @@ if (!extension_loaded('sockets')) { die('SKIP sockets extension not available.'); } if(substr(PHP_OS, 0, 3) == 'WIN' ) { - die('skip not for windows'); + die('skip not for windows'); } ?> --FILE-- diff --git a/ext/sockets/tests/unixloop.phpt b/ext/sockets/tests/unixloop.phpt index 31740c97c66e6..c3b80ff588e62 100644 --- a/ext/sockets/tests/unixloop.phpt +++ b/ext/sockets/tests/unixloop.phpt @@ -3,11 +3,11 @@ Unix domain socket Loopback test --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/spl/spl_directory.stub.php b/ext/spl/spl_directory.stub.php index 4691378ca9b71..92c9f8813a2c1 100755 --- a/ext/spl/spl_directory.stub.php +++ b/ext/spl/spl_directory.stub.php @@ -82,7 +82,7 @@ public function getPathInfo(?string $class_name = null) {} * @param resource|null $context * @return SplFileObject */ - public function openFile(string $open_mode = 'r', bool $use_include_path = false, $context = null) {} + public function openFile(string $open_mode = "r", bool $use_include_path = false, $context = null) {} /** @return void */ public function setFileClass(string $class_name = SplFileObject::class) {} @@ -188,7 +188,7 @@ public function count() {} class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator { /** @param resource|null $context */ - public function __construct(string $file_name, string $open_mode = 'r', bool $use_include_path = false, $context = null) {} + public function __construct(string $file_name, string $open_mode = "r", bool $use_include_path = false, $context = null) {} /** @return void */ public function rewind() {} @@ -206,12 +206,12 @@ public function fgets() {} public function fread(int $length) {} /** @return array|false */ - public function fgetcsv(string $delimiter = ",", string $enclosure = '"', string $escape = "\\") {} + public function fgetcsv(string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {} /** @return int|false */ - public function fputcsv(array $fields, string $delimiter = ',', string $enclosure = '"', string $escape = "\\") {} + public function fputcsv(array $fields, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {} - /** @return null|false */ + /** @return bool|null */ public function setCsvControl(string $delimiter = ",", string $enclosure = "\"", string $escape = "\\") {} /** @return array */ diff --git a/ext/spl/spl_directory_arginfo.h b/ext/spl/spl_directory_arginfo.h index 7442c9c0e88e1..4f1961345fd4f 100644 --- a/ext/spl/spl_directory_arginfo.h +++ b/ext/spl/spl_directory_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9127cb70a84f3e75ed16a17b15940b8a6b5f3937 */ + * Stub hash: 4bf9a6a3687e5d14883d35b26c13b05216c86ac3 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) @@ -59,7 +59,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_SplFileInfo_getPathInfo arginfo_class_SplFileInfo_getFileInfo ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo_openFile, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, open_mode, IS_STRING, 0, "\'r\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, open_mode, IS_STRING, 0, "\"r\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -153,7 +153,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, open_mode, IS_STRING, 0, "\'r\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, open_mode, IS_STRING, 0, "\"r\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -172,23 +172,19 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_fgetcsv, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\'\"\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_fputcsv, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, fields, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\',\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\'\"\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_setCsvControl, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") ZEND_END_ARG_INFO() +#define arginfo_class_SplFileObject_setCsvControl arginfo_class_SplFileObject_fgetcsv + #define arginfo_class_SplFileObject_getCsvControl arginfo_class_SplFileInfo_getPath ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileObject_flock, 0, 0, 1) diff --git a/ext/spl/tests/bug65006.phpt b/ext/spl/tests/bug65006.phpt index 1393936c5a1a7..954811a784898 100644 --- a/ext/spl/tests/bug65006.phpt +++ b/ext/spl/tests/bug65006.phpt @@ -4,17 +4,17 @@ Bug #65006: spl_autoload_register fails with multiple callables using self, same --FILE-- diff --git a/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt b/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt index 4b75b3b28f02c..4bdb9fade4b15 100644 --- a/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt +++ b/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt @@ -3,7 +3,7 @@ SQLite3::open error test --SKIPIF-- diff --git a/ext/sqlite3/tests/sqlite3_15_open_error.phpt b/ext/sqlite3/tests/sqlite3_15_open_error.phpt index 817affa78461a..219cb6051a954 100644 --- a/ext/sqlite3/tests/sqlite3_15_open_error.phpt +++ b/ext/sqlite3/tests/sqlite3_15_open_error.phpt @@ -3,7 +3,7 @@ SQLite3::open error test --SKIPIF-- hasMethod("loadExtension")) { - die("skip - sqlite3 doesn't have loadExtension enabled"); + die("skip - sqlite3 doesn't have loadExtension enabled"); } ?> --INI-- diff --git a/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt b/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt index ab5d3fc99a8de..d8f59a5edb1b9 100644 --- a/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt +++ b/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt @@ -10,7 +10,7 @@ sqlite3.extension_dir="{TMP}" require_once(__DIR__ . '/skipif.inc'); if (!method_exists('SQLite3', 'loadExtension')) { - die("skip if SQLITE_OMIT_LOAD_EXTENSION defined"); + die("skip if SQLITE_OMIT_LOAD_EXTENSION defined"); } ?> --FILE-- diff --git a/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt b/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt index f04df7750b2a4..7b0d5fea531fc 100644 --- a/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt +++ b/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt @@ -8,7 +8,7 @@ Jelle Lampaert require_once(__DIR__ . '/skipif.inc'); if (!method_exists('SQLite3', 'loadExtension')) { - die("skip if SQLITE_OMIT_LOAD_EXTENSION defined"); + die("skip if SQLITE_OMIT_LOAD_EXTENSION defined"); } ?> --FILE-- diff --git a/ext/sqlite3/tests/sqlite3_defensive.phpt b/ext/sqlite3/tests/sqlite3_defensive.phpt index 064d87b50a054..c8826af24f1cb 100644 --- a/ext/sqlite3/tests/sqlite3_defensive.phpt +++ b/ext/sqlite3/tests/sqlite3_defensive.phpt @@ -4,7 +4,7 @@ SQLite3 defensive mode ini setting diff --git a/ext/sqlite3/tests/sqlite3stmt_getsql_expanded.phpt b/ext/sqlite3/tests/sqlite3stmt_getsql_expanded.phpt index 9a893c590d3a9..0b677c7378487 100644 --- a/ext/sqlite3/tests/sqlite3stmt_getsql_expanded.phpt +++ b/ext/sqlite3/tests/sqlite3stmt_getsql_expanded.phpt @@ -4,7 +4,7 @@ SQLite3Stmt::getSQL expanded test = 3.14'); + die('skip SQLite < 3.14 installed, requires SQLite >= 3.14'); } ?> --FILE-- diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 0b771fbd49189..aae651df0240a 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -37,8 +37,7 @@ function ob_list_handlers(): array {} function ob_get_status(bool $full_status = false): array {} -// TODO: Shouldn't this be a bool argument? -function ob_implicit_flush(int $flag = 1): void {} +function ob_implicit_flush(bool $flag = true): void {} function output_reset_rewrite_vars(): bool {} @@ -502,9 +501,9 @@ function header(string $string, bool $replace = true, int $http_response_code = function header_remove(?string $name = null): void {} -function setrawcookie(string $name, string $value = '', array|int $expires_or_options = 0, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false): bool {} +function setrawcookie(string $name, string $value = "", array|int $expires_or_options = 0, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false): bool {} -function setcookie(string $name, string $value = '', array|int $expires_or_options = 0, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false): bool {} +function setcookie(string $name, string $value = "", array|int $expires_or_options = 0, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false): bool {} function http_response_code(int $response_code = 0): int|bool {} @@ -660,7 +659,7 @@ function setlocale(int $category, $locales, ...$rest): string|false {} /** @param array $result */ function parse_str(string $encoded_string, &$result): void {} -function str_getcsv(string $string, string $delimiter = ',', string $enclosure = '"', string $escape = '\\'): array {} +function str_getcsv(string $string, string $delimiter = ",", string $enclosure = "\"", string $escape = '\\'): array {} function str_repeat(string $input, int $mult): string {} @@ -745,7 +744,7 @@ function exec(string $command, &$output = null, &$result_code = null): string|fa function system(string $command, &$result_code = null): string|false {} /** @param int $result_code */ -function passthru(string $command, &$result_code = null): bool|null {} +function passthru(string $command, &$result_code = null): ?bool {} function escapeshellcmd(string $command): string {} @@ -865,7 +864,7 @@ function file_put_contents(string $filename, mixed $content, int $flags = 0, $co function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\"): int|false {} /** @param resource $handle */ -function fgetcsv($handle, ?int $length = null, string $delimiter = ",", string $enclosure = '"', string $escape = "\\"): array|false {} +function fgetcsv($handle, ?int $length = null, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\"): array|false {} function realpath(string $path): string|false {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index e27c934c0371f..37f6d8c159c67 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0224dc521c4a8bd49fbcfd26cddb01a2e571cf74 */ + * Stub hash: df6d5ebb0449274b94f1e8707ab54978fd4b7d2f */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -45,7 +45,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_get_status, 0, 0, IS_ARRAY, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_implicit_flush, 0, 0, IS_VOID, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() #define arginfo_output_reset_rewrite_vars arginfo_ob_flush @@ -742,10 +742,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_setrawcookie, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_MASK(0, expires_or_options, MAY_BE_ARRAY|MAY_BE_LONG, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, path, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, domain, IS_STRING, 0, "\'\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, path, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, domain, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, secure, _IS_BOOL, 0, "false") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, httponly, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() @@ -1018,8 +1018,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_getcsv, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\',\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\'\"\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\'\\\\\'") ZEND_END_ARG_INFO() @@ -1341,7 +1341,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgetcsv, 0, 1, MAY_BE_ARRAY|MAY_ ZEND_ARG_INFO(0, handle) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\'\"\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") ZEND_END_ARG_INFO() diff --git a/ext/standard/tests/dir/opendir_variation5.phpt b/ext/standard/tests/dir/opendir_variation5.phpt index 59c8f072fa507..f6b2934474b83 100644 --- a/ext/standard/tests/dir/opendir_variation5.phpt +++ b/ext/standard/tests/dir/opendir_variation5.phpt @@ -3,7 +3,7 @@ Test opendir() function : usage variations - directories with restricted permiss --SKIPIF-- diff --git a/ext/standard/tests/dir/scandir_variation5.phpt b/ext/standard/tests/dir/scandir_variation5.phpt index da20b5289e6ae..7bee9f087a7f5 100644 --- a/ext/standard/tests/dir/scandir_variation5.phpt +++ b/ext/standard/tests/dir/scandir_variation5.phpt @@ -3,7 +3,7 @@ Test scandir() function : usage variations - different directory permissions --SKIPIF-- diff --git a/ext/standard/tests/file/bug41874_1.phpt b/ext/standard/tests/file/bug41874_1.phpt index ed14d87a6777c..b7be9d068a13b 100644 --- a/ext/standard/tests/file/bug41874_1.phpt +++ b/ext/standard/tests/file/bug41874_1.phpt @@ -5,7 +5,7 @@ Venkat Raman Don --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/bug41874_2.phpt b/ext/standard/tests/file/bug41874_2.phpt index 012fc01a3d206..f08e22fb02fd2 100644 --- a/ext/standard/tests/file/bug41874_2.phpt +++ b/ext/standard/tests/file/bug41874_2.phpt @@ -5,7 +5,7 @@ Venkat Raman Don --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/bug41874_3.phpt b/ext/standard/tests/file/bug41874_3.phpt index 01bd7dc60690f..6ecfb8f5d52a7 100644 --- a/ext/standard/tests/file/bug41874_3.phpt +++ b/ext/standard/tests/file/bug41874_3.phpt @@ -5,7 +5,7 @@ Venkat Raman Don --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/bug47517.phpt b/ext/standard/tests/file/bug47517.phpt index 4eaf9a132c674..22a2dc0c5f6a7 100644 --- a/ext/standard/tests/file/bug47517.phpt +++ b/ext/standard/tests/file/bug47517.phpt @@ -7,7 +7,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { } exec('net session 2>&1', $out, $status); if (!$status) { - die('skip test runs under an elevated user account'); + die('skip test runs under an elevated user account'); } ?> --FILE-- diff --git a/ext/standard/tests/file/bug47767.phpt b/ext/standard/tests/file/bug47767.phpt index a7c4f02e78f18..0ef3eb2091940 100644 --- a/ext/standard/tests/file/bug47767.phpt +++ b/ext/standard/tests/file/bug47767.phpt @@ -5,7 +5,7 @@ Venkat Raman Don --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/chroot_001.phpt b/ext/standard/tests/file/chroot_001.phpt index 7fda0b3654bae..a8bca2e04bde7 100644 --- a/ext/standard/tests/file/chroot_001.phpt +++ b/ext/standard/tests/file/chroot_001.phpt @@ -4,11 +4,11 @@ chroot() --FILE-- diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index 0bbce038e6ba4..f2803e9189ed6 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -7,7 +7,7 @@ file_get_contents() test using offset parameter out of range display_errors=false --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fopen_variation11-win32.phpt b/ext/standard/tests/file/fopen_variation11-win32.phpt index e6201829b005a..22368812637bc 100644 --- a/ext/standard/tests/file/fopen_variation11-win32.phpt +++ b/ext/standard/tests/file/fopen_variation11-win32.phpt @@ -7,7 +7,7 @@ Dave Kelsey if(substr(PHP_OS, 0, 3) != "WIN") die("skip Run only on Windows"); if (!is_writable('c:\\')) { - die('skip. C:\\ not writable.'); + die('skip. C:\\ not writable.'); } ?> diff --git a/ext/standard/tests/file/fscanf_variation3.phpt b/ext/standard/tests/file/fscanf_variation3.phpt index 5226dba55a9aa..ae197b6f96fce 100644 --- a/ext/standard/tests/file/fscanf_variation3.phpt +++ b/ext/standard/tests/file/fscanf_variation3.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - integer formats with float values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fscanf_variation33.phpt b/ext/standard/tests/file/fscanf_variation33.phpt index 1809a0d1e5d68..c008c759c9b39 100644 --- a/ext/standard/tests/file/fscanf_variation33.phpt +++ b/ext/standard/tests/file/fscanf_variation33.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - hexa formats with integer values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fscanf_variation34.phpt b/ext/standard/tests/file/fscanf_variation34.phpt index ac202ab26e6cf..2dad3ace145fa 100644 --- a/ext/standard/tests/file/fscanf_variation34.phpt +++ b/ext/standard/tests/file/fscanf_variation34.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - hexa formats with float values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fscanf_variation39.phpt b/ext/standard/tests/file/fscanf_variation39.phpt index 25a0b38706c89..f04d3b7e3165c 100644 --- a/ext/standard/tests/file/fscanf_variation39.phpt +++ b/ext/standard/tests/file/fscanf_variation39.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - unsigned int formats with integer val --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fscanf_variation40.phpt b/ext/standard/tests/file/fscanf_variation40.phpt index f13af1a26a5f4..4b12a8cf0a1e9 100644 --- a/ext/standard/tests/file/fscanf_variation40.phpt +++ b/ext/standard/tests/file/fscanf_variation40.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - unsigned formats with float values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fscanf_variation55.phpt b/ext/standard/tests/file/fscanf_variation55.phpt index 3536d01b4200b..9b5eb967db75a 100644 --- a/ext/standard/tests/file/fscanf_variation55.phpt +++ b/ext/standard/tests/file/fscanf_variation55.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - tracking file pointer while reading --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/fscanf_variation9.phpt b/ext/standard/tests/file/fscanf_variation9.phpt index eafa78cefd1a8..8b88a036f3baf 100644 --- a/ext/standard/tests/file/fscanf_variation9.phpt +++ b/ext/standard/tests/file/fscanf_variation9.phpt @@ -3,7 +3,7 @@ Test fscanf() function: usage variations - float formats with integer values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/link_win32.phpt b/ext/standard/tests/file/link_win32.phpt index 2bba5469c723a..5aa3ce04fd8ca 100644 --- a/ext/standard/tests/file/link_win32.phpt +++ b/ext/standard/tests/file/link_win32.phpt @@ -5,7 +5,7 @@ Venkat Raman Don --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/file/mkdir-004.phpt b/ext/standard/tests/file/mkdir-004.phpt index 46db53108265a..7de0e45894d43 100644 --- a/ext/standard/tests/file/mkdir-004.phpt +++ b/ext/standard/tests/file/mkdir-004.phpt @@ -4,7 +4,7 @@ recursive mkdir() tests diff --git a/ext/standard/tests/file/mkdir-005.phpt b/ext/standard/tests/file/mkdir-005.phpt index 621c9922e553a..383f8b18e0527 100644 --- a/ext/standard/tests/file/mkdir-005.phpt +++ b/ext/standard/tests/file/mkdir-005.phpt @@ -4,7 +4,7 @@ recursive mkdir() tests diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index f47bb610c6cd6..86990f03416a4 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - obscure prefixes --SKIPIF-- --CONFLICTS-- obscure_filename diff --git a/ext/standard/tests/file/windows_links/bug48746_3.phpt b/ext/standard/tests/file/windows_links/bug48746_3.phpt index 09875f32c8cc7..8150e2c551006 100644 --- a/ext/standard/tests/file/windows_links/bug48746_3.phpt +++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt @@ -5,12 +5,12 @@ Venkat Raman Don (don.raman@microsoft.com) --SKIPIF-- &1', $out); if (strpos($out[0], 'recognized')) { - die('skip. junction.exe not found in PATH.'); + die('skip. junction.exe not found in PATH.'); } ?> diff --git a/ext/standard/tests/file/windows_links/common.inc b/ext/standard/tests/file/windows_links/common.inc index b4a09e00c220c..c55aa5d01ad53 100644 --- a/ext/standard/tests/file/windows_links/common.inc +++ b/ext/standard/tests/file/windows_links/common.inc @@ -21,10 +21,10 @@ function get_mountvol() { } function skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(string $filename) { - $ln = "$filename.lnk"; - $ret = exec("mklink $ln " . __FILE__ .' 2>&1', $out); - @unlink($ln); - if (strpos($ret, 'privilege') !== false) { - die('skip SeCreateSymbolicLinkPrivilege not enabled'); - } + $ln = "$filename.lnk"; + $ret = exec("mklink $ln " . __FILE__ .' 2>&1', $out); + @unlink($ln); + if (strpos($ret, 'privilege') !== false) { + die('skip SeCreateSymbolicLinkPrivilege not enabled'); + } } diff --git a/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt b/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt index b8235c8842691..5beb63f905c97 100644 --- a/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt @@ -60,8 +60,8 @@ $d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename; $obj = scandir($d0); foreach ($obj as $file) { - if ("." == $file || ".." == $file) continue; - unlink($d0 . DIRECTORY_SEPARATOR . $file); + if ("." == $file || ".." == $file) continue; + unlink($d0 . DIRECTORY_SEPARATOR . $file); } rmdir($d0); diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt index 1e3d7cd19cc06..1502d62e02286 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt @@ -8,7 +8,7 @@ skip_if_not_win(); $start = realpath(__DIR__); if (strlen($start) > 260 || strlen($start) > 248) { - die("skip the starting path length is unsuitable for this test"); + die("skip the starting path length is unsuitable for this test"); } ?> diff --git a/ext/standard/tests/filters/bug74267.phpt b/ext/standard/tests/filters/bug74267.phpt index 7e5d550e175b7..703b6c0b87cff 100644 --- a/ext/standard/tests/filters/bug74267.phpt +++ b/ext/standard/tests/filters/bug74267.phpt @@ -6,14 +6,14 @@ $stream = fopen('php://memory', 'w'); stream_filter_append($stream, 'convert.quoted-printable-decode', STREAM_FILTER_WRITE, ['line-break-chars' => "\r\n"]); $lines = [ - "\r\n", - " -=()\r\n", - " -=\r\n", - "\r\n" - ]; + "\r\n", + " -=()\r\n", + " -=\r\n", + "\r\n" + ]; foreach ($lines as $line) { - fwrite($stream, $line); + fwrite($stream, $line); } fclose($stream); diff --git a/ext/standard/tests/general_functions/bug41518.phpt b/ext/standard/tests/general_functions/bug41518.phpt index 26e2413ce9a5e..3b5ad3a8336ad 100644 --- a/ext/standard/tests/general_functions/bug41518.phpt +++ b/ext/standard/tests/general_functions/bug41518.phpt @@ -5,7 +5,7 @@ Bug #41518 (file_exists() warns of open_basedir restriction on non-existent file $tmp_dir = __DIR__ . '/bug41518'; mkdir($tmp_dir); if (!is_dir($tmp_dir)) { - die("skip"); + die("skip"); } @unlink($tmp_dir); ?> diff --git a/ext/standard/tests/general_functions/dl-check-enabled.phpt b/ext/standard/tests/general_functions/dl-check-enabled.phpt index 7559b8d905c90..e989df0fb5a0b 100644 --- a/ext/standard/tests/general_functions/dl-check-enabled.phpt +++ b/ext/standard/tests/general_functions/dl-check-enabled.phpt @@ -7,7 +7,7 @@ User Group: PHP-WVL & PHPGent #PHPTestFest --INI-- diff --git a/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt b/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt index 0fe2a5814343a..effae83464ed5 100644 --- a/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt +++ b/ext/standard/tests/general_functions/dl-cve-2007-4887.phpt @@ -4,7 +4,7 @@ dl() filename length checks (CVE-2007-4887) --INI-- diff --git a/ext/standard/tests/general_functions/dl-full-path-not-supported.phpt b/ext/standard/tests/general_functions/dl-full-path-not-supported.phpt index 746162c7bfbac..aaf7d042e536a 100644 --- a/ext/standard/tests/general_functions/dl-full-path-not-supported.phpt +++ b/ext/standard/tests/general_functions/dl-full-path-not-supported.phpt @@ -7,7 +7,7 @@ User Group: PHP-WVL & PHPGent #PHPTestFest --INI-- diff --git a/ext/standard/tests/general_functions/proc_nice_basic-win.phpt b/ext/standard/tests/general_functions/proc_nice_basic-win.phpt index 6bf3b2c0a66b5..e79bcad3c11c7 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic-win.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic-win.phpt @@ -5,11 +5,11 @@ proc_nice() basic behaviour /* No function_exists() check, proc_nice() is always available on Windows */ if (!defined('PHP_WINDOWS_VERSION_MAJOR')) { - die('skip: Only for Windows'); + die('skip: Only for Windows'); } if (getenv('SKIP_SLOW_TESTS')) { - doe('skip: Slow test'); + doe('skip: Slow test'); } ?> --FILE-- diff --git a/ext/standard/tests/general_functions/proc_nice_variation5.phpt b/ext/standard/tests/general_functions/proc_nice_variation5.phpt index 650b13c60c722..f4378a4d92b53 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation5.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation5.phpt @@ -7,9 +7,9 @@ Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) --SKIPIF-- --FILE-- $pipe) { - if (!is_resource($pipe) || feof($pipe)) { - unset($pipes[$i]); - continue; - } - - $chunk = @fread($pipe, 8192); - - if ($chunk === false) { - throw new Error("Failed to read: " . (error_get_last()['message'] ?? 'N/A')); - } - - if ($chunk !== '') { - echo "PIPE {$i} << {$chunk}\n"; - } - } + $r = $pipes; + $w = null; + $e = null; + + if (!stream_select($r, $w, $e, null, 0)) { + throw new Error("Select failed"); + } + + foreach ($r as $i => $pipe) { + if (!is_resource($pipe) || feof($pipe)) { + unset($pipes[$i]); + continue; + } + + $chunk = @fread($pipe, 8192); + + if ($chunk === false) { + throw new Error("Failed to read: " . (error_get_last()['message'] ?? 'N/A')); + } + + if ($chunk !== '') { + echo "PIPE {$i} << {$chunk}\n"; + } + } } ?> diff --git a/ext/standard/tests/general_functions/proc_open_sockets2.phpt b/ext/standard/tests/general_functions/proc_open_sockets2.phpt index 25f3153ec4874..7f9e1a85c54f6 100644 --- a/ext/standard/tests/general_functions/proc_open_sockets2.phpt +++ b/ext/standard/tests/general_functions/proc_open_sockets2.phpt @@ -5,49 +5,49 @@ proc_open() with IO socketpairs function poll($pipe, $read = true) { - $r = ($read == true) ? [$pipe] : null; - $w = ($read == false) ? [$pipe] : null; - $e = null; - - if (!stream_select($r, $w, $e, null, 0)) { - throw new \Error("Select failed"); - } + $r = ($read == true) ? [$pipe] : null; + $w = ($read == false) ? [$pipe] : null; + $e = null; + + if (!stream_select($r, $w, $e, null, 0)) { + throw new \Error("Select failed"); + } } function read_pipe($pipe): string { - poll($pipe); - - if (false === ($chunk = @fread($pipe, 8192))) { - throw new Error("Failed to read: " . (error_get_last()['message'] ?? 'N/A')); - } - - return $chunk; + poll($pipe); + + if (false === ($chunk = @fread($pipe, 8192))) { + throw new Error("Failed to read: " . (error_get_last()['message'] ?? 'N/A')); + } + + return $chunk; } function write_pipe($pipe, $data) { - poll($pipe, false); - - if (false == @fwrite($pipe, $data)) { - throw new Error("Failed to write: " . (error_get_last()['message'] ?? 'N/A')); - } + poll($pipe, false); + + if (false == @fwrite($pipe, $data)) { + throw new Error("Failed to write: " . (error_get_last()['message'] ?? 'N/A')); + } } $cmd = [ - getenv("TEST_PHP_EXECUTABLE"), - __DIR__ . '/proc_open_sockets2.inc' + getenv("TEST_PHP_EXECUTABLE"), + __DIR__ . '/proc_open_sockets2.inc' ]; $spec = [ - ['socket'], - ['socket'] + ['socket'], + ['socket'] ]; $proc = proc_open($cmd, $spec, $pipes); foreach ($pipes as $pipe) { - var_dump(stream_set_blocking($pipe, false)); + var_dump(stream_set_blocking($pipe, false)); } printf("STDOUT << %s\n", read_pipe($pipes[1])); diff --git a/ext/standard/tests/general_functions/proc_open_sockets3.phpt b/ext/standard/tests/general_functions/proc_open_sockets3.phpt index 5ee9e53b56b47..be2a3712382a3 100644 --- a/ext/standard/tests/general_functions/proc_open_sockets3.phpt +++ b/ext/standard/tests/general_functions/proc_open_sockets3.phpt @@ -5,34 +5,34 @@ proc_open() with socket and pipe function poll($pipe, $read = true) { - $r = ($read == true) ? [$pipe] : null; - $w = ($read == false) ? [$pipe] : null; - $e = null; - - if (!stream_select($r, $w, $e, null, 0)) { - throw new \Error("Select failed"); - } + $r = ($read == true) ? [$pipe] : null; + $w = ($read == false) ? [$pipe] : null; + $e = null; + + if (!stream_select($r, $w, $e, null, 0)) { + throw new \Error("Select failed"); + } } function read_pipe($pipe): string { - poll($pipe); - - if (false === ($chunk = @fread($pipe, 8192))) { - throw new Error("Failed to read: " . (error_get_last()['message'] ?? 'N/A')); - } - - return $chunk; + poll($pipe); + + if (false === ($chunk = @fread($pipe, 8192))) { + throw new Error("Failed to read: " . (error_get_last()['message'] ?? 'N/A')); + } + + return $chunk; } $cmd = [ - getenv("TEST_PHP_EXECUTABLE"), - __DIR__ . '/proc_open_sockets2.inc' + getenv("TEST_PHP_EXECUTABLE"), + __DIR__ . '/proc_open_sockets2.inc' ]; $spec = [ - ['pipe', 'r'], - ['socket'] + ['pipe', 'r'], + ['socket'] ]; $proc = proc_open($cmd, $spec, $pipes); diff --git a/ext/standard/tests/general_functions/putenv_bug75574_cp936_win.phpt b/ext/standard/tests/general_functions/putenv_bug75574_cp936_win.phpt index 9a92bef794135..9e963dd1ce495 100644 --- a/ext/standard/tests/general_functions/putenv_bug75574_cp936_win.phpt +++ b/ext/standard/tests/general_functions/putenv_bug75574_cp936_win.phpt @@ -7,7 +7,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { die("skip Valid only on Windows"); } if (!sapi_windows_cp_set(936)) { - die("skip Required CP 936 or compatible"); + die("skip Required CP 936 or compatible"); } ?> diff --git a/ext/standard/tests/http/CONFLICTS b/ext/standard/tests/http/CONFLICTS deleted file mode 100644 index 254defddb53c5..0000000000000 --- a/ext/standard/tests/http/CONFLICTS +++ /dev/null @@ -1 +0,0 @@ -server diff --git a/ext/standard/tests/http/bug38802.phpt b/ext/standard/tests/http/bug38802.phpt index dc00a834c1807..1d7dc4d2d9928 100644 --- a/ext/standard/tests/http/bug38802.phpt +++ b/ext/standard/tests/http/bug38802.phpt @@ -3,25 +3,27 @@ Bug #38802 (ignore_errors and max_redirects) --INI-- allow_url_fopen=1 --SKIPIF-- - + $context_options)); - $responses = array( - "data://text/plain,HTTP/1.1 302 Moved Temporarily\r\nLocation: http://127.0.0.1:12342/foo/bar2\r\n\r\n1", - "data://text/plain,HTTP/1.1 301 Moved Permanently\r\nLocation: http://127.0.0.1:12342/foo/bar3\r\n\r\n", - "data://text/plain,HTTP/1.1 302 Moved Temporarily\r\nLocation: http://127.0.0.1:12342/foo/bar4\r\n\r\n3", - "data://text/plain,HTTP/1.1 200 OK\r\n\r\ndone.", - ); - - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + $uri = null; + ['pid' => $pid, 'uri' => $uri ] = http_server('genResponses', $output); - $fd = fopen('http://127.0.0.1:12342/foo/bar', 'rb', false, $context); + $fd = fopen("$uri/foo/bar", 'rb', false, $context); var_dump($fd); if ($fd) { @@ -73,64 +75,64 @@ array(7) { [0]=> string(30) "HTTP/1.1 302 Moved Temporarily" [1]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar2" + string(%d) "Location: http://%s:%d/foo/bar2" [2]=> string(30) "HTTP/1.1 301 Moved Permanently" [3]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar3" + string(%d) "Location: http://%s:%d/foo/bar3" [4]=> string(30) "HTTP/1.1 302 Moved Temporarily" [5]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar4" + string(%d) "Location: http://%s:%d/foo/bar4" [6]=> string(15) "HTTP/1.1 200 OK" } string(5) "done." string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close GET /foo/bar2 HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close GET /foo/bar3 HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close GET /foo/bar4 HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " -- Test: fail after 2 redirections -- -Warning: fopen(http://127.0.0.1:12342/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s +Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s bool(false) string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close GET /foo/bar2 HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " -- Test: fail at first redirection -- -Warning: fopen(http://127.0.0.1:12342/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s +Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s bool(false) string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " -- Test: fail at first redirection (2) -- -Warning: fopen(http://127.0.0.1:12342/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s +Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s bool(false) string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -140,11 +142,11 @@ array(2) { [0]=> string(30) "HTTP/1.1 302 Moved Temporarily" [1]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar2" + string(%d) "Location: http://%s:%d/foo/bar2" } string(1) "1" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -154,11 +156,11 @@ array(2) { [0]=> string(30) "HTTP/1.1 302 Moved Temporarily" [1]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar2" + string(%d) "Location: http://%s:%d/foo/bar2" } string(1) "1" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -168,19 +170,19 @@ array(4) { [0]=> string(30) "HTTP/1.1 302 Moved Temporarily" [1]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar2" + string(%d) "Location: http://%s:%d/foo/bar2" [2]=> string(30) "HTTP/1.1 301 Moved Permanently" [3]=> - string(41) "Location: http://127.0.0.1:12342/foo/bar3" + string(%d) "Location: http://%s:%d/foo/bar3" } string(0) "" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close GET /foo/bar2 HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " diff --git a/ext/standard/tests/http/bug43510.phpt b/ext/standard/tests/http/bug43510.phpt index 45ba4fb20f44f..bfb90e4d74775 100644 --- a/ext/standard/tests/http/bug43510.phpt +++ b/ext/standard/tests/http/bug43510.phpt @@ -3,7 +3,7 @@ Bug #43510 (stream_get_meta_data() does not return same mode as used in fopen) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri ] = http_server($responses, $output); foreach(array('r', 'rb') as $mode) { - $fd = fopen('http://127.0.0.1:12342/', $mode, false); + $fd = fopen($uri, $mode, false); $meta = stream_get_meta_data($fd); var_dump($meta['mode']); fclose($fd); diff --git a/ext/standard/tests/http/bug47021.phpt b/ext/standard/tests/http/bug47021.phpt index b3acd1bc3ad02..326eceb687a52 100644 --- a/ext/standard/tests/http/bug47021.phpt +++ b/ext/standard/tests/http/bug47021.phpt @@ -3,7 +3,7 @@ Bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chu --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses); - echo file_get_contents('http://127.0.0.1:12342/', false, $ctx); + echo file_get_contents($uri, false, $ctx); echo "\n"; - echo file_get_contents('http://127.0.0.1:12342/', false, $ctx); + echo file_get_contents($uri, false, $ctx); echo "\n"; http_server_kill($pid); diff --git a/ext/standard/tests/http/bug48929.phpt b/ext/standard/tests/http/bug48929.phpt index fad8775b6a8e4..256b242f769e3 100644 --- a/ext/standard/tests/http/bug48929.phpt +++ b/ext/standard/tests/http/bug48929.phpt @@ -3,7 +3,7 @@ Bug #48929 (duplicate \r\n sent after last header line) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); foreach($responses as $r) { - $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $context); + $fd = fopen($uri, 'rb', false, $context); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); @@ -42,7 +42,7 @@ do_test(array('header' => "X-Foo: bar\r\nContent-Type: text/plain", 'method' => --EXPECTF-- -- Test: requests with 'header' as array -- string(%d) "POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close Content-Length: 4 X-Foo: bar @@ -51,7 +51,7 @@ Content-Type: text/plain ohai" -- Test: requests with 'header' as string -- string(%d) "POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close Content-Length: 4 X-Foo: bar diff --git a/ext/standard/tests/http/bug53198.phpt b/ext/standard/tests/http/bug53198.phpt index da2a4cf15f717..1d66218478170 100644 --- a/ext/standard/tests/http/bug53198.phpt +++ b/ext/standard/tests/http/bug53198.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #53198 (From: header cannot be changed with ini_set) --SKIPIF-- - + --INI-- allow_url_fopen=1 from=teste@teste.pt @@ -15,11 +15,11 @@ function do_test() { "data://text/plain,HTTP/1.1 200 OK\r\n\r\n", ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + ['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); foreach($responses as $r) { - $fd = fopen('http://127.0.0.1:12342/', 'rb', false); + $fd = fopen($uri, 'rb', false); fseek($output, 0, SEEK_SET); var_dump(stream_get_contents($output)); @@ -45,14 +45,14 @@ do_test(); -- Test: leave default -- string(%d) "GET / HTTP/1.1 From: teste@teste.pt -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " -- Test: after ini_set -- string(%d) "GET / HTTP/1.1 From: junk@junk.com -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " diff --git a/ext/standard/tests/http/bug60570.phpt b/ext/standard/tests/http/bug60570.phpt index 98a6bf0d3bf2f..7b62bdaf0b3ce 100644 --- a/ext/standard/tests/http/bug60570.phpt +++ b/ext/standard/tests/http/bug60570.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #60570 (Stream context leaks when http request fails) --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -16,14 +16,14 @@ function do_test() { "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n" ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + ['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); $a = $b = count(get_resources()); $i = 3; while ($i--) { $context = stream_context_create(array('http'=>array('timeout'=>1))); - file_get_contents('http://127.0.0.1:12342/', 0, $context); + file_get_contents($uri, 0, $context); unset($context); $b = $a; @@ -39,13 +39,13 @@ function do_test() { 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 +Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in %s on line %d -Warning: file_get_contents(http://127.0.0.1:12342/): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found +Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in %s on line %d -Warning: file_get_contents(http://127.0.0.1:12342/): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found +Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in %s on line %d leak? penultimate iteration: %d, last one: %d bool(true) diff --git a/ext/standard/tests/http/bug61548.phpt b/ext/standard/tests/http/bug61548.phpt index 24e709bf36204..5f21b3769dd85 100644 --- a/ext/standard/tests/http/bug61548.phpt +++ b/ext/standard/tests/http/bug61548.phpt @@ -3,7 +3,7 @@ Bug #61548 (content-type must appear at the end of headers) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); - $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); + $fd = fopen($uri, 'rb', false, $ctx); fseek($output, 0, SEEK_SET); echo stream_get_contents($output); @@ -41,37 +41,37 @@ do_test("First:1\nContent-type:text/plain\nSecond:2\nThird:"); ?> Done ---EXPECT-- +--EXPECTF-- POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 Content-type: text/plain GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 Content-type: text/plain GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 @@ -79,40 +79,40 @@ Content-type: text/plain Third: GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 Third: POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Content-type:text/plain Second:2 GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Content-type:text/plain Second:2 GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Content-type:text/plain @@ -120,7 +120,7 @@ Second:2 Third: GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close First:1 Second:2 diff --git a/ext/standard/tests/http/bug65634.phpt b/ext/standard/tests/http/bug65634.phpt index 2d2b13989e541..196b6aa0e0b63 100644 --- a/ext/standard/tests/http/bug65634.phpt +++ b/ext/standard/tests/http/bug65634.phpt @@ -3,7 +3,7 @@ Bug #65634 (HTTP wrapper is very slow with protocol_version 1.1) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); - $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); + $fd = fopen($uri, 'rb', false, $ctx); fseek($output, 0, SEEK_SET); echo stream_get_contents($output); @@ -48,34 +48,34 @@ do_test('1.1', 'close'); echo "HTTP/1.1, connection: keep-alive:\n"; do_test('1.1', 'keep-alive'); -?> ---EXPECT-- + +--EXPECTF-- HTTP/1.0, default behaviour: GET / HTTP/1.0 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close HTTP/1.0, connection: close: GET / HTTP/1.0 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close HTTP/1.0, connection: keep-alive: GET / HTTP/1.0 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: keep-alive HTTP/1.1, default behaviour: GET / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close HTTP/1.1, connection: close: GET / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close HTTP/1.1, connection: keep-alive: GET / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: keep-alive diff --git a/ext/standard/tests/http/bug67430.phpt b/ext/standard/tests/http/bug67430.phpt index cf8db65cf163f..e72e419fc02ac 100644 --- a/ext/standard/tests/http/bug67430.phpt +++ b/ext/standard/tests/http/bug67430.phpt @@ -3,7 +3,7 @@ Bug #67430 (http:// wrapper doesn't follow 308 redirects) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); - $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); + $fd = fopen($uri, 'rb', false, $ctx); fseek($output, 0, SEEK_SET); echo stream_get_contents($output); @@ -36,17 +36,17 @@ do_test(false); ?> Done ---EXPECT-- +--EXPECTF-- POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close GET /foo HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close POST / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close Done diff --git a/ext/standard/tests/http/bug69337.phpt b/ext/standard/tests/http/bug69337.phpt index 7136ff474d3cf..051108a094887 100644 --- a/ext/standard/tests/http/bug69337.phpt +++ b/ext/standard/tests/http/bug69337.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #69337 (Stream context leaks when http request fails) --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -21,17 +21,17 @@ $ctx = stream_context_create(); stream_context_set_params($ctx, array("notification" => "stream_notification_callback")); $responses = array( - "data://text/plain,HTTP/1.0 302 Found\r\nLocation: http://127.0.0.1:22345/try-again\r\n\r\n", + "data://text/plain,HTTP/1.0 302 Found\r\nLocation: /try-again\r\n\r\n", "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", ); -$pid = http_server("tcp://127.0.0.1:22345", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -$f = file_get_contents('http://127.0.0.1:22345/', 0, $ctx); +$f = file_get_contents($uri, 0, $ctx); http_server_kill($pid); var_dump($f); ?> --EXPECTF-- -Warning: file_get_contents(http://127.0.0.1:22345/): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%ain %s on line %d +Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%ain %s on line %d bool(false) diff --git a/ext/standard/tests/http/bug73297.phpt b/ext/standard/tests/http/bug73297.phpt index 0b0e02f3fd028..a632ff4170e5a 100644 --- a/ext/standard/tests/http/bug73297.phpt +++ b/ext/standard/tests/http/bug73297.phpt @@ -3,7 +3,7 @@ Bug #73297 (Ignore 100 Continue returned by HTTP/1.1 servers) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses); -echo file_get_contents('http://127.0.0.1:12342/', false, $ctx); +echo file_get_contents($uri, false, $ctx); echo "\n"; http_server_kill($pid); -?> --EXPECT-- Hello diff --git a/ext/standard/tests/http/bug75535.phpt b/ext/standard/tests/http/bug75535.phpt index 236a96820c8c4..7b015890d2f51 100644 --- a/ext/standard/tests/http/bug75535.phpt +++ b/ext/standard/tests/http/bug75535.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #75535: Inappropriately parsing HTTP response leads to PHP segment fault --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -12,13 +12,13 @@ $responses = array( "data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n", ); -$pid = http_server("tcp://127.0.0.1:22351", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -var_dump(file_get_contents('http://127.0.0.1:22351/')); +var_dump(file_get_contents($uri)); var_dump($http_response_header); http_server_kill($pid); -?> + --EXPECT-- string(0) "" array(2) { diff --git a/ext/standard/tests/http/bug75981.phpt b/ext/standard/tests/http/bug75981.phpt index 52a560cfbc206..078f276ff98b8 100644 --- a/ext/standard/tests/http/bug75981.phpt +++ b/ext/standard/tests/http/bug75981.phpt @@ -3,7 +3,7 @@ Bug #75981 (stack-buffer-overflow while parsing HTTP response) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses); -echo @file_get_contents('http://127.0.0.1:12342/', false, $ctx); +echo @file_get_contents($uri, false, $ctx); http_server_kill($pid); diff --git a/ext/standard/tests/http/bug76342.phpt b/ext/standard/tests/http/bug76342.phpt index 10de23fdf307a..f1464417f98a9 100644 --- a/ext/standard/tests/http/bug76342.phpt +++ b/ext/standard/tests/http/bug76342.phpt @@ -3,7 +3,7 @@ Bug #76342 (file_get_contents waits twice specified timeout) --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server_sleep(); $start = microtime(true); -file_get_contents('http://127.0.0.1:12342/', false, $ctx); +file_get_contents($uri, false, $ctx); $diff = microtime(true) - $start; if ($diff >= 2 * $timeout) { echo "FAIL: $diff\n"; @@ -31,5 +31,5 @@ http_server_kill($pid); ?> DONE --EXPECTF-- -Warning: file_get_contents(http://127.0.0.1:12342/): Failed to open stream: HTTP request failed! in %s on line %d +Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! in %s on line %d DONE diff --git a/ext/standard/tests/http/bug79265.phpt b/ext/standard/tests/http/bug79265.phpt index 25efdd089a11a..c100b9963a49d 100644 --- a/ext/standard/tests/http/bug79265.phpt +++ b/ext/standard/tests/http/bug79265.phpt @@ -3,7 +3,7 @@ Bug #79265 (Improper injection of Host header when using fopen for http requests --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); $opts = array( 'http'=>array( @@ -23,14 +23,13 @@ $opts = array( ) ); $context = stream_context_create($opts); -$fd = fopen('http://127.0.0.1:12342/', 'rb', false, $context); +$fd = fopen($uri, 'rb', false, $context); fseek($output, 0, SEEK_SET); echo stream_get_contents($output); fclose($fd); http_server_kill($pid); -?> --EXPECT-- GET / HTTP/1.1 Connection: close diff --git a/ext/standard/tests/http/bug79265_2.phpt b/ext/standard/tests/http/bug79265_2.phpt index 0cdde1050152f..a7c27bada92fc 100644 --- a/ext/standard/tests/http/bug79265_2.phpt +++ b/ext/standard/tests/http/bug79265_2.phpt @@ -3,7 +3,7 @@ Bug #79265 variation: "host:" not at start of header --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); $opts = array( 'http'=>array( @@ -22,17 +22,16 @@ $opts = array( ) ); $context = stream_context_create($opts); -$fd = fopen('http://127.0.0.1:12342/', 'rb', false, $context); +$fd = fopen($uri, 'rb', false, $context); fseek($output, 0, SEEK_SET); echo stream_get_contents($output); fclose($fd); http_server_kill($pid); -?> ---EXPECT-- +--EXPECTF-- GET / HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close RandomHeader: host:8080 Cookie: foo=bar diff --git a/ext/standard/tests/http/http_response_header_01.phpt b/ext/standard/tests/http/http_response_header_01.phpt index 05037f24b1f7e..16cac9b0e17f9 100644 --- a/ext/standard/tests/http/http_response_header_01.phpt +++ b/ext/standard/tests/http/http_response_header_01.phpt @@ -1,7 +1,7 @@ --TEST-- $http_reponse_header (no redirect) --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -12,17 +12,14 @@ $responses = array( "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\nSome: Header\r\n\r\nBody", ); -$pid = http_server("tcp://127.0.0.1:22346", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -function test() { - $f = file_get_contents('http://127.0.0.1:22346/'); - var_dump($f); - var_dump($http_response_header); -} -test(); +$f = file_get_contents($uri); +var_dump($f); +var_dump($http_response_header); http_server_kill($pid); -?> + --EXPECT-- string(4) "Body" array(3) { diff --git a/ext/standard/tests/http/http_response_header_02.phpt b/ext/standard/tests/http/http_response_header_02.phpt index 873a8621a516a..a35b1d308d2c9 100644 --- a/ext/standard/tests/http/http_response_header_02.phpt +++ b/ext/standard/tests/http/http_response_header_02.phpt @@ -1,7 +1,7 @@ --TEST-- $http_reponse_header (redirect) --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -10,21 +10,18 @@ require 'server.inc'; $responses = array( "data://text/plain,HTTP/1.0 302 Found\r\n" - . "Some: Header\r\nLocation: http://127.0.0.1:22347/try-again\r\n\r\n", + . "Some: Header\r\nLocation: /try-again\r\n\r\n", "data://test/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\n\r\nBody", ); -$pid = http_server("tcp://127.0.0.1:22347", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -function test() { - $f = file_get_contents('http://127.0.0.1:22347/'); - var_dump($f); - var_dump($http_response_header); -} -test(); +$f = file_get_contents($uri); +var_dump($f); +var_dump($http_response_header); http_server_kill($pid); -?> + --EXPECT-- string(4) "Body" array(5) { @@ -33,7 +30,7 @@ array(5) { [1]=> string(12) "Some: Header" [2]=> - string(42) "Location: http://127.0.0.1:22347/try-again" + string(20) "Location: /try-again" [3]=> string(15) "HTTP/1.0 200 Ok" [4]=> diff --git a/ext/standard/tests/http/http_response_header_03.phpt b/ext/standard/tests/http/http_response_header_03.phpt index 832382de237a0..dde13997eeed5 100644 --- a/ext/standard/tests/http/http_response_header_03.phpt +++ b/ext/standard/tests/http/http_response_header_03.phpt @@ -1,7 +1,7 @@ --TEST-- $http_reponse_header (redirect + not found) --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -10,23 +10,20 @@ require 'server.inc'; $responses = array( "data://text/plain,HTTP/1.0 302 Found\r\n" - . "Some: Header\r\nLocation: http://127.0.0.1:22348/try-again\r\n\r\n", + . "Some: Header\r\nLocation: /try-again\r\n\r\n", "data://test/plain,HTTP/1.0 404 Not Found\r\nSome: Header\r\n\r\nBody", ); -$pid = http_server("tcp://127.0.0.1:22348", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -function test() { - $f = file_get_contents('http://127.0.0.1:22348/'); - var_dump($f); - var_dump($http_response_header); -} -test(); +$f = file_get_contents($uri); +var_dump($f); +var_dump($http_response_header); http_server_kill($pid); -?> + --EXPECTF-- -Warning: file_get_contents(http://127.0.0.1:22348/): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%a +Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%a bool(false) array(5) { [0]=> @@ -34,7 +31,7 @@ array(5) { [1]=> string(12) "Some: Header" [2]=> - string(42) "Location: http://127.0.0.1:22348/try-again" + string(20) "Location: /try-again" [3]=> string(22) "HTTP/1.0 404 Not Found" [4]=> diff --git a/ext/standard/tests/http/http_response_header_04.phpt b/ext/standard/tests/http/http_response_header_04.phpt index 89a4d466fd687..c313f7a75601a 100644 --- a/ext/standard/tests/http/http_response_header_04.phpt +++ b/ext/standard/tests/http/http_response_header_04.phpt @@ -1,7 +1,7 @@ --TEST-- $http_reponse_header (header with trailing whitespace) --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -12,17 +12,14 @@ $responses = array( "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header \r\n\r\nBody", ); -$pid = http_server("tcp://127.0.0.1:22349", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -function test() { - $f = file_get_contents('http://127.0.0.1:22349/'); - var_dump($f); - var_dump($http_response_header); -} -test(); +$f = file_get_contents($uri); +var_dump($f); +var_dump($http_response_header); http_server_kill($pid); -?> + --EXPECT-- string(4) "Body" array(2) { diff --git a/ext/standard/tests/http/http_response_header_05.phpt b/ext/standard/tests/http/http_response_header_05.phpt index 372de1163d096..c5fe60fa612b7 100644 --- a/ext/standard/tests/http/http_response_header_05.phpt +++ b/ext/standard/tests/http/http_response_header_05.phpt @@ -1,7 +1,7 @@ --TEST-- $http_reponse_header (whitespace-only "header") --SKIPIF-- - + --INI-- allow_url_fopen=1 --FILE-- @@ -12,17 +12,14 @@ $responses = array( "data://text/plain,HTTP/1.0 200 Ok\r\n \r\n\r\nBody", ); -$pid = http_server("tcp://127.0.0.1:22350", $responses, $output); +['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); -function test() { - $f = file_get_contents('http://127.0.0.1:22350/'); - var_dump($f); - var_dump($http_response_header); -} -test(); +$f = file_get_contents($uri); +var_dump($f); +var_dump($http_response_header); http_server_kill($pid); -?> + --EXPECT-- string(4) "Body" array(2) { diff --git a/ext/standard/tests/http/ignore_errors.phpt b/ext/standard/tests/http/ignore_errors.phpt index 436fceeef9035..9cd8cdc4509f8 100644 --- a/ext/standard/tests/http/ignore_errors.phpt +++ b/ext/standard/tests/http/ignore_errors.phpt @@ -3,7 +3,7 @@ http:// and ignore_errors --INI-- allow_url_fopen=1 --SKIPIF-- - + --FILE-- $pid, 'uri' => $uri] = http_server($responses, $output); foreach($responses as $r) { - $fd = fopen('http://127.0.0.1:12342/foo/bar', 'rb', false, $context); + $fd = fopen("$uri/foo/bar", 'rb', false, $context); var_dump($fd); if ($fd) { @@ -63,16 +63,16 @@ array(2) { } string(1) "1" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " -Warning: fopen(http://127.0.0.1:12342/foo/bar): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not found +Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not found in %s on line %d bool(false) string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -86,7 +86,7 @@ array(2) { } string(1) "1" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -99,7 +99,7 @@ array(2) { } string(1) "2" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -113,7 +113,7 @@ array(2) { } string(1) "1" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " @@ -126,7 +126,7 @@ array(2) { } string(1) "2" string(%d) "GET /foo/bar HTTP/1.1 -Host: 127.0.0.1:12342 +Host: %s:%d Connection: close " diff --git a/ext/standard/tests/http/server.inc b/ext/standard/tests/http/server.inc index 81cc131a8a565..5c636705e8ca6 100644 --- a/ext/standard/tests/http/server.inc +++ b/ext/standard/tests/http/server.inc @@ -1,16 +1,16 @@ - $pid, + 'uri' => 'http://' . stream_socket_get_name($server, false), + ]; } return $server; @@ -35,15 +38,20 @@ function http_server_init($socket_string, &$output = null) { /* Minimal HTTP server with predefined responses. * * $socket_string is the socket to create and listen on (e.g. tcp://127.0.0.1:1234) - * $files is an array of files containing N responses for N expected requests. Server dies after N requests. + * $files is an iterable of files or callable generator yielding files. + * containing N responses for N expected requests. Server dies after N requests. * $output is a stream on which everything sent by clients is written to */ -function http_server($socket_string, array $files, &$output = null) { +function http_server($files, &$output = null) { - if (!is_resource($server = http_server_init($socket_string, $output))) { + if (!is_resource($server = http_server_init($output))) { return $server; } + if (is_callable($files)) { + $files = $files($server); + } + foreach($files as $file) { $sock = stream_socket_accept($server); @@ -55,7 +63,7 @@ function http_server($socket_string, array $files, &$output = null) { $content_length = 0; - stream_set_blocking($sock, 0); + stream_set_blocking($sock, false); while (!feof($sock)) { list($r, $w, $e) = array(array($sock), null, null); @@ -73,7 +81,7 @@ function http_server($socket_string, array $files, &$output = null) { } } } - stream_set_blocking($sock, 1); + stream_set_blocking($sock, true); // read content @@ -92,9 +100,9 @@ function http_server($socket_string, array $files, &$output = null) { exit(0); } -function http_server_sleep($socket_string, $micro_seconds = 500000) +function http_server_sleep($micro_seconds = 500000) { - if (!is_resource($server = http_server_init($socket_string, $output))) { + if (!is_resource($server = http_server_init($output))) { return $server; } @@ -110,9 +118,7 @@ function http_server_sleep($socket_string, $micro_seconds = 500000) exit(0); } -function http_server_kill($pid) { +function http_server_kill(int $pid) { posix_kill($pid, SIGTERM); pcntl_waitpid($pid, $status); } - -?> diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt index ed32ac7c0e914..582959f3ae6ee 100644 --- a/ext/standard/tests/image/getimagesize.phpt +++ b/ext/standard/tests/image/getimagesize.phpt @@ -2,7 +2,7 @@ GetImageSize() --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- +http_server_skipif(); --INI-- allow_url_fopen=1 --FILE-- $pid, 'uri' => $uri] = http_server([__DIR__."/news.rss"]); $d = new DomDocument; -$e = $d->load("http://127.0.0.1:12342/news.rss"); +$e = $d->load("$uri/news.rss"); echo "ALIVE\n"; http_server_kill($pid); -?> --EXPECT-- ALIVE diff --git a/ext/standard/tests/network/inet_ipv6.phpt b/ext/standard/tests/network/inet_ipv6.phpt index f78d4be7cc983..8e9c44431b9b5 100644 --- a/ext/standard/tests/network/inet_ipv6.phpt +++ b/ext/standard/tests/network/inet_ipv6.phpt @@ -7,7 +7,7 @@ if (!function_exists("inet_pton")) die("skip no inet_pton()"); $packed = str_repeat(chr(0), 15) . chr(1); if (@inet_ntop($packed) === false) { - die("skip no IPv6 support"); + die("skip no IPv6 support"); } if (stristr(PHP_OS, "darwin") !== false) die("skip MacOS has broken inet_*() funcs"); ?> diff --git a/ext/standard/tests/network/shutdown.phpt b/ext/standard/tests/network/shutdown.phpt index b8655cc1f487b..64373596a2756 100644 --- a/ext/standard/tests/network/shutdown.phpt +++ b/ext/standard/tests/network/shutdown.phpt @@ -2,7 +2,7 @@ stream_socket_shutdown() test on IPv4 TCP Loopback --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --CONFLICTS-- diff --git a/ext/standard/tests/streams/proc_open_bug51800.phpt b/ext/standard/tests/streams/proc_open_bug51800.phpt index 7cf502edd8645..3ae96ca3dd1b6 100644 --- a/ext/standard/tests/streams/proc_open_bug51800.phpt +++ b/ext/standard/tests/streams/proc_open_bug51800.phpt @@ -2,10 +2,10 @@ Bug #51800 proc_open on Windows hangs forever --SKIPIF-- --XFAIL-- pipes have to be read/written simultaneously diff --git a/ext/standard/tests/strings/bug65769.phpt b/ext/standard/tests/strings/bug65769.phpt index 31656ee60fe41..aedc303681f99 100644 --- a/ext/standard/tests/strings/bug65769.phpt +++ b/ext/standard/tests/strings/bug65769.phpt @@ -6,7 +6,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { die('skip Windows only'); } if (PHP_WINDOWS_VERSION_MAJOR < 10) { - die("skip for Windows 10 and above"); + die("skip for Windows 10 and above"); } ?> --FILE-- diff --git a/ext/standard/tests/strings/bug72663_2.phpt b/ext/standard/tests/strings/bug72663_2.phpt index fc8978439013f..d0d7f81008597 100644 --- a/ext/standard/tests/strings/bug72663_2.phpt +++ b/ext/standard/tests/strings/bug72663_2.phpt @@ -3,7 +3,7 @@ Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deseriali --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/htmlentities02.phpt b/ext/standard/tests/strings/htmlentities02.phpt index 9e6a96e060985..e8d0b5b9f7459 100644 --- a/ext/standard/tests/strings/htmlentities02.phpt +++ b/ext/standard/tests/strings/htmlentities02.phpt @@ -4,7 +4,7 @@ htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) --INI-- diff --git a/ext/standard/tests/strings/htmlentities03.phpt b/ext/standard/tests/strings/htmlentities03.phpt index 484065341496d..973bafedbd3b4 100644 --- a/ext/standard/tests/strings/htmlentities03.phpt +++ b/ext/standard/tests/strings/htmlentities03.phpt @@ -4,7 +4,7 @@ htmlentities() test 3 (setlocale / de_DE.ISO-8859-1) --INI-- diff --git a/ext/standard/tests/strings/htmlentities05.phpt b/ext/standard/tests/strings/htmlentities05.phpt index 04bf4deb00193..04dd756a3177a 100644 --- a/ext/standard/tests/strings/htmlentities05.phpt +++ b/ext/standard/tests/strings/htmlentities05.phpt @@ -5,7 +5,7 @@ output_handler= internal_encoding=cp1252 --SKIPIF-- --FILE-- --FILE-- 2147483647) { - die("skip 32bit test only"); + die("skip 32bit test only"); } ?> --FILE-- diff --git a/ext/standard/tests/strings/pack64.phpt b/ext/standard/tests/strings/pack64.phpt index cccdc1ba6e5f3..753821f654299 100644 --- a/ext/standard/tests/strings/pack64.phpt +++ b/ext/standard/tests/strings/pack64.phpt @@ -3,7 +3,7 @@ --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/pack64_32.phpt b/ext/standard/tests/strings/pack64_32.phpt index f52de63ca463d..978e04449de61 100644 --- a/ext/standard/tests/strings/pack64_32.phpt +++ b/ext/standard/tests/strings/pack64_32.phpt @@ -3,7 +3,7 @@ --SKIPIF-- 4) { - die("skip 32bit test only"); + die("skip 32bit test only"); } ?> --FILE-- diff --git a/ext/standard/tests/strings/printf_basic7.phpt b/ext/standard/tests/strings/printf_basic7.phpt index 19c1f42104782..b7218cd7de062 100644 --- a/ext/standard/tests/strings/printf_basic7.phpt +++ b/ext/standard/tests/strings/printf_basic7.phpt @@ -3,7 +3,7 @@ Test printf() function : basic functionality - unsigned format --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/printf_basic8.phpt b/ext/standard/tests/strings/printf_basic8.phpt index 800d6cc1e77aa..395972ba96c23 100644 --- a/ext/standard/tests/strings/printf_basic8.phpt +++ b/ext/standard/tests/strings/printf_basic8.phpt @@ -3,7 +3,7 @@ Test printf() function : basic functionality - octal format --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/sprintf_basic7.phpt b/ext/standard/tests/strings/sprintf_basic7.phpt index 63cf1975bb686..77765aaf52e8c 100644 --- a/ext/standard/tests/strings/sprintf_basic7.phpt +++ b/ext/standard/tests/strings/sprintf_basic7.phpt @@ -3,7 +3,7 @@ Test sprintf() function : basic functionality - unsigned format --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/sprintf_basic8.phpt b/ext/standard/tests/strings/sprintf_basic8.phpt index 5c8cdb5d5a0d4..e9696db27b161 100644 --- a/ext/standard/tests/strings/sprintf_basic8.phpt +++ b/ext/standard/tests/strings/sprintf_basic8.phpt @@ -3,7 +3,7 @@ Test sprintf() function : basic functionality - octal format --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/sprintf_variation28.phpt b/ext/standard/tests/strings/sprintf_variation28.phpt index 53c6bd015f07f..4903d3ed154e6 100644 --- a/ext/standard/tests/strings/sprintf_variation28.phpt +++ b/ext/standard/tests/strings/sprintf_variation28.phpt @@ -3,7 +3,7 @@ Test sprintf() function : usage variations - octal formats with integer values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/sprintf_variation34.phpt b/ext/standard/tests/strings/sprintf_variation34.phpt index a02f5cda6e5ab..c7ff681f57504 100644 --- a/ext/standard/tests/strings/sprintf_variation34.phpt +++ b/ext/standard/tests/strings/sprintf_variation34.phpt @@ -3,7 +3,7 @@ Test sprintf() function : usage variations - hexa formats with integer values --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/sprintf_variation40.phpt b/ext/standard/tests/strings/sprintf_variation40.phpt index 9b3890f15df0e..3bec553dd862a 100644 --- a/ext/standard/tests/strings/sprintf_variation40.phpt +++ b/ext/standard/tests/strings/sprintf_variation40.phpt @@ -3,7 +3,7 @@ Test sprintf() function : usage variations - unsigned formats with integer value --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/strings/sscanf_basic6.phpt b/ext/standard/tests/strings/sscanf_basic6.phpt index dad84c3e6331f..5aec9c094089f 100644 --- a/ext/standard/tests/strings/sscanf_basic6.phpt +++ b/ext/standard/tests/strings/sscanf_basic6.phpt @@ -3,7 +3,7 @@ Test sscanf() function : basic functionality - unsigned format --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/time/001.phpt b/ext/standard/tests/time/001.phpt index 34b87157f2243..afd32375bb828 100644 --- a/ext/standard/tests/time/001.phpt +++ b/ext/standard/tests/time/001.phpt @@ -2,7 +2,7 @@ microtime() function --SKIPIF-- --FILE-- --FILE-- diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt index 3f2b5511bdfc4..aa83a693190db 100644 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ b/ext/standard/tests/url/parse_url_basic_001.phpt @@ -873,6 +873,15 @@ echo "Done"; string(3) "%:x" } +--> https://example.com:0/: array(3) { + ["scheme"]=> + string(5) "https" + ["host"]=> + string(11) "example.com" + ["path"]=> + string(1) "/" +} + --> http:///blah.com: bool(false) --> http://:80: bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_002.phpt b/ext/standard/tests/url/parse_url_basic_002.phpt index f2e3f236a05b7..a9a0d5a602bb7 100644 --- a/ext/standard/tests/url/parse_url_basic_002.phpt +++ b/ext/standard/tests/url/parse_url_basic_002.phpt @@ -107,6 +107,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : NULL --> %:x : NULL +--> https://example.com:0/ : string(5) "https" --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_003.phpt b/ext/standard/tests/url/parse_url_basic_003.phpt index c6854221857f6..1eb64d6a1b1c6 100644 --- a/ext/standard/tests/url/parse_url_basic_003.phpt +++ b/ext/standard/tests/url/parse_url_basic_003.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : NULL --> %:x : NULL +--> https://example.com:0/ : string(11) "example.com" --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_004.phpt b/ext/standard/tests/url/parse_url_basic_004.phpt index a1d9225c50d8b..4bc6adc1b9af9 100644 --- a/ext/standard/tests/url/parse_url_basic_004.phpt +++ b/ext/standard/tests/url/parse_url_basic_004.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : NULL --> %:x : NULL +--> https://example.com:0/ : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index a8c982877ae7d..dfbe7e7971e44 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : NULL --> %:x : NULL +--> https://example.com:0/ : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index ac71994afbab0..49f139f1454f7 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : NULL --> %:x : NULL +--> https://example.com:0/ : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_007.phpt b/ext/standard/tests/url/parse_url_basic_007.phpt index 379ac9ac7c9f7..8d7de1d0fb8a2 100644 --- a/ext/standard/tests/url/parse_url_basic_007.phpt +++ b/ext/standard/tests/url/parse_url_basic_007.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : string(1) "/" --> /rest/Users?filter={"id":"123"} : string(11) "/rest/Users" --> %:x : string(3) "%:x" +--> https://example.com:0/ : string(1) "/" --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_008.phpt b/ext/standard/tests/url/parse_url_basic_008.phpt index afb648dcf2663..9080523f502fd 100644 --- a/ext/standard/tests/url/parse_url_basic_008.phpt +++ b/ext/standard/tests/url/parse_url_basic_008.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : string(19) "filter={"id":"123"}" --> %:x : NULL +--> https://example.com:0/ : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_basic_009.phpt b/ext/standard/tests/url/parse_url_basic_009.phpt index 9425e57955680..e37dee6dacf0d 100644 --- a/ext/standard/tests/url/parse_url_basic_009.phpt +++ b/ext/standard/tests/url/parse_url_basic_009.phpt @@ -106,6 +106,7 @@ echo "Done"; --> / : NULL --> /rest/Users?filter={"id":"123"} : NULL --> %:x : NULL +--> https://example.com:0/ : NULL --> http:///blah.com : bool(false) --> http://:80 : bool(false) --> http://user@:80 : bool(false) diff --git a/ext/standard/tests/url/parse_url_unterminated.phpt b/ext/standard/tests/url/parse_url_unterminated.phpt index 86b9d0e1f1191..9ab0c887c8d60 100644 --- a/ext/standard/tests/url/parse_url_unterminated.phpt +++ b/ext/standard/tests/url/parse_url_unterminated.phpt @@ -881,6 +881,15 @@ echo "Done"; string(3) "%:x" } +--> https://example.com:0/: array(3) { + ["scheme"]=> + string(5) "https" + ["host"]=> + string(11) "example.com" + ["path"]=> + string(1) "/" +} + --> http:///blah.com: bool(false) --> http://:80: bool(false) diff --git a/ext/standard/tests/url/urls.inc b/ext/standard/tests/url/urls.inc index 199f22caea1d3..d334f4e9ab2be 100644 --- a/ext/standard/tests/url/urls.inc +++ b/ext/standard/tests/url/urls.inc @@ -92,6 +92,7 @@ $urls = array( '/', '/rest/Users?filter={"id":"123"}', '%:x', +'https://example.com:0/', // Severely malformed URLs that do not parse: 'http:///blah.com', diff --git a/ext/standard/url.c b/ext/standard/url.c index 1d4869ecd48e5..b24fe8ecf8d0c 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -183,10 +183,11 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) if (pp - p > 0 && pp - p < 6 && (pp == ue || *pp == '/')) { zend_long port; + char *end; memcpy(port_buf, p, (pp - p)); port_buf[pp - p] = '\0'; - port = ZEND_STRTOL(port_buf, NULL, 10); - if (port > 0 && port <= 65535) { + port = ZEND_STRTOL(port_buf, &end, 10); + if (port >= 0 && port <= 65535 && end != port_buf) { ret->port = (unsigned short) port; if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; @@ -247,10 +248,11 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) return NULL; } else if (e - p > 0) { zend_long port; + char *end; memcpy(port_buf, p, (e - p)); port_buf[e - p] = '\0'; - port = ZEND_STRTOL(port_buf, NULL, 10); - if (port > 0 && port <= 65535) { + port = ZEND_STRTOL(port_buf, &end, 10); + if (port >= 0 && port <= 65535 && end != port_buf) { ret->port = (unsigned short)port; } else { php_url_free(ret); diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index c277009f11e47..dbde858ab94ee 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -187,13 +187,14 @@ PHP_MINFO_FUNCTION(sysvsem) /* {{{ Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */ PHP_FUNCTION(sem_get) { - zend_long key, max_acquire = 1, perm = 0666, auto_release = 1; + zend_long key, max_acquire = 1, perm = 0666; + zend_bool auto_release = 1; int semid; struct sembuf sop[3]; int count; sysvsem_sem *sem_ptr; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l|lll", &key, &max_acquire, &perm, &auto_release)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l|llb", &key, &max_acquire, &perm, &auto_release)) { RETURN_THROWS(); } @@ -289,7 +290,7 @@ PHP_FUNCTION(sem_get) sem_ptr->key = key; sem_ptr->semid = semid; sem_ptr->count = 0; - sem_ptr->auto_release = auto_release; + sem_ptr->auto_release = (int) auto_release; } /* }}} */ diff --git a/ext/sysvsem/sysvsem.stub.php b/ext/sysvsem/sysvsem.stub.php index 095720df60103..3265984e70f9c 100644 --- a/ext/sysvsem/sysvsem.stub.php +++ b/ext/sysvsem/sysvsem.stub.php @@ -6,10 +6,7 @@ final class SysvSemaphore { } -/** - * @todo use bool for $auto_release - */ -function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1): SysvSemaphore|false {} +function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, bool $auto_release = true): SysvSemaphore|false {} function sem_acquire(SysvSemaphore $semaphore, bool $nowait = false): bool {} diff --git a/ext/sysvsem/sysvsem_arginfo.h b/ext/sysvsem/sysvsem_arginfo.h index d4666d640122f..07ebe6bf545e0 100644 --- a/ext/sysvsem/sysvsem_arginfo.h +++ b/ext/sysvsem/sysvsem_arginfo.h @@ -1,11 +1,11 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a9de9877facd28112e1fe21cf7c6f1c7fdc8014d */ + * Stub hash: d00524488977b77475f9aa78c132a6dd53ab4dd0 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_sem_get, 0, 1, SysvSemaphore, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_acquire, IS_LONG, 0, "1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, perm, IS_LONG, 0, "0666") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auto_release, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auto_release, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sem_acquire, 0, 1, _IS_BOOL, 0) diff --git a/ext/sysvsem/tests/nowait.phpt b/ext/sysvsem/tests/nowait.phpt index b52d2d7e20f4f..ef2ba56cbb5b6 100644 --- a/ext/sysvsem/tests/nowait.phpt +++ b/ext/sysvsem/tests/nowait.phpt @@ -3,7 +3,7 @@ Test sem_acquire with nowait option --SKIPIF-- --FILE-- diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt index 14270ee608fa9..0ed7b8a76853b 100644 --- a/ext/sysvsem/tests/sysv.phpt +++ b/ext/sysvsem/tests/sysv.phpt @@ -3,7 +3,7 @@ General semaphore and shared memory test --SKIPIF-- --FILE-- diff --git a/ext/tokenizer/tokenizer.stub.php b/ext/tokenizer/tokenizer.stub.php index 19fd3411cdbea..72d61ad8560a2 100644 --- a/ext/tokenizer/tokenizer.stub.php +++ b/ext/tokenizer/tokenizer.stub.php @@ -11,7 +11,7 @@ class PhpToken implements Stringable /** @return static[] */ public static function getAll(string $code, int $flags = 0): array {} - public final function __construct(int $id, string $text, int $line = -1, int $pos = -1) {} + final public function __construct(int $id, string $text, int $line = -1, int $pos = -1) {} /** @param int|string|array $kind */ public function is($kind): bool {} diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h index 1194f2838a4b4..6e313cd0de384 100644 --- a/ext/tokenizer/tokenizer_arginfo.h +++ b/ext/tokenizer/tokenizer_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4591855b4c387a2868d5287b28c5050bf828c79f */ + * Stub hash: d8e8b4d749c2960b33fd20b27a1abf033604d4e2 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_get_all, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt index 5ced12894020e..410a2f62ffec6 100644 --- a/ext/xml/tests/bug32001.phpt +++ b/ext/xml/tests/bug32001.phpt @@ -5,7 +5,7 @@ Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), require_once("skipif.inc"); if (!extension_loaded('iconv')) die ("skip iconv extension not available"); if (ICONV_IMPL == 'glibc' && version_compare(ICONV_VERSION, '2.12', '<=')) - die("skip iconv of glibc <= 2.12 is buggy"); + die("skip iconv of glibc <= 2.12 is buggy"); ?> --FILE-- --FILE-- diff --git a/ext/xml/tests/xml_parse_into_struct_variation.phpt b/ext/xml/tests/xml_parse_into_struct_variation.phpt index 3f980495676f7..a03b86ac8ae6b 100644 --- a/ext/xml/tests/xml_parse_into_struct_variation.phpt +++ b/ext/xml/tests/xml_parse_into_struct_variation.phpt @@ -3,7 +3,7 @@ Test xml_parse_into_struct() function : variation --SKIPIF-- --FILE-- diff --git a/ext/xml/tests/xml_parser_set_option_basic.phpt b/ext/xml/tests/xml_parser_set_option_basic.phpt index 7d398dfd7014e..cae9ed71466f5 100644 --- a/ext/xml/tests/xml_parser_set_option_basic.phpt +++ b/ext/xml/tests/xml_parser_set_option_basic.phpt @@ -3,7 +3,7 @@ Test xml_set_notation_decl_handler function : basic --SKIPIF-- --FILE-- diff --git a/ext/xml/tests/xml_parser_set_option_variation3.phpt b/ext/xml/tests/xml_parser_set_option_variation3.phpt index 592c9f52e80bc..d1163de356e0b 100644 --- a/ext/xml/tests/xml_parser_set_option_variation3.phpt +++ b/ext/xml/tests/xml_parser_set_option_variation3.phpt @@ -3,7 +3,7 @@ Test xml_parser_set_option() function : usage variations --SKIPIF-- --FILE-- diff --git a/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt b/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt index 6ceaea63d0914..aa37b84a5560c 100644 --- a/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt +++ b/ext/xml/tests/xml_set_notation_decl_handler_basic.phpt @@ -3,7 +3,7 @@ Test xml_set_notation_decl_handler function : basic --SKIPIF-- --FILE-- diff --git a/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt b/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt index 54a71fd48c771..dc9efe278b969 100644 --- a/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt +++ b/ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt @@ -3,7 +3,7 @@ Test xml_set_processing_instruction_handler function : basic --SKIPIF-- --FILE-- diff --git a/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt b/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt index 6a783f6cfcd71..ba27eec9f5f94 100644 --- a/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt +++ b/ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt @@ -3,7 +3,7 @@ Test xml_set_start_namespace_decl_handler function: basic --SKIPIF-- --FILE-- diff --git a/ext/xml/xml.stub.php b/ext/xml/xml.stub.php index 5f90d91fe4655..b5af23376146b 100644 --- a/ext/xml/xml.stub.php +++ b/ext/xml/xml.stub.php @@ -4,7 +4,7 @@ function xml_parser_create(?string $encoding = null): XmlParser {} -function xml_parser_create_ns(?string $encoding = null, string $sep = ':'): XmlParser {} +function xml_parser_create_ns(?string $encoding = null, string $sep = ":"): XmlParser {} function xml_set_object(XmlParser $parser, object $obj): bool {} diff --git a/ext/xml/xml_arginfo.h b/ext/xml/xml_arginfo.h index ea17fca77d8ec..cd05d403f63a5 100644 --- a/ext/xml/xml_arginfo.h +++ b/ext/xml/xml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b3c718c2aeba9a9c05b6cb281fd7ccaa3791d34e */ + * Stub hash: 5be46eaeaea40f3494a6bbad269f85256030f758 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_xml_parser_create, 0, 0, XmlParser, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") @@ -7,7 +7,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_xml_parser_create_ns, 0, 0, XmlParser, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sep, IS_STRING, 0, "\':\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sep, IS_STRING, 0, "\":\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xml_set_object, 0, 2, _IS_BOOL, 0) diff --git a/ext/xmlreader/php_xmlreader.stub.php b/ext/xmlreader/php_xmlreader.stub.php index 582919d49721f..844a8fddca471 100644 --- a/ext/xmlreader/php_xmlreader.stub.php +++ b/ext/xmlreader/php_xmlreader.stub.php @@ -13,7 +13,7 @@ public function getAttribute(string $name) {} /** @return string|null */ public function getAttributeNo(int $index) {} - /** @return string|null|false */ + /** @return string|null */ public function getAttributeNs(string $name, string $namespaceURI) {} /** @return bool */ @@ -76,6 +76,6 @@ public function setRelaxNGSchemaSource(?string $source) {} /** @return bool|XMLReader */ public static function XML(string $source, ?string $encoding = null, int $options = 0) {} - /** @return DOMNode|bool */ + /** @return DOMNode|false|null */ public function expand(?DOMNode $basenode = null) {} } diff --git a/ext/xmlreader/php_xmlreader_arginfo.h b/ext/xmlreader/php_xmlreader_arginfo.h index 0690d414163e5..0d12174edf862 100644 --- a/ext/xmlreader/php_xmlreader_arginfo.h +++ b/ext/xmlreader/php_xmlreader_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 90e6d525ba87399c54f36965ebf18dbf65084617 */ + * Stub hash: 65f093ef5916078c10dd4bff7e854561f153ab9c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0) ZEND_END_ARG_INFO() diff --git a/ext/xmlwriter/php_xmlwriter.stub.php b/ext/xmlwriter/php_xmlwriter.stub.php index 5b3b4f512b1be..897fe13b875a7 100644 --- a/ext/xmlwriter/php_xmlwriter.stub.php +++ b/ext/xmlwriter/php_xmlwriter.stub.php @@ -52,7 +52,7 @@ function xmlwriter_text(XMLWriter $xmlwriter, string $content): bool {} function xmlwriter_write_raw(XMLWriter $xmlwriter, string $content): bool {} -function xmlwriter_start_document(XMLWriter $xmlwriter, ?string $version = '1.0', ?string $encoding = null, ?string $standalone = null): bool {} +function xmlwriter_start_document(XMLWriter $xmlwriter, ?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {} function xmlwriter_end_document(XMLWriter $xmlwriter): bool {} @@ -80,7 +80,7 @@ function xmlwriter_start_dtd_entity(XMLWriter $xmlwriter, string $name, bool $is function xmlwriter_end_dtd_entity(XMLWriter $xmlwriter): bool {} -function xmlwriter_write_dtd_entity(XMLWriter $xmlwriter, string $name, string $content, bool $isparam = false, string $publicId = UNKNOWN, string $systemId = UNKNOWN, string $ndataid = UNKNOWN): bool {} +function xmlwriter_write_dtd_entity(XMLWriter $xmlwriter, string $name, string $content, bool $isparam = false, ?string $publicId = null, ?string $systemId = null, ?string $ndataid = null): bool {} function xmlwriter_output_memory(XMLWriter $xmlwriter, bool $flush = true): string {} @@ -164,7 +164,7 @@ public function text(string $content): bool {} public function writeRaw(string $content): bool {} /** @alias xmlwriter_start_document */ - public function startDocument(?string $version = '1.0', ?string $encoding = null, ?string $standalone = null): bool {} + public function startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {} /** @alias xmlwriter_end_document */ public function endDocument(): bool {} diff --git a/ext/xmlwriter/php_xmlwriter_arginfo.h b/ext/xmlwriter/php_xmlwriter_arginfo.h index 31eeb140aad7e..39597b4b826d1 100644 --- a/ext/xmlwriter/php_xmlwriter_arginfo.h +++ b/ext/xmlwriter/php_xmlwriter_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 46bde559f165fc53d75690bfb4d86389202bb19e */ + * Stub hash: b1a8634bf79e1ac8fb94611ab942e9e4c06636f9 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) @@ -102,7 +102,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_start_document, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, xmlwriter, XMLWriter, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, version, IS_STRING, 1, "\'1.0\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, version, IS_STRING, 1, "\"1.0\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, standalone, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -160,9 +160,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_write_dtd_entity, 0, 3 ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, isparam, _IS_BOOL, 0, "false") - ZEND_ARG_TYPE_INFO(0, publicId, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, systemId, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, ndataid, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, publicId, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, systemId, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ndataid, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlwriter_output_memory, 0, 1, IS_STRING, 0) @@ -262,7 +262,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_XMLWriter_writeRaw arginfo_class_XMLWriter_writeCdata ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_XMLWriter_startDocument, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, version, IS_STRING, 1, "\'1.0\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, version, IS_STRING, 1, "\"1.0\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, standalone, IS_STRING, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/xmlwriter/tests/bug79029.phpt b/ext/xmlwriter/tests/bug79029.phpt index b6b0c84b182d0..2e6f70dc0ab22 100644 --- a/ext/xmlwriter/tests/bug79029.phpt +++ b/ext/xmlwriter/tests/bug79029.phpt @@ -1,7 +1,7 @@ --TEST-- #79029 (Use After Free's in XMLReader / XMLWriter) --SKIPIF-- - diff --git a/ext/xsl/tests/xsl-phpinfo.phpt b/ext/xsl/tests/xsl-phpinfo.phpt index 5f830356b7410..2119181a5b44d 100644 --- a/ext/xsl/tests/xsl-phpinfo.phpt +++ b/ext/xsl/tests/xsl-phpinfo.phpt @@ -2,9 +2,9 @@ Test phpinfo() displays xsl info --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- common.function_name) { - return (zend_observer_fcall){observer_begin, observer_end}; + return (zend_observer_fcall_handlers){observer_begin, observer_end}; } else if (ZT_G(observer_observe_functions) && fbc->common.function_name) { - return (zend_observer_fcall){observer_begin, observer_end}; + return (zend_observer_fcall_handlers){observer_begin, observer_end}; } - return (zend_observer_fcall){NULL, NULL}; + return (zend_observer_fcall_handlers){NULL, NULL}; } PHP_RINIT_FUNCTION(zend_test) diff --git a/ext/zend_test/tests/observer_generator_04.phpt b/ext/zend_test/tests/observer_generator_04.phpt index 6c2f18207783d..bf6b4e6c6947b 100644 --- a/ext/zend_test/tests/observer_generator_04.phpt +++ b/ext/zend_test/tests/observer_generator_04.phpt @@ -18,7 +18,7 @@ function fooResults() { function doSomething() { $generator = fooResults(); - + while($generator->current() !== NULL) { echo $generator->current() . PHP_EOL; if ($generator->current() === 5) { diff --git a/ext/zend_test/tests/observer_jit_01.phpt b/ext/zend_test/tests/observer_jit_01.phpt deleted file mode 100644 index f489986b6e79b..0000000000000 --- a/ext/zend_test/tests/observer_jit_01.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Observer: JIT is disabled when observer extension is present ---SKIPIF-- - - - ---INI-- -zend_test.observer.enabled=1 -zend_test.observer.observe_all=1 -opcache.enable=1 -opcache.enable_cli=1 -opcache.jit=1 -opcache.jit_buffer_size=1M ---FILE-- - ---EXPECTF-- - - -JIT enabled: no -JIT on: no - diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php index cde266261d640..7da7bfea39221 100644 --- a/ext/zip/php_zip.stub.php +++ b/ext/zip/php_zip.stub.php @@ -26,7 +26,7 @@ function zip_read($zip) {} * @param resource $zip_entry * @deprecated */ -function zip_entry_open($zip_dp, $zip_entry, string $mode = 'rb'): bool {} +function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): bool {} /** * @param resource $zip_ent @@ -111,17 +111,17 @@ public function setArchiveComment(string $comment) {} /** @return string|false */ public function getArchiveComment(int $flags = 0) {} - /** @return null|false */ + /** @return bool|null */ public function setCommentIndex(int $index, string $comment) {} - /** @return null|false */ + /** @return bool|null */ public function setCommentName(string $name, string $comment) {} #ifdef HAVE_SET_MTIME - /** @return null|false */ + /** @return bool|null */ public function setMtimeIndex(int $index, int $timestamp, int $flags = 0) {} - /** @return null|false */ + /** @return bool|null */ public function setMtimeName(string $name, int $timestamp, int $flags = 0) {} #endif diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index c9f90d57f9873..6274f6afefadf 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 49f168c537e48f8a3998d67812a5e2e6a2463533 */ + * Stub hash: 58d4035ad8d21582e93091d5c14f78640c1a17c3 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -16,7 +16,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zip_entry_open, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, zip_dp) ZEND_ARG_INFO(0, zip_entry) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\'rb\'") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"rb\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zip_entry_close, 0, 1, _IS_BOOL, 0) diff --git a/ext/zip/tests/bug51353.phpt b/ext/zip/tests/bug51353.phpt index ab021f4715944..3a4e74a07c806 100644 --- a/ext/zip/tests/bug51353.phpt +++ b/ext/zip/tests/bug51353.phpt @@ -46,7 +46,7 @@ unlink("$base_path/51353.zip"); $a = glob("$base_path/51353_unpack/*.txt"); foreach($a as $f) { - unlink($f); + unlink($f); } rmdir("$base_path/51353_unpack"); ?> diff --git a/ext/zip/tests/bug64342_0.phpt b/ext/zip/tests/bug64342_0.phpt index d187175cd9f98..43f60f5d7c566 100644 --- a/ext/zip/tests/bug64342_0.phpt +++ b/ext/zip/tests/bug64342_0.phpt @@ -2,7 +2,7 @@ Bug #64342 ZipArchive::addFile() has to check file existence (variation 1) --SKIPIF-- --FILE-- --FILE-- @@ -12,7 +12,7 @@ if (!extension_loaded('zlib')) { gzopen('someFile', 'c'); --CLEAN-- --EXPECTF-- Warning: gzopen(): gzopen failed in %s on line %d diff --git a/ext/zlib/tests/gzclose_basic.phpt b/ext/zlib/tests/gzclose_basic.phpt index f3387de09cee5..1f72fc1c88469 100644 --- a/ext/zlib/tests/gzclose_basic.phpt +++ b/ext/zlib/tests/gzclose_basic.phpt @@ -3,7 +3,7 @@ Test function gzclose() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzcompress_basic1.phpt b/ext/zlib/tests/gzcompress_basic1.phpt index 3a8ee949bc4a7..a5d27359274e3 100644 --- a/ext/zlib/tests/gzcompress_basic1.phpt +++ b/ext/zlib/tests/gzcompress_basic1.phpt @@ -3,7 +3,7 @@ Test gzcompress() function : basic functionality --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzcompress_error1.phpt b/ext/zlib/tests/gzcompress_error1.phpt index e559030151dc2..ff09d6568affc 100644 --- a/ext/zlib/tests/gzcompress_error1.phpt +++ b/ext/zlib/tests/gzcompress_error1.phpt @@ -3,7 +3,7 @@ Test gzcompress() function : error conditions --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzcompress_variation1.phpt b/ext/zlib/tests/gzcompress_variation1.phpt index e3cc8e846beee..762aa3c870d63 100644 --- a/ext/zlib/tests/gzcompress_variation1.phpt +++ b/ext/zlib/tests/gzcompress_variation1.phpt @@ -3,7 +3,7 @@ Test gzcompress() function : variation --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzdeflate_basic1.phpt b/ext/zlib/tests/gzdeflate_basic1.phpt index 5257e4db6c537..7ace99a8a7e2f 100644 --- a/ext/zlib/tests/gzdeflate_basic1.phpt +++ b/ext/zlib/tests/gzdeflate_basic1.phpt @@ -3,7 +3,7 @@ Test gzdeflate() function : basic functionality --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzdeflate_error1.phpt b/ext/zlib/tests/gzdeflate_error1.phpt index fbcb2d95f317c..fea4dfec002a7 100644 --- a/ext/zlib/tests/gzdeflate_error1.phpt +++ b/ext/zlib/tests/gzdeflate_error1.phpt @@ -3,7 +3,7 @@ Test gzdeflate() function : error conditions --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzdeflate_variation1.phpt b/ext/zlib/tests/gzdeflate_variation1.phpt index 3058b1d9008f4..e881d77b5102c 100644 --- a/ext/zlib/tests/gzdeflate_variation1.phpt +++ b/ext/zlib/tests/gzdeflate_variation1.phpt @@ -3,7 +3,7 @@ Test gzdeflate() function : variation --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzencode_basic1.phpt b/ext/zlib/tests/gzencode_basic1.phpt index 927e0406db246..b129399dfd7ae 100644 --- a/ext/zlib/tests/gzencode_basic1.phpt +++ b/ext/zlib/tests/gzencode_basic1.phpt @@ -3,7 +3,7 @@ Test gzencode() function : basic functionality --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzencode_error1.phpt b/ext/zlib/tests/gzencode_error1.phpt index 5d850e5438af7..951437b98a085 100644 --- a/ext/zlib/tests/gzencode_error1.phpt +++ b/ext/zlib/tests/gzencode_error1.phpt @@ -3,7 +3,7 @@ Test gzencode() function : error conditions --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzencode_variation1-win32.phpt b/ext/zlib/tests/gzencode_variation1-win32.phpt index 7272b4e7dc582..f7870e890fa55 100644 --- a/ext/zlib/tests/gzencode_variation1-win32.phpt +++ b/ext/zlib/tests/gzencode_variation1-win32.phpt @@ -8,7 +8,7 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) { } if (!extension_loaded("zlib")) { - print "skip - ZLIB extension not loaded"; + print "skip - ZLIB extension not loaded"; } ?> --FILE-- diff --git a/ext/zlib/tests/gzencode_variation1.phpt b/ext/zlib/tests/gzencode_variation1.phpt index 625745629872c..b3987b9d205fa 100644 --- a/ext/zlib/tests/gzencode_variation1.phpt +++ b/ext/zlib/tests/gzencode_variation1.phpt @@ -8,7 +8,7 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) { } if (!extension_loaded("zlib")) { - print "skip - ZLIB extension not loaded"; + print "skip - ZLIB extension not loaded"; } if (PHP_OS == "Darwin") { diff --git a/ext/zlib/tests/gzencode_variation2-win32.phpt b/ext/zlib/tests/gzencode_variation2-win32.phpt index 5ad5a1cdc424e..727a079b61275 100644 --- a/ext/zlib/tests/gzencode_variation2-win32.phpt +++ b/ext/zlib/tests/gzencode_variation2-win32.phpt @@ -8,12 +8,12 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) { } if (!extension_loaded("zlib")) { - print "skip - ZLIB extension not loaded"; + print "skip - ZLIB extension not loaded"; } include 'func.inc'; if (version_compare(get_zlib_version(), "1.2.11") < 0) { - die("skip - at least zlib 1.2.11 required, got " . get_zlib_version()); + die("skip - at least zlib 1.2.11 required, got " . get_zlib_version()); } ?> --FILE-- diff --git a/ext/zlib/tests/gzencode_variation2.phpt b/ext/zlib/tests/gzencode_variation2.phpt index d5c0844006908..f1e3c0d2baba2 100644 --- a/ext/zlib/tests/gzencode_variation2.phpt +++ b/ext/zlib/tests/gzencode_variation2.phpt @@ -8,7 +8,7 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) { } if (!extension_loaded("zlib")) { - print "skip - ZLIB extension not loaded"; + print "skip - ZLIB extension not loaded"; } if (PHP_OS == "Darwin") { diff --git a/ext/zlib/tests/gzeof_basic.phpt b/ext/zlib/tests/gzeof_basic.phpt index c159819d76b4e..f92450d22b98c 100644 --- a/ext/zlib/tests/gzeof_basic.phpt +++ b/ext/zlib/tests/gzeof_basic.phpt @@ -3,7 +3,7 @@ Test function feof() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzeof_variation1.phpt b/ext/zlib/tests/gzeof_variation1.phpt index 2dded2ca1a4ab..3be013facfa04 100644 --- a/ext/zlib/tests/gzeof_variation1.phpt +++ b/ext/zlib/tests/gzeof_variation1.phpt @@ -3,7 +3,7 @@ Test function gzeof while writing. --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzfile_variation15.phpt b/ext/zlib/tests/gzfile_variation15.phpt index 01958214bcb00..7fb103b3ecc9f 100644 --- a/ext/zlib/tests/gzfile_variation15.phpt +++ b/ext/zlib/tests/gzfile_variation15.phpt @@ -3,7 +3,7 @@ Test gzfile() function : variation: use include path (relative directories in pa --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzgetc_basic.phpt b/ext/zlib/tests/gzgetc_basic.phpt index c9b7fcf6159be..5eff9b6d5df8c 100644 --- a/ext/zlib/tests/gzgetc_basic.phpt +++ b/ext/zlib/tests/gzgetc_basic.phpt @@ -3,11 +3,11 @@ Test function gzgetc() by calling it with its expected arguments zlib 1.2.5 --SKIPIF-- 0) { - die('skip - only for zlib <= 1.2.5'); + die('skip - only for zlib <= 1.2.5'); } ?> --FILE-- diff --git a/ext/zlib/tests/gzgetc_basic_1.phpt b/ext/zlib/tests/gzgetc_basic_1.phpt index b2a1a056af68b..49e4ab8f6becf 100644 --- a/ext/zlib/tests/gzgetc_basic_1.phpt +++ b/ext/zlib/tests/gzgetc_basic_1.phpt @@ -3,11 +3,11 @@ Test function gzgetc() by calling it with its expected arguments zlib 1.2.7 --SKIPIF-- = 1.2.7'); + die('skip - only for zlib >= 1.2.7'); } ?> --FILE-- diff --git a/ext/zlib/tests/gzgets_basic.phpt b/ext/zlib/tests/gzgets_basic.phpt index 80ef741423142..4f4e908645d65 100644 --- a/ext/zlib/tests/gzgets_basic.phpt +++ b/ext/zlib/tests/gzgets_basic.phpt @@ -3,7 +3,7 @@ Test function gzgets() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzinflate_error1.phpt b/ext/zlib/tests/gzinflate_error1.phpt index 2ddb3adb6b9fc..67f2aa438bce7 100644 --- a/ext/zlib/tests/gzinflate_error1.phpt +++ b/ext/zlib/tests/gzinflate_error1.phpt @@ -3,7 +3,7 @@ Test gzinflate() function : error conditions --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_basic.phpt b/ext/zlib/tests/gzopen_basic.phpt index a1768e8e00584..cbb4174f9fe00 100644 --- a/ext/zlib/tests/gzopen_basic.phpt +++ b/ext/zlib/tests/gzopen_basic.phpt @@ -3,7 +3,7 @@ Test gzopen() function : basic functionality --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_basic2.phpt b/ext/zlib/tests/gzopen_basic2.phpt index 2b5a9c61d1604..5814b5168f377 100644 --- a/ext/zlib/tests/gzopen_basic2.phpt +++ b/ext/zlib/tests/gzopen_basic2.phpt @@ -3,7 +3,7 @@ Test gzopen() function : basic functionality for writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_variation4.phpt b/ext/zlib/tests/gzopen_variation4.phpt index 3fe924a282fc0..6505306c4534e 100644 --- a/ext/zlib/tests/gzopen_variation4.phpt +++ b/ext/zlib/tests/gzopen_variation4.phpt @@ -3,7 +3,7 @@ Test gzopen() function : variation: use include path (relative directories in pa --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_variation5.phpt b/ext/zlib/tests/gzopen_variation5.phpt index a1cf48ba18ed0..e06c358d80d90 100644 --- a/ext/zlib/tests/gzopen_variation5.phpt +++ b/ext/zlib/tests/gzopen_variation5.phpt @@ -3,7 +3,7 @@ Test gzopen() function : variation: use include path and stream context create a --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_variation6.phpt b/ext/zlib/tests/gzopen_variation6.phpt index 631314818fcdd..16b266db65a5e 100644 --- a/ext/zlib/tests/gzopen_variation6.phpt +++ b/ext/zlib/tests/gzopen_variation6.phpt @@ -3,7 +3,7 @@ Test gzopen() function : variation: relative/absolute file --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_variation7.phpt b/ext/zlib/tests/gzopen_variation7.phpt index f3ba9a4fbc50e..7eef44a702bdc 100644 --- a/ext/zlib/tests/gzopen_variation7.phpt +++ b/ext/zlib/tests/gzopen_variation7.phpt @@ -3,7 +3,7 @@ Test function gzopen() by calling it twice on the same file and not closing one --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_variation8.phpt b/ext/zlib/tests/gzopen_variation8.phpt index 1885a048d6807..b2b12276ebd25 100644 --- a/ext/zlib/tests/gzopen_variation8.phpt +++ b/ext/zlib/tests/gzopen_variation8.phpt @@ -3,7 +3,7 @@ Test gzopen() function : variation: opening a plain file --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzopen_variation9.phpt b/ext/zlib/tests/gzopen_variation9.phpt index 91e2a4297657f..b8b895a92d524 100644 --- a/ext/zlib/tests/gzopen_variation9.phpt +++ b/ext/zlib/tests/gzopen_variation9.phpt @@ -3,7 +3,7 @@ Test gzopen() function : variation: try opening with possibly invalid modes --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzpassthru_basic.phpt b/ext/zlib/tests/gzpassthru_basic.phpt index 5606114bc3d8b..4ca2780b41355 100644 --- a/ext/zlib/tests/gzpassthru_basic.phpt +++ b/ext/zlib/tests/gzpassthru_basic.phpt @@ -3,7 +3,7 @@ Test function gzpassthru() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzputs_basic.phpt b/ext/zlib/tests/gzputs_basic.phpt index e1414d2504e55..6fd4d0748de63 100644 --- a/ext/zlib/tests/gzputs_basic.phpt +++ b/ext/zlib/tests/gzputs_basic.phpt @@ -3,7 +3,7 @@ Test function gzputs() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzread_basic.phpt b/ext/zlib/tests/gzread_basic.phpt index 1b66d85fc10cc..356eb2c845049 100644 --- a/ext/zlib/tests/gzread_basic.phpt +++ b/ext/zlib/tests/gzread_basic.phpt @@ -3,7 +3,7 @@ Test function gzread() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzread_error2.phpt b/ext/zlib/tests/gzread_error2.phpt index ff0dfe80289fe..0b4c4d13fcbc6 100644 --- a/ext/zlib/tests/gzread_error2.phpt +++ b/ext/zlib/tests/gzread_error2.phpt @@ -3,7 +3,7 @@ Test function gzread() by calling it invalid lengths --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzread_variation1.phpt b/ext/zlib/tests/gzread_variation1.phpt index bc9eee4f94681..f5968e28ad233 100644 --- a/ext/zlib/tests/gzread_variation1.phpt +++ b/ext/zlib/tests/gzread_variation1.phpt @@ -3,7 +3,7 @@ Test function gzread() by calling it while file open for writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzrewind_basic.phpt b/ext/zlib/tests/gzrewind_basic.phpt index 988e10a36622e..ffed16d4e9167 100644 --- a/ext/zlib/tests/gzrewind_basic.phpt +++ b/ext/zlib/tests/gzrewind_basic.phpt @@ -3,7 +3,7 @@ Test function gzrewind() by calling it with its expected arguments when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzrewind_basic2.phpt b/ext/zlib/tests/gzrewind_basic2.phpt index d1a2d296fc33d..1522750c5ba21 100644 --- a/ext/zlib/tests/gzrewind_basic2.phpt +++ b/ext/zlib/tests/gzrewind_basic2.phpt @@ -3,7 +3,7 @@ Test function gzrewind() by calling it with its expected arguments when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzrewind_variation1.phpt b/ext/zlib/tests/gzrewind_variation1.phpt index 1704771679e77..0b2053993d96a 100644 --- a/ext/zlib/tests/gzrewind_variation1.phpt +++ b/ext/zlib/tests/gzrewind_variation1.phpt @@ -3,7 +3,7 @@ Test function gzrewind() by calling it with its expected arguments when writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_basic.phpt b/ext/zlib/tests/gzseek_basic.phpt index 2cc13595591eb..9a835f8df5b3c 100644 --- a/ext/zlib/tests/gzseek_basic.phpt +++ b/ext/zlib/tests/gzseek_basic.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with its expected arguments when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_basic2.phpt b/ext/zlib/tests/gzseek_basic2.phpt index a463d607f1815..c9d60ebcfd3a7 100644 --- a/ext/zlib/tests/gzseek_basic2.phpt +++ b/ext/zlib/tests/gzseek_basic2.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with its expected arguments when writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation1.phpt b/ext/zlib/tests/gzseek_variation1.phpt index 81fe035987915..e5dcefc9bb065 100644 --- a/ext/zlib/tests/gzseek_variation1.phpt +++ b/ext/zlib/tests/gzseek_variation1.phpt @@ -3,7 +3,7 @@ Test function gzseek() by seeking forward in write mode --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation2.phpt b/ext/zlib/tests/gzseek_variation2.phpt index 56b4fa9ec132d..50ad28f36fea1 100644 --- a/ext/zlib/tests/gzseek_variation2.phpt +++ b/ext/zlib/tests/gzseek_variation2.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with SEEK_SET when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation3.phpt b/ext/zlib/tests/gzseek_variation3.phpt index 77e0e33e019d6..0ba9eb68eaf0d 100644 --- a/ext/zlib/tests/gzseek_variation3.phpt +++ b/ext/zlib/tests/gzseek_variation3.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with SEEK_CUR when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation4.phpt b/ext/zlib/tests/gzseek_variation4.phpt index 09e38cd33d6da..2850efa7d64c8 100644 --- a/ext/zlib/tests/gzseek_variation4.phpt +++ b/ext/zlib/tests/gzseek_variation4.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with SEEK_SET when writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation5.phpt b/ext/zlib/tests/gzseek_variation5.phpt index e59a3fb88d7ba..41d5c777a6883 100644 --- a/ext/zlib/tests/gzseek_variation5.phpt +++ b/ext/zlib/tests/gzseek_variation5.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with SEEK_CUR when writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation6.phpt b/ext/zlib/tests/gzseek_variation6.phpt index e7f49f5fd72f8..1c2e6de562ba7 100644 --- a/ext/zlib/tests/gzseek_variation6.phpt +++ b/ext/zlib/tests/gzseek_variation6.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with SEEK_END when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzseek_variation7.phpt b/ext/zlib/tests/gzseek_variation7.phpt index 67c0ecf074db9..1198e56ced57b 100644 --- a/ext/zlib/tests/gzseek_variation7.phpt +++ b/ext/zlib/tests/gzseek_variation7.phpt @@ -3,7 +3,7 @@ Test function gzseek() by calling it with SEEK_END when writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gztell_basic.phpt b/ext/zlib/tests/gztell_basic.phpt index acd0829360bb8..063bae63bb6a2 100644 --- a/ext/zlib/tests/gztell_basic.phpt +++ b/ext/zlib/tests/gztell_basic.phpt @@ -3,7 +3,7 @@ Test function gztell() by calling it with its expected arguments when reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gztell_basic2.phpt b/ext/zlib/tests/gztell_basic2.phpt index 13ac183d46519..b9d9eb083738d 100644 --- a/ext/zlib/tests/gztell_basic2.phpt +++ b/ext/zlib/tests/gztell_basic2.phpt @@ -3,7 +3,7 @@ Test function gztell() by calling it with its expected arguments when writing --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzuncompress_basic1.phpt b/ext/zlib/tests/gzuncompress_basic1.phpt index d82d7069e3a2d..c46e8b35ebd99 100644 --- a/ext/zlib/tests/gzuncompress_basic1.phpt +++ b/ext/zlib/tests/gzuncompress_basic1.phpt @@ -3,7 +3,7 @@ Test gzuncompress() function : basic functionality --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzuncompress_error1.phpt b/ext/zlib/tests/gzuncompress_error1.phpt index 5390cce93832d..a93de5b054b18 100644 --- a/ext/zlib/tests/gzuncompress_error1.phpt +++ b/ext/zlib/tests/gzuncompress_error1.phpt @@ -3,7 +3,7 @@ Test gzuncompress() function : error conditions --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzwrite_basic.phpt b/ext/zlib/tests/gzwrite_basic.phpt index bdea57deff856..699b2f49937d2 100644 --- a/ext/zlib/tests/gzwrite_basic.phpt +++ b/ext/zlib/tests/gzwrite_basic.phpt @@ -3,7 +3,7 @@ Test function gzwrite() by calling it with its expected arguments --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzwrite_error2.phpt b/ext/zlib/tests/gzwrite_error2.phpt index a4e4fa4958d6a..009cb4d7d28d8 100644 --- a/ext/zlib/tests/gzwrite_error2.phpt +++ b/ext/zlib/tests/gzwrite_error2.phpt @@ -3,7 +3,7 @@ Test function gzwrite() by calling it invalid lengths --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/gzwrite_variation1.phpt b/ext/zlib/tests/gzwrite_variation1.phpt index 563702e4bdcc5..540a87985a109 100644 --- a/ext/zlib/tests/gzwrite_variation1.phpt +++ b/ext/zlib/tests/gzwrite_variation1.phpt @@ -3,7 +3,7 @@ Test function gzwrite() by calling it when file is opened for reading --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/readgzfile_variation15.phpt b/ext/zlib/tests/readgzfile_variation15.phpt index 1a96fdb429090..749087f6ce66e 100644 --- a/ext/zlib/tests/readgzfile_variation15.phpt +++ b/ext/zlib/tests/readgzfile_variation15.phpt @@ -3,7 +3,7 @@ Test readgzfile() function : variation: use include path (relative directories i --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_copy_basic.phpt b/ext/zlib/tests/zlib_scheme_copy_basic.phpt index 5a35164cf1c9c..9c6becb4c75f9 100644 --- a/ext/zlib/tests/zlib_scheme_copy_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_copy_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the copy function: compressed to compressed --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_copy_variation1.phpt b/ext/zlib/tests/zlib_scheme_copy_variation1.phpt index a5e145faa3fcc..c96e2bee290be 100644 --- a/ext/zlib/tests/zlib_scheme_copy_variation1.phpt +++ b/ext/zlib/tests/zlib_scheme_copy_variation1.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the copy function: compressed to uncompressed --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_copy_variation2.phpt b/ext/zlib/tests/zlib_scheme_copy_variation2.phpt index 8492862892a27..829351846bce5 100644 --- a/ext/zlib/tests/zlib_scheme_copy_variation2.phpt +++ b/ext/zlib/tests/zlib_scheme_copy_variation2.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the copy function: uncompressed to compressed --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_dir_basic.phpt b/ext/zlib/tests/zlib_scheme_dir_basic.phpt index f0e155e899366..014243d5749f2 100644 --- a/ext/zlib/tests/zlib_scheme_dir_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_dir_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the directory functions --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_file_basic.phpt b/ext/zlib/tests/zlib_scheme_file_basic.phpt index 5d73cf16c2944..cb697f44f0718 100644 --- a/ext/zlib/tests/zlib_scheme_file_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_file_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the file --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt b/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt index b02a1bffe98c6..615d3c5d25ecb 100644 --- a/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the file_get_contents --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt b/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt index 51a52c9808efc..7ed77b36b3381 100644 --- a/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the file_get_contents --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt b/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt index 007a4a50229e2..73047310214e7 100644 --- a/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the file_get_contents --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_fopen_basic.phpt b/ext/zlib/tests/zlib_scheme_fopen_basic.phpt index c6508deaa047b..e8c6492024f5f 100644 --- a/ext/zlib/tests/zlib_scheme_fopen_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_fopen_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the fopen --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt b/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt index 8bed54ebaa7c6..093b137c6e7d1 100644 --- a/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt +++ b/ext/zlib/tests/zlib_scheme_fopen_variation1.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the fopen on a file scheme --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_rename_basic.phpt b/ext/zlib/tests/zlib_scheme_rename_basic.phpt index b58a09f89e26b..e67970d332cfd 100644 --- a/ext/zlib/tests/zlib_scheme_rename_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_rename_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the unlink function --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_stat_basic.phpt b/ext/zlib/tests/zlib_scheme_stat_basic.phpt index 31d08866ba307..fa48454db523c 100644 --- a/ext/zlib/tests/zlib_scheme_stat_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_stat_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the unlink function --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_stat_basic2.phpt b/ext/zlib/tests/zlib_scheme_stat_basic2.phpt index 23c59f8ff3ea4..c2cfca723a91e 100644 --- a/ext/zlib/tests/zlib_scheme_stat_basic2.phpt +++ b/ext/zlib/tests/zlib_scheme_stat_basic2.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the unlink function --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_scheme_unlink_basic.phpt b/ext/zlib/tests/zlib_scheme_unlink_basic.phpt index ca21637ed104a..c5c4eabb466ef 100644 --- a/ext/zlib/tests/zlib_scheme_unlink_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_unlink_basic.phpt @@ -3,7 +3,7 @@ Test compress.zlib:// scheme with the unlink function --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt b/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt index 6911aabe69e8d..54d0e37860d5d 100644 --- a/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt @@ -3,7 +3,7 @@ Test function fflush() on a zlib stream wrapper --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_wrapper_flock_basic.phpt b/ext/zlib/tests/zlib_wrapper_flock_basic.phpt index 41c651c50f991..6d3f9d6237920 100644 --- a/ext/zlib/tests/zlib_wrapper_flock_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_flock_basic.phpt @@ -3,7 +3,7 @@ Test function stream_get_meta_data on a zlib stream --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt b/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt index 20af263e5a038..eaa9a124db483 100644 --- a/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_fstat_basic.phpt @@ -3,7 +3,7 @@ Test function fstat() on zlib wrapper --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt index 2ace80d21cd9a..07b3917213d8b 100644 --- a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt @@ -3,7 +3,7 @@ Test function ftruncate() on zlib wrapper by calling it with its expected argume --SKIPIF-- --FILE-- diff --git a/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt b/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt index 8476b2923a0c2..815854b21e1a5 100644 --- a/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt @@ -3,7 +3,7 @@ Test function stream_get_meta_data on a zlib stream --SKIPIF-- --FILE-- diff --git a/main/main.c b/main/main.c index 103c10a06b241..3667432f94a5f 100644 --- a/main/main.c +++ b/main/main.c @@ -72,6 +72,7 @@ #include "zend_ini.h" #include "zend_dtrace.h" #include "zend_observer.h" +#include "zend_system_id.h" #include "php_content_types.h" #include "php_ticks.h" @@ -2194,6 +2195,9 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod zend_set_utility_values(&zuv); php_startup_sapi_content_types(); + /* Begin to fingerprint the process state */ + zend_startup_system_id(); + /* startup extensions statically compiled in */ if (php_register_internal_extensions_func() == FAILURE) { php_printf("Unable to start builtin modules\n"); @@ -2237,6 +2241,9 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod module->info_func = PHP_MINFO(php_core); } + /* Extensions that add engine hooks after this point do so at their own peril */ + zend_finalize_system_id(); + module_initialized = 1; if (zend_post_startup() != SUCCESS) { diff --git a/main/output.c b/main/output.c index aab080ba01090..c895d3856e441 100644 --- a/main/output.c +++ b/main/output.c @@ -1507,11 +1507,11 @@ PHP_FUNCTION(ob_implicit_flush) { zend_long flag = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &flag) == FAILURE) { RETURN_THROWS(); } - php_output_set_implicit_flush(flag); + php_output_set_implicit_flush((int) flag); } /* }}} */ diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 1a601e69063d9..e7d29450ee8b2 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -224,7 +224,7 @@ PHP_FUNCTION(apache_note) size_t note_name_len, note_val_len; char *old_note_val=NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { RETURN_THROWS(); } diff --git a/sapi/apache2handler/php_functions.stub.php b/sapi/apache2handler/php_functions.stub.php index 391600be6ca60..93955c7181a0d 100644 --- a/sapi/apache2handler/php_functions.stub.php +++ b/sapi/apache2handler/php_functions.stub.php @@ -13,7 +13,7 @@ function getallheaders(): array {} function apache_response_headers(): array {} -function apache_note(string $note_name, string $note_value = UNKNOWN): string|false {} +function apache_note(string $note_name, ?string $note_value = null): string|false {} function apache_setenv(string $variable, string $value, bool $walk_to_top = false): bool {} diff --git a/sapi/apache2handler/php_functions_arginfo.h b/sapi/apache2handler/php_functions_arginfo.h index 83dae8c6ef9b0..a712ce590c5bd 100644 --- a/sapi/apache2handler/php_functions_arginfo.h +++ b/sapi/apache2handler/php_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3226aed29f13aa8146066a88e58ac2147ad8b500 */ + * Stub hash: 2e2e63b5c845bb74309b2b3e52ca5a3d76f2c80b */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_apache_lookup_uri, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -18,7 +18,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_apache_note, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, note_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, note_value, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, note_value, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_apache_setenv, 0, 2, _IS_BOOL, 0) diff --git a/sapi/cgi/tests/003.phpt b/sapi/cgi/tests/003.phpt index 00c59c72784a0..ac3f6aa8e6386 100644 --- a/sapi/cgi/tests/003.phpt +++ b/sapi/cgi/tests/003.phpt @@ -4,7 +4,7 @@ strip comments and whitespace with -w 65535) { + /* Invalid port */ + return NULL; + } + + /* Full [hostOrIP]:port provided */ + *pport = (int)port; + return pestrndup(start, end - start, 1); + } + + end = strchr(addr, ':'); + if (!end) { + /* Missing port */ + return NULL; + } + + port = strtol(end + 1, (char**)&p, 10); + if (p && *p) { + /* Non-numeric port */ + return NULL; + } + if (port < 0 || port > 65535) { + /* Invalid port */ + return NULL; + } + *pport = (int)port; + return pestrndup(addr, end - addr, 1); +} + static int php_cli_server_ctor(php_cli_server *server, const char *addr, const char *document_root, const char *router) /* {{{ */ { int retval = SUCCESS; @@ -2363,40 +2422,9 @@ static int php_cli_server_ctor(php_cli_server *server, const char *addr, const c int err = 0; int port = 3000; php_socket_t server_sock = SOCK_ERR; - char *p = NULL; - if (addr[0] == '[') { - host = pestrdup(addr + 1, 1); - if (!host) { - return FAILURE; - } - p = strchr(host, ']'); - if (p) { - *p++ = '\0'; - if (*p == ':') { - port = strtol(p + 1, &p, 10); - if (port <= 0 || port > 65535) { - p = NULL; - } - } else if (*p != '\0') { - p = NULL; - } - } - } else { - host = pestrdup(addr, 1); - if (!host) { - return FAILURE; - } - p = strchr(host, ':'); - if (p) { - *p++ = '\0'; - port = strtol(p, &p, 10); - if (port <= 0 || port > 65535) { - p = NULL; - } - } - } - if (!p) { + host = php_cli_server_parse_addr(addr, &port); + if (!host) { fprintf(stderr, "Invalid address: %s\n", addr); retval = FAILURE; goto out; @@ -2720,10 +2748,12 @@ int do_cli_server(int argc, char **argv) /* {{{ */ sapi_module.phpinfo_as_text = 0; { + zend_bool ipv6 = strchr(server.host, ':'); php_cli_server_logf( PHP_CLI_SERVER_LOG_PROCESS, - "PHP %s Development Server (http://%s) started", - PHP_VERSION, server_bind_address); + "PHP %s Development Server (http://%s%s%s:%d) started", + PHP_VERSION, ipv6 ? "[" : "", server.host, + ipv6 ? "]" : "", server.port); } #if defined(SIGINT) diff --git a/sapi/cli/tests/002-unix.phpt b/sapi/cli/tests/002-unix.phpt index 2be668f18884c..8eb4e47b6e166 100644 --- a/sapi/cli/tests/002-unix.phpt +++ b/sapi/cli/tests/002-unix.phpt @@ -4,7 +4,7 @@ running code with -r --FILE-- diff --git a/sapi/cli/tests/003-2.phpt b/sapi/cli/tests/003-2.phpt index 71ef7163bef39..3a88b2a9a3aa1 100644 --- a/sapi/cli/tests/003-2.phpt +++ b/sapi/cli/tests/003-2.phpt @@ -4,7 +4,7 @@ defining INI options with -d (as 2nd arg) --FILE-- diff --git a/sapi/cli/tests/003.phpt b/sapi/cli/tests/003.phpt index 6584e2c7bef21..63e812d4a7cd7 100644 --- a/sapi/cli/tests/003.phpt +++ b/sapi/cli/tests/003.phpt @@ -4,7 +4,7 @@ defining INI options with -d --FILE-- diff --git a/sapi/cli/tests/006.phpt b/sapi/cli/tests/006.phpt index f3443b7475e64..77a5667bda82f 100644 --- a/sapi/cli/tests/006.phpt +++ b/sapi/cli/tests/006.phpt @@ -4,10 +4,10 @@ show information about extension --INI-- diff --git a/sapi/cli/tests/007.phpt b/sapi/cli/tests/007.phpt index 94ea6fd247457..73faa334237cf 100644 --- a/sapi/cli/tests/007.phpt +++ b/sapi/cli/tests/007.phpt @@ -4,7 +4,7 @@ strip comments and whitespace with -w --FILE-- diff --git a/sapi/cli/tests/008.phpt b/sapi/cli/tests/008.phpt index c96170d4979b6..c3acf6b86330d 100644 --- a/sapi/cli/tests/008.phpt +++ b/sapi/cli/tests/008.phpt @@ -4,7 +4,7 @@ execute a file with -f --FILE-- diff --git a/sapi/cli/tests/010-2.phpt b/sapi/cli/tests/010-2.phpt index af998351bb76c..1780c3ffd6226 100644 --- a/sapi/cli/tests/010-2.phpt +++ b/sapi/cli/tests/010-2.phpt @@ -4,7 +4,7 @@ executing a code with -R --FILE-- diff --git a/sapi/cli/tests/010.phpt b/sapi/cli/tests/010.phpt index 01b35991369e1..d06007bd55e98 100644 --- a/sapi/cli/tests/010.phpt +++ b/sapi/cli/tests/010.phpt @@ -4,7 +4,7 @@ executing a file with -F --FILE-- diff --git a/sapi/cli/tests/013.phpt b/sapi/cli/tests/013.phpt index 3ca2ba833caa9..0684b8d0573cf 100644 --- a/sapi/cli/tests/013.phpt +++ b/sapi/cli/tests/013.phpt @@ -4,7 +4,7 @@ running PHP code before and after processing input lines with -B and -E --FILE-- diff --git a/sapi/cli/tests/015.phpt b/sapi/cli/tests/015.phpt index 5a5e6c5190d25..b64a5f0d50fae 100644 --- a/sapi/cli/tests/015.phpt +++ b/sapi/cli/tests/015.phpt @@ -4,7 +4,7 @@ CLI long options --FILE-- diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt index bbba579ec2b24..bf23affe818e9 100644 --- a/sapi/cli/tests/016.phpt +++ b/sapi/cli/tests/016.phpt @@ -4,7 +4,7 @@ CLI -a and readline --FILE-- diff --git a/sapi/cli/tests/017.phpt b/sapi/cli/tests/017.phpt index 6c9a792476737..344daa7408b59 100644 --- a/sapi/cli/tests/017.phpt +++ b/sapi/cli/tests/017.phpt @@ -4,7 +4,7 @@ CLI -a and libedit --FILE-- diff --git a/sapi/cli/tests/019.phpt b/sapi/cli/tests/019.phpt index 2b8c0f007ecbc..e8404d835e5e7 100644 --- a/sapi/cli/tests/019.phpt +++ b/sapi/cli/tests/019.phpt @@ -4,7 +4,7 @@ CLI php -i --FILE-- diff --git a/sapi/cli/tests/020.phpt b/sapi/cli/tests/020.phpt index 001cf62a3836d..fb7bcb4e7b5f6 100644 --- a/sapi/cli/tests/020.phpt +++ b/sapi/cli/tests/020.phpt @@ -4,7 +4,7 @@ CLI php --ri --FILE-- diff --git a/sapi/cli/tests/021.phpt b/sapi/cli/tests/021.phpt index a5d97c326d563..837f64109d03d 100644 --- a/sapi/cli/tests/021.phpt +++ b/sapi/cli/tests/021.phpt @@ -4,7 +4,7 @@ CLI shell shebang 127) { diff --git a/sapi/cli/tests/argv_mb_bug77111.phpt b/sapi/cli/tests/argv_mb_bug77111.phpt index a2bae24dc3ead..0ed6204b89d79 100644 --- a/sapi/cli/tests/argv_mb_bug77111.phpt +++ b/sapi/cli/tests/argv_mb_bug77111.phpt @@ -5,12 +5,12 @@ Bug #77111 php-win.exe corrupts unicode symbols from cli parameters include "skipif.inc"; if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { - die("skip this test is for Windows platforms only"); + die("skip this test is for Windows platforms only"); } $php = dirname(getenv('TEST_PHP_EXECUTABLE')) . DIRECTORY_SEPARATOR . "php-win.exe"; if (!file_exists($php)) { - die("skip php-win.exe doesn't exist"); + die("skip php-win.exe doesn't exist"); } ?> diff --git a/sapi/cli/tests/bug44564.phpt b/sapi/cli/tests/bug44564.phpt index 7dca62a7e8e9f..6ef5b9f9507f9 100644 --- a/sapi/cli/tests/bug44564.phpt +++ b/sapi/cli/tests/bug44564.phpt @@ -3,7 +3,7 @@ Bug #44564 (escapeshellarg removes UTF-8 multi-byte characters) --SKIPIF-- --FILE-- diff --git a/sapi/cli/tests/bug64529.phpt b/sapi/cli/tests/bug64529.phpt index ff3e3029e63db..7350cd2046169 100644 --- a/sapi/cli/tests/bug64529.phpt +++ b/sapi/cli/tests/bug64529.phpt @@ -3,14 +3,14 @@ Bug #64529 (Ran out of opcode space) --SKIPIF-- --FILE-- diff --git a/sapi/cli/tests/bug64544.phpt b/sapi/cli/tests/bug64544.phpt index 33a6e16a10c8d..87e8eda64ae0f 100644 --- a/sapi/cli/tests/bug64544.phpt +++ b/sapi/cli/tests/bug64544.phpt @@ -3,7 +3,7 @@ Bug #64544 (Valgrind warnings after using putenv) --SKIPIF-- --FILE-- diff --git a/sapi/cli/tests/bug65275.inc b/sapi/cli/tests/bug65275.inc index 6b8a2ad948e56..addc026322dc5 100644 --- a/sapi/cli/tests/bug65275.inc +++ b/sapi/cli/tests/bug65275.inc @@ -1,7 +1,7 @@ =8"); + die("skip need PHP_INT_SIZE>=8"); } if (disk_free_space(sys_get_temp_dir()) < 2300000000) { - die("skip need more than 2.15G of free disk space for the uploaded file"); + die("skip need more than 2.15G of free disk space for the uploaded file"); } if (!file_exists('/proc/meminfo')) { - die('skip Cannot check free RAM from /proc/meminfo on this platform'); + die('skip Cannot check free RAM from /proc/meminfo on this platform'); } $free_ram = 0; if ($f = fopen("/proc/meminfo","r")) { - while (!feof($f)) { - if (preg_match('/MemFree[^\d]*(\d+)/i', fgets($f), $m)) { - $free_ram = max($free_ram, $m[1]/1024/1024); - if ($free_ram > 3) { - $enough_free_ram = true; - } - } - } + while (!feof($f)) { + if (preg_match('/MemFree[^\d]*(\d+)/i', fgets($f), $m)) { + $free_ram = max($free_ram, $m[1]/1024/1024); + if ($free_ram > 3) { + $enough_free_ram = true; + } + } + } } if (empty($enough_free_ram)) { - die(sprintf("skip need +3G free RAM, but only %01.2f available", $free_ram)); + die(sprintf("skip need +3G free RAM, but only %01.2f available", $free_ram)); } if (getenv('TRAVIS')) { diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 4629f94986fcf..54d06a84c7703 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -482,7 +482,8 @@ static zend_always_inline zend_bool phpdbg_is_ignored_opcode(zend_uchar opcode) || opcode == ZEND_DECLARE_CONST || opcode == ZEND_DECLARE_CLASS || opcode == ZEND_DECLARE_FUNCTION || opcode == ZEND_DECLARE_CLASS_DELAYED || opcode == ZEND_DECLARE_ANON_CLASS || opcode == ZEND_FAST_RET || opcode == ZEND_TICKS - || opcode == ZEND_EXT_STMT || opcode == ZEND_EXT_FCALL_BEGIN || opcode == ZEND_EXT_FCALL_END || opcode == ZEND_EXT_NOP || opcode == ZEND_BIND_GLOBAL + || opcode == ZEND_EXT_STMT || opcode == ZEND_EXT_FCALL_BEGIN || opcode == ZEND_EXT_FCALL_END + || opcode == ZEND_BIND_GLOBAL ; } diff --git a/scripts/dev/tidy.php b/scripts/dev/tidy.php index 3829f9092ec23..7ec9f7902d662 100644 --- a/scripts/dev/tidy.php +++ b/scripts/dev/tidy.php @@ -117,7 +117,7 @@ function transformTestCode(string $code, callable $transformer): string { } return preg_replace_callback( - '/(--FILE--)(.+?)(--[A-Z_]+--)/s', + '/(--(?:FILE|SKIPIF|CLEAN)--)(.+?)(--[A-Z_]+--)/s', function(array $matches) use($transformer) { return $matches[1] . $transformer($matches[2]) . $matches[3]; }, diff --git a/tests/classes/autoload_001.phpt b/tests/classes/autoload_001.phpt index cdea16f689bb7..7fe6757d6859e 100644 --- a/tests/classes/autoload_001.phpt +++ b/tests/classes/autoload_001.phpt @@ -2,7 +2,7 @@ ZE2 Autoload and class_exists --SKIPIF-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- diff --git a/tests/lang/bug30638.phpt b/tests/lang/bug30638.phpt index 24e6609498c21..3eb2c35241442 100644 --- a/tests/lang/bug30638.phpt +++ b/tests/lang/bug30638.phpt @@ -3,7 +3,7 @@ Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X --SKIPIF-- = 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt index 86cf631110c2d..94e692d01f292 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ --SKIPIF-- = 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt index 4c0f5f9909937..11caa432d13e9 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ --SKIPIF-- = 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt index 01efb3bb4e36f..fc0429c4b0505 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ --SKIPIF-- = 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt index 09d3d8f0be40e..ee34be988b0d9 100644 --- a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT --SKIPIF-- = 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winko_out.phpt b/tests/output/sapi_windows_vt100_support_winko_out.phpt index 65958ae19c1f0..3241ba352abd9 100644 --- a/tests/output/sapi_windows_vt100_support_winko_out.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT --SKIPIF-- = 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winok_err.phpt b/tests/output/sapi_windows_vt100_support_winok_err.phpt index 01a31a6b927e1..4d7543fdda1ae 100644 --- a/tests/output/sapi_windows_vt100_support_winok_err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDERR --SKIPIF-- = 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt index d36d79c8dcbf3..e08d558e25acd 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ --SKIPIF-- = 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt index 16066046510bb..285a72f936366 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ --SKIPIF-- = 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt index f67942f603f7a..a84b36534747d 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ --SKIPIF-- = 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt index ebc6bcb120566..f3f49aa618f46 100644 --- a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT --SKIPIF-- = 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/sapi_windows_vt100_support_winok_out.phpt b/tests/output/sapi_windows_vt100_support_winok_out.phpt index 94a5f20a1bfb9..7fc5ae142b6c3 100644 --- a/tests/output/sapi_windows_vt100_support_winok_out.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT --SKIPIF-- = 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- diff --git a/tests/output/stream_isatty_err.phpt b/tests/output/stream_isatty_err.phpt index e7c10383506d3..c0487392810bd 100644 --- a/tests/output/stream_isatty_err.phpt +++ b/tests/output/stream_isatty_err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDERR --SKIPIF-- --CAPTURE_STDIO-- diff --git a/tests/output/stream_isatty_in-err.phpt b/tests/output/stream_isatty_in-err.phpt index 73514955d43c9..8c10baae8039b 100644 --- a/tests/output/stream_isatty_in-err.phpt +++ b/tests/output/stream_isatty_in-err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDIN/STDERR --SKIPIF-- --CAPTURE_STDIO-- diff --git a/tests/output/stream_isatty_in-out-err.phpt b/tests/output/stream_isatty_in-out-err.phpt index 9b65e8861b86b..851327ead8024 100644 --- a/tests/output/stream_isatty_in-out-err.phpt +++ b/tests/output/stream_isatty_in-out-err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDIN/STDOUT/STDERR --SKIPIF-- --CAPTURE_STDIO-- diff --git a/tests/output/stream_isatty_in-out.phpt b/tests/output/stream_isatty_in-out.phpt index c2bb346854f4f..19fa8552b8b0a 100644 --- a/tests/output/stream_isatty_in-out.phpt +++ b/tests/output/stream_isatty_in-out.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDIN/STDOUT --SKIPIF-- --CAPTURE_STDIO-- diff --git a/tests/output/stream_isatty_out-err.phpt b/tests/output/stream_isatty_out-err.phpt index dc113a972060e..e080810ae8af0 100644 --- a/tests/output/stream_isatty_out-err.phpt +++ b/tests/output/stream_isatty_out-err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDOUT/STDERR --SKIPIF-- --CAPTURE_STDIO-- diff --git a/tests/output/stream_isatty_out.phpt b/tests/output/stream_isatty_out.phpt index f18c986c5abf6..80db5095103dd 100644 --- a/tests/output/stream_isatty_out.phpt +++ b/tests/output/stream_isatty_out.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDOUT --SKIPIF-- --CAPTURE_STDIO-- diff --git a/tests/run-test/bug75042.phpt b/tests/run-test/bug75042.phpt index af3005372bbb7..a7979d6b5ed6e 100644 --- a/tests/run-test/bug75042.phpt +++ b/tests/run-test/bug75042.phpt @@ -4,7 +4,7 @@ phpt EXTENSIONS directive with shared module = 1914) {