-1

I declare a class like this in php

<?php class Db(){  //something}

php has a class with name DB

when I run this code on linux OS , it works but when run it on windows, return a Fatal error.

Is php class name insensitive? if is insensitive , why run on linux? if is case sensitive , why dose not run on windows?

IT-Life
  • 33
  • 2
  • 5

1 Answers1

0

Don't use PEAR, it time to go with composer if you can., for your issue you can check before defining class, if its exist extend it

if(class_exists('DB') != true)
  {
    class Db extends DB
    ...
    ...
    ... 
  }

or go with Namespace on php 5.3

namespace Core;
class Db {}

to call

\Core\Db::from();

or simply change the name of class

hope it helps

Saqueib
  • 3,484
  • 3
  • 33
  • 56