Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:00:54+00:00 2026-06-14T05:00:54+00:00

When using the pseudo namespacing pattern of PEAR and Zend, it is common to

  • 0

When using the pseudo namespacing pattern of PEAR and Zend, it is common to come across class heirarchies that look like this:

Zend/
    Db.php
    Db/
        Expr.php

Where DB.php contains a class named Zend_Db and Expr.php contains a class named Zend_Db_Expr. However, when you try to convert the old 5.2 psuedo namespacing into PHP 5.3 namespacing you are presented with a case where a namespace and a class share a name. Since the use operator can import either a namespace or a classname this leads to ambiguity.

Here’s an example of an app I’m working on converting:

App/
    Core.php
    Core/
        Autoloader.php

Here the base directory and namespace are App. In the top level of the name space is a Core class:

namespace App;
class Core { }

In the Core directory are various other core classes, some of which use the main Core. Under the pseudo namespacing pattern, this isn’t a problem. But in the real namespacing pattern it creates this situation:

namespace App\Core;
use App\Core as Core;  // What is this importing?  Namespace or class?

class Autoloader {
    public function __construct(Core $core) {}
}

Is this defined? What is actually imported here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:00:55+00:00Added an answer on June 14, 2026 at 5:00 am

    Simply both. It is not real import, just a hint for compiler, that every encounter of this alias in class related operations should be expanded to this declaration. In php namespace is just part of class so just think of it like this

    $alias = 'Zend_Db';
    $zendDB = new $alias;
    $aliasExpr = $alias . '_Expr';
    $expr = new $aliasExpr;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inserted content using the :before pseudo-element for a class. I was trying
i asked a previous question on this website and it got answered using pseudo
How can I add more space using content pseudo class I am using below
I am using pseudo-code here, but this is in JavaScript. With the most efficient
Is there any class or how to draw windows in console application using pseudo
Possible Duplicate: Manipulating CSS :before and :after pseudo-elements using jQuery I would like to
I'm looking for a method to inspect elements styled using pseudo-classes (such as :hover
I have written my own hadoop program and I can run using pseudo distribute
I am using simple pseudo-selector css functionlity. When I hover over my table-cells, they
I can drop a SqlServer Backup Device using SQL-DMO using the following pseudo-code: SQLDMO.SQLServer2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.