note 86215 added to language.oop.magic-functions

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
For protected properties, use "*" and not the class name:

<?php

  // Works:
  class SerializeMe {
     private $myPrivateProperty;
     protected $myProtectedProperty;

     public function __sleep () {
        return array (
            "\0".__CLASS__."\0"."myPrivateProperty",
            "\0*\0"."myProtectedProperty"
        );
     }

  }
?>
----
Server IP: 194.8.30.16
Probable Submitter: 89.180.142.34
----
Manual Page -- http://www.php.net/manual/en/language.oop.magic-functions.php
Edit        -- https://master.php.net/note/edit/86215
Del: integrated  -- https://master.php.net/note/delete/86215/integrated
Del: useless     -- https://master.php.net/note/delete/86215/useless
Del: bad code    -- https://master.php.net/note/delete/86215/bad+code
Del: spam        -- https://master.php.net/note/delete/86215/spam
Del: non-english -- https://master.php.net/note/delete/86215/non-english
Del: in docs     -- https://master.php.net/note/delete/86215/in+docs
Del: other reasons-- https://master.php.net/note/delete/86215
Reject      -- https://master.php.net/note/reject/86215
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.