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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:41:12+00:00 2026-05-25T18:41:12+00:00

Do you know of any project that has redefined the native types of PHP

  • 0

Do you know of any project that has redefined the native types of PHP (string, array, ints, floats, bools, etc.) as objects? I’m not sure how feasible it would be but i was just thinking that it would be nice to have the native types as objects.

example:

$Name = new String('Mary had a little lamb.');
print($Name->Length);  //prints 23
print($Name->Replace('/lamb/', 'duck'));  // prints Mary had a little duck.

Would this add to much overhead? Have any thoughts on this?

  • 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-25T18:41:12+00:00Added an answer on May 25, 2026 at 6:41 pm

    There are many, many, many (even native) projects that are aiming at that – thing is: Nobody uses them.

    There are basically two problems:

    • PHP has only limited operator overloading. You can’t overload the + operator. So to sum two number you would need to write $number->add($number2), which isn’t quite intuitive.
    • PHP has loads of predefined functions. One could argue that PHP has the most powerful standard library of all programming languages. But: All those functions return the native types, not the boxed ones. So you would need to write something like $number = new Number(function_returning_number());. This also applies to 3rd party libraries.

    For the first issue there is a PECL extension. It is not bundled with PHP though and is not enabled on normal PHP installations. So you can’t use it for portable applications.

    To solve the second issue, there is an Autoboxing RFC. Maybe it will be implemented, maybe not.

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

Sidebar

Related Questions

Do you know any project/framework in javascript (jquery or anything else) that has nice
Does anyone know of a project / product that has standardized how to access/download
Let's say you have a class library project that has any number of supplemental
I'm developing a commercial software project that has some sensitive JavaScript code. I know
Does anyone know any open source project or adapter for MySQL-AdWhirl? We try to
Hey, I'm really stuck with my project here... I need to know when any
Does any body know how can I use MS_MPI in my VC++ MFC project?
Do you know any library that will help doing that? I would write a
Do you know any controls inherited from the ItemsControl that have horizontal orientation of
Do you know any university which has its C++ course available online? I'm looking

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.