1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/Zend/tests/magic_methods/bug46238.phpt
DanielEScherzer d22abca488 Zend/tests: organize some tests with sub directories (5) (#17800)
Second pass through `Zend/tests/bug*` to organize the tests.

Move tests to existing sub directories, and create some new sub directories:
* `ArrayAccess`
* `autoload`
* `clone`
* `serialize` (also covers `unserialize()`)
* `switch`

Work towards GH-15631
2025-02-14 11:49:14 +00:00

121 lines
1.2 KiB
PHP

--TEST--
Bug #46238 (Segmentation fault on static call with empty string method)
--FILE--
<?php
class a {
static function __callStatic($name, $arguments)
{
var_dump(array($name, $arguments));
}
}
$a = 'a';
$b = '';
$a::$b($a);
$a::$b(array());
$a::$b(NULL);
$a::$b(1);
$a::$b();
$b = "\0";
$a::$b($a);
$a::$b(array());
$a::$b(NULL);
$a::$b(1);
$a::$b();
?>
--EXPECT--
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
string(1) "a"
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
array(0) {
}
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
NULL
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
int(1)
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(0) {
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
string(1) "a"
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
array(0) {
}
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
NULL
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(1) {
[0]=>
int(1)
}
}
array(2) {
[0]=>
string(0) ""
[1]=>
array(0) {
}
}