php-curl icon indicating copy to clipboard operation
php-curl copied to clipboard

Change "cURL" to "curl" or "Curl"

Open anlutro opened this issue 10 years ago • 2 comments

Needlessly annoying to type. Obviously a breaking change.

anlutro avatar Jul 14 '15 22:07 anlutro

Why is this a breaking change? Class names and namespaces are case insensitive. And otherwise you could use use anlutro\cURL\cURL as Curl.

mauvm avatar Jul 27 '15 07:07 mauvm

Class names and namespaces are indeed case-insensitive, but composer's autoloader is not.

andreas@oberyn ~/dev/php/test
$ cat composer.json 
{
  "autoload": {
    "psr-4": {
      "Test\\": "src/"
    }
  }
}
andreas@oberyn ~/dev/php/test
$ cat src/Test.php 
<?php
namespace Test;
echo 'loading '.__FILE__."\n";
class Test {}
andreas@oberyn ~/dev/php/test
$ cat test.php 
<?php
require __DIR__.'/vendor/autoload.php';
var_dump(class_exists('test\test'));
var_dump(class_exists('Test\Test'));
andreas@oberyn ~/dev/php/test
$ php test.php 
bool(false)
loading /home/andreas/dev/php/test/src/Test.php
bool(true)

anlutro avatar Jul 27 '15 08:07 anlutro