Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97771 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56735 invoked from network); 16 Jan 2017 01:51:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2017 01:51:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.48 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.48 mail-pg0-f48.google.com Received: from [74.125.83.48] ([74.125.83.48:36830] helo=mail-pg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/12-00729-7372C785 for ; Sun, 15 Jan 2017 20:51:52 -0500 Received: by mail-pg0-f48.google.com with SMTP id t6so5580446pgt.3 for ; Sun, 15 Jan 2017 17:51:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=jm26N8XiZbmEt+hJRGksmldHxJi1prHPUjrNtJFh9ZY=; b=ptPbbozXgJwvXE0Dihv/yOqTaD+hI/6em4Kel1EWfImL5WHhShpQ22erGwkKpozvpj B+kHTJRUVasHFTAKZUPWf3oiGNAMZGFJdLYNuK7Bf9Wd/Mi0s6N7IR7/jmQUJH1irpPp zn3VeZSt8vjNqWWkQTSrplpSa4gNMnfGb/pgPM1MQrgix8AnuyxzA+wbkSE5ILAa2P9n Y97f8HeqqVMBg1KT0pLNHdfsE5XBTStGAwzD8fRuiPkSFdqFv8ImRPAu2OBMKNmuYACn EXzS+Oo37ggFtN59lyEsAHKbQAQTLqukfVdf4bVQc3tZNkLqV8ovme9pE9RriGpyc46T VfBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jm26N8XiZbmEt+hJRGksmldHxJi1prHPUjrNtJFh9ZY=; b=ZLMiajIYoTfr2Bt43QyZrOtseMtVwwGjU/cPL7TIaPVXZkNSaDn2ewnJGr91uHHst0 y3R7iQL+J50DTd3sQunZO7s3Wir4SPuKBZuL8IYH1HvjvoP0WnU2cKYL3FL4aRacXcaK YgKQ06ffk2YLozxrbsiuZLt8wpT7tKYMsgC05uYd3ER8KOoYgz3K/YlmTqcbMtZHaoQA 1CKVOrOdlfaYJro4EJibuj+LJoI8S3bEdH2iByIS/cUlX9mAjzmwCqwrtqo05M4zY6XM VqECdGv6Khd8V+MUvhl8m2t9f8tHdqmPTlfr1f2pcvuVLUxhK0ZKaawcLjYr7322PBVm sRow== X-Gm-Message-State: AIkVDXJbORUazWIkVIKGdpHzIcwHwnbNUHdNthO/iWw28hf23I0thekIuTxzxBwF3MG4PQ== X-Received: by 10.84.215.207 with SMTP id g15mr46886883plj.166.1484531508342; Sun, 15 Jan 2017 17:51:48 -0800 (PST) Received: from Stas-Air-1551.local (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id 21sm42879015pfy.4.2017.01.15.17.51.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jan 2017 17:51:47 -0800 (PST) To: Jani Ollikainen , "internals@lists.php.net" References: Message-ID: Date: Sun, 15 Jan 2017 17:51:46 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Exposing jsonSerialize's depth From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > For short the thing is: "We have objects that do dynamic loading and > there might be recursions. We could use recursion depth to decide > when we want to do dynamic loading and when not. > This looks like a hack covering for deficient design. Having objects that look differently depending on hidden parameters without anybody explicitly modifying them is a recipe for very hard to track bugs. I don't think we should encourage this. There are ways to present serialized view of the object (sleep/wakeup, Serializable, etc.) but I don't think depth has anything to do with it. -- Stas Malyshev smalyshev@gmail.com