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 6536567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:30:31+00:00 2026-05-25T10:30:31+00:00

New to php .I’m working on an old code in which I have to

  • 0

New to php .I’m working on an old code in which I have to add many new features.
The code doesn’t use any object oriented features of php5 right now but I’ll be using them and will try to refactor important and complex old stuff in free time.

I’ve couple of questions :
1. Being someone coming from java background,ability to access outside functions from within a class seems so wrong which I have to do in order to reuse old functions. Is this a right thing to do ?… feels so unnatural to me, is there any better way to reuse old functions ?

2. Can someone suggest some good design patterns that can be used with old php code to make it little object oriented and make it elegantly work with new features.

  • 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-05-25T10:30:31+00:00Added an answer on May 25, 2026 at 10:30 am
    1. Being someone coming from java background,ability to access outside functions from within a class seems so wrong which I have to do in order to reuse old functions

      This has always irked me about Java.

      There is nothing wrong whatsoever with free functions. The mantra that “everything must be in an object in OOP” is complete rubbish; only things that logically fit inside object types should be so.

      So don’t worry about it at all.

    2. Can someone suggest some good design patterns that can be used with old php code to make it little object oriented and make it elegantly work with new features.

      No design pattern is going to do your refactoring for you.

      Design patterns are not magic bullets; the phrase is horribly over-used, and is merely a way to describe oft-used design conventions. Browse through a list of patterns on Wikipedia if you really want, but instead I’d just write your code in the most logical way and if, afterwards, you notice that it happens to conform to someone’s idea of a “design pattern” then… well, good for you I guess!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have old.htm and new.htm on a directory, and I need to load file.php
I am working on a new PHP framework for personal use in future projects,
I have 3 pages: search.html. search.php, and edit.php I also have new.php which I
I am new to PHP and trying to get the following code to work:
I am pretty new to php, but I am learning! I have a simple
I'm new to PHP and have installed on Linux to boot (also a newbie).
I have php 5.2.11 on my server. Should I upgrade to the new PHP
I am new to PHP, so I have a basic question. I have this
I have a new php page and I'm using wordpress for my website. From
EDIT: Yields that there is already new PHP framework written as extension. http://code.google.com/p/yafphp ,

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.