php-windows Digest 4 May 2010 13:02:43 -0000 Issue 3802

Topics (messages 30068 through 30069):

Re: serialize/unserialize and 32/64 bit integers
        30068 by: Pierre Joye

how to access class members
        30069 by: Alexander Schunk

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
hi James,

For the record: unlike the waste majority of unices, Windows x64
maximum integer in PHP (which uses the long C type ) is always 32bit,
signed (2^31 +/-).

Are you sure that you get s:10:"2600001234"? Using the latest 5.2 I
got: d:2600001234; (windows)

However, serialize is not supposed to be used to share data across
different hosts as the format can be architecture dependent. I would
suggest to use json instead, if your goal is to share data across
hosts.

Cheers,

On Mon, May 3, 2010 at 10:56 PM, James Crow <ja...@ultratans.com> wrote:
> Hello,
>
>  I am having a problem with unserializing integers with Windows XP/PHP
> 5.2.11. The serialization takes place on a Linux x86_64 host. The values
> then gets passed to the Windows machine that is 32 bit. I think the problem
> is 32/64 bit related. If I serialize a number say 2600001234 on 32 bit
> Windows it becomes s:10:"2600001234". If I do the same from 64 bit Linux it
> becomes i:2600001234.
>  Is there a way to force it to serialize as a string on 64 bit PHP? If it
> matters this is an index of an array.
>
> Thanks,
> James
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--- End Message ---
--- Begin Message ---
Hello,

i have a question:

How to access class members?

I have the following class definition:

class Mitarbeiter{

           public $name = 'meier';
           public $alter = '50';
           public $gehalt = '2000';
           public $abteilung = 'programmierung';

           function printMember(){
              echo 'Name: ' . $this->public;
              echo 'Alter: ' . $this->public;
              echo 'Gehalt: ' . $this->public;
              echo 'Abteilung: ' . $this->public;
           }
      }

Now i want to access the public member with:

$m = new Mitarbeiter();
$m->printMember();

When calling method printMember() i get an error "cannot access empty
class member".

I dont see why the class members are empty?

Regards
Alexander

--- End Message ---

Reply via email to