summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/tests/bug46665.phpt15
-rw-r--r--Zend/tests/bug46665_autoload.php5
2 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/bug46665.phpt b/Zend/tests/bug46665.phpt
new file mode 100644
index 0000000000..994ea8b795
--- /dev/null
+++ b/Zend/tests/bug46665.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #46665 (Triggering autoload with a variable classname causes truncated autoload param)
+--FILE--
+<?php
+
+$baz = '\\Foo\\Bar\\Baz';
+new $baz();
+function __autoload($class) {
+ var_dump($class);
+ require __DIR__ .'/bug46665_autoload.php';
+}
+
+?>
+--EXPECTF--
+%string|unicode%(12) "\Foo\Bar\Baz"
diff --git a/Zend/tests/bug46665_autoload.php b/Zend/tests/bug46665_autoload.php
new file mode 100644
index 0000000000..092b272964
--- /dev/null
+++ b/Zend/tests/bug46665_autoload.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace Foo\Bar;
+class Baz {
+}