Bug #76559 [NEW]: curl_*() fail to fall back to global namespace if called from within a namespac

From: Date: Sun, 01 Jul 2018 15:13:22 +0000
Subject: Bug #76559 [NEW]: curl_*() fail to fall back to global namespace if called from within a namespac
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216059@lists.php.net to get a copy of this message
From:             teo8976 at gmail dot com
Operating system: debian
PHP version:      5.6.36
Package:          cURL related
Bug Type:         Bug
Bug description:curl_*() fail to fall back to global namespace if called from within a namespac

Description:
------------
When you call curl_init() or any other curl_xxx() function from within a
namespace, without prepending a "\" (which you are not supposed to have
to do), you get this stupid error:

Call to undefined function
Whatever\\The\\Current\\NameSpace\\Is\\curl_init()

Test script:
---------------
namespace TestNameSpace;

class TestClass {
  function testMethod() {
    curl_init();
    echo "OK";
  }
}

$t=new TestClass();
$t->testMethod();

Expected result:
----------------
OK

Actual result:
--------------
Call to undefined function TestNameSpace\\curl_reset()

-- 
Edit bug report at https://bugs.php.net/bug.php?id=76559&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76559&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76559&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76559&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76559&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76559&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76559&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76559&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76559&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76559&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76559&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76559&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76559&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76559&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76559&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76559&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76559&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76559&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76559&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76559&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76559&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#216059) next »