diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-01-30 22:28:17 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-02-03 18:52:57 +0100 |
commit | 162aa1a5fc96b3dd7e3420c6882607b361801fbd (patch) | |
tree | 9c03b8d0a1b41824c92550df2192eef4ec2c4492 /ext/reflection | |
parent | eaeecc523b665cfa856a376b9c55ca7fc9b7b596 (diff) | |
download | php-git-162aa1a5fc96b3dd7e3420c6882607b361801fbd.tar.gz |
Deprecate __autoload()
Diffstat (limited to 'ext/reflection')
-rw-r--r-- | ext/reflection/tests/007.phpt | 7 | ||||
-rw-r--r-- | ext/reflection/tests/bug26640.phpt | 5 | ||||
-rw-r--r-- | ext/reflection/tests/bug29268.phpt | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/ext/reflection/tests/007.phpt b/ext/reflection/tests/007.phpt index d9204171b5..8dfc2e8bcc 100644 --- a/ext/reflection/tests/007.phpt +++ b/ext/reflection/tests/007.phpt @@ -53,10 +53,9 @@ function test($class) echo "\n"; } -function __autoload($class) -{ +spl_autoload_register(function ($class) { echo __FUNCTION__ . "($class)\n"; -} +}); test('Class_does_not_exist'); @@ -94,7 +93,7 @@ test('WithCtorWithArgs'); --EXPECTF-- ====>Class_does_not_exist -__autoload(Class_does_not_exist) +{closure}(Class_does_not_exist) string(41) "Class Class_does_not_exist does not exist" ====>NoCtor ====>newInstance() diff --git a/ext/reflection/tests/bug26640.phpt b/ext/reflection/tests/bug26640.phpt index e375fd4f89..8a93d72247 100644 --- a/ext/reflection/tests/bug26640.phpt +++ b/ext/reflection/tests/bug26640.phpt @@ -3,8 +3,7 @@ Reflection Bug #26640 (__autoload() not invoked by Reflection classes) --FILE-- <?php -function __autoload($c) -{ +spl_autoload_register(function ($c) { class autoload_class { public function __construct() @@ -12,7 +11,7 @@ function __autoload($c) print "autoload success\n"; } } -} +}); $a = new ReflectionClass('autoload_class'); diff --git a/ext/reflection/tests/bug29268.phpt b/ext/reflection/tests/bug29268.phpt index d8efc0b06e..0ab7e332b2 100644 --- a/ext/reflection/tests/bug29268.phpt +++ b/ext/reflection/tests/bug29268.phpt @@ -2,10 +2,10 @@ Reflection Bug #29268 (__autoload() not called with reflectionProperty->getClass()) --FILE-- <?php -function __autoload($classname) { +spl_autoload_register(function ($classname) { echo "__autoload($classname)\n"; eval("class $classname {}"); -} +}); class B{ public function doit(A $a){ |