Get Variable Memory Size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sakthipro
    New Member
    • May 2007
    • 18

    Get Variable Memory Size

    Hi,

    is there any thing available to get the variable size?
    ie.

    $temp="Temp";

    will result 4 bytes.
  • Purple
    Recognized Expert Contributor
    • May 2007
    • 404

    #2
    Hi,

    Would it be rude to ask what you are trying to achieve over and above the question as stated..

    Rgds Purple

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      About the closest thing PHP has to that is var_dump.



      Now I'm curious, too. Whatcha gettin' at?

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Originally posted by pbmods
        About the closest thing PHP has to that is var_dump.



        Now I'm curious, too. Whatcha gettin' at?
        Yea I've been looking for a way to do this all day and I haven't found anything.
        What puzzles me even more is why would you need to do this?

        Comment

        • code green
          Recognized Expert Top Contributor
          • Mar 2007
          • 1726

          #5
          The only possible use in php that I can think of is for writing to files, if there is to be some size limitation. Of course the estimate would be wrong because of the different overhead created by different files.

          Comment

          Working...