Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51347 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10338 invoked from network); 24 Jan 2011 19:13:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2011 19:13:52 -0000 Authentication-Results: pb1.pair.com header.from=landeholm@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=landeholm@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: landeholm@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:42399] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/60-07901-F6FCD3D4 for ; Mon, 24 Jan 2011 14:13:51 -0500 Received: by yxt33 with SMTP id 33so1119184yxt.29 for ; Mon, 24 Jan 2011 11:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=EVGsWeTbeXjRGglDi7Pa1PwH+/cA1qjygT25zjS99jk=; b=ES99/7hkz7DJ1x6kTzFurrvX4Tdidcd/P9qt4YLBaph9AZuytvQBUrRwe6HTinKkJe 6Ph1Csxi6seANmZf1h/6N8p/aHYXEmV5hYZdO7kUx/4M6RyAolyGfYKMISvFYuvPSWF9 YBz1gy0NOJ2ToKem1wAHlD9S3cI49msa8Q83o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=epNhHoiIz+lg/j8rVR+KukHzc15qu+Uhw6xqGst8Km6G8d27aiGrCXc/NjC5x5jtur pfDKDFKvZ3Q+YObruDc/GhOmlQjdZeCUmdjoKcmGUHznYCtgcd1Wa0tCYkbl7GubI1gb WX7dAzwKKGQcZZN1n8nN/KcETqcPyaYtn2hvU= MIME-Version: 1.0 Received: by 10.100.5.4 with SMTP id 4mr3161824ane.172.1295896428970; Mon, 24 Jan 2011 11:13:48 -0800 (PST) Received: by 10.101.101.2 with HTTP; Mon, 24 Jan 2011 11:13:48 -0800 (PST) In-Reply-To: References: Date: Mon, 24 Jan 2011 20:13:48 +0100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001485f452265081ec049a9c66c5 Subject: Re: [PHP-DEV] [RFC] Var_export tabbing From: landeholm@gmail.com (Hannes Landeholm) --001485f452265081ec049a9c66c5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable If you're looking into doing something that are both useful and good for learning C, my suggestion is to hack PHP in some way that makes something possible (in PHP) that you couldn't simply accomplish by writing a simple wrapper function or workaround. Making var_export use tabs instead of space= s is easily accomplished by wrapping it in another function that preg_replace= s starting line spaces with tabs. Reading your suggestion, I almost get the feeling that you believe the only reason var_dump doesn't have more arguments (or does this yet) is because nobody thought about it or had time changing it. Changing built in php functions is not A Good Thing=99 in general. Functions should serve a speci= fic purpose, not have a gazillion arbitrary arguments for every possible use case. For just the purpose of just learning C however, go ahead. Sounds like a good start. Hannes On 24 January 2011 19:26, Michael Morris wrote: > I've been trying to think of something that would be a good project to cu= t > my teeth on for a first C project in forever and I'd rather work on > something that might be useful. While cleaning tabbing on a var_export f= or > a test class I think I have an idea. > > What I'm looking for is two things. One, is this the sort of thing that a > beginner to C (not a beginning programmer mind you - I've been doing PHP > scripting for, gosh, 7 years now) can do. If so I'll do this just for th= e > experience of it because I need to learn how to prep patches and the > remainder of the process for more major patches - such as the include sty= le > I RFC'ed earlier. It looks like if it's going to happen I'll have to lear= n > how to do it. > > Anyway, var_export takes 2 arguments - the expression to be converted and > whether to return or echo it. I'd like to add a third, whether to use > spaces (default) or tabs for indentation > > For backwards compatibility null would mean uses spaces, and use 2 per > indentation. If set to true a tab character would be used. > > Thoughts and input appreciated. > --001485f452265081ec049a9c66c5--