Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41910 invoked from network); 24 Dec 2014 08:54:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2014 08:54:05 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.217.172 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:49088] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/B0-37394-C2F7A945 for ; Wed, 24 Dec 2014 03:54:05 -0500 Received: by mail-lb0-f172.google.com with SMTP id u10so6576862lbd.17 for ; Wed, 24 Dec 2014 00:54:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=NzixycFr/6xNFKZABVRmA2ztVp8dwyRPF/8NRYuJfhs=; b=C+88EMHBHalZ0koCfURZIlVLucvgAcJOWJrFqbt+UtO994gSrnb0LFaf8eAg5KD2F5 jjPALowwKXRmIMeQn7X402f/H2k+AMaJUTBR5xUwCf1sP7JWxETIXTuQm6iXOsZoli9s yL4xAgVE7P4m0obgKHIYtF3hJeD49585SYUAE9BM9vzgHNq46+BSnyrExckACFx6bJiM lCWkPfyCc8HMSpM3JLyERg6tIf0fezgzCHdDcdaDLEpxaYP7nluTJfNeyrJO2hCJ65BM uxnfT5iSDUR7mwGfrJT3JvjMOzO8ArhbAsd+41DTgiVpmQeDBd/7sGbbIXHWhlo57KBk uNTA== X-Gm-Message-State: ALoCoQmRPgcnl8rx2297zpDV3SjzE7zyL0owGcpnZJbi5q7HnhvYJlf0nDZwGtVihmLPhQF9HFDwb23P0Pt4It66ZPHNXjFD+kpEbnO6GVLrwfZ7fruwZOP/C4KkkPZ6OVyRI1IERwt8wdTSdrZxMNAVrOFelzOwZg== X-Received: by 10.152.44.129 with SMTP id e1mr33205172lam.43.1419411241879; Wed, 24 Dec 2014 00:54:01 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPSA id jf3sm6496410lbc.44.2014.12.24.00.54.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Dec 2014 00:54:00 -0800 (PST) Received: by mail-lb0-f177.google.com with SMTP id b6so6238893lbj.8 for ; Wed, 24 Dec 2014 00:54:00 -0800 (PST) X-Received: by 10.152.21.134 with SMTP id v6mr32944333lae.13.1419411240046; Wed, 24 Dec 2014 00:54:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.64.176 with HTTP; Wed, 24 Dec 2014 00:53:39 -0800 (PST) In-Reply-To: References: <946C1B1D-30B8-4029-A5A1-73D515A017D8@ajf.me> <549A6D5A.6060307@gmail.com> Date: Wed, 24 Dec 2014 16:53:39 +0800 Message-ID: To: Pierre Joye Cc: Stas Malyshev , PHP internals , Andrea Faulds Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] About SUCCESS/FAILURE From: laruence@php.net (Xinchen Hui) On Wed, Dec 24, 2014 at 3:57 PM, Pierre Joye wrote: > > On Dec 24, 2014 2:38 PM, "Stanislav Malyshev" wrote: >> >> Hi! >> >> > But: return 0 and return FAILURE... which is simpler? >> >> It's equally simple to write, but FAILURE of course is way simpler to >> understand when read. > > I totally agree. > > I do not care much about the value of failure or success but I am tired to > have to read the code to see if it is 0, 1, or -1 on failure. > > The kind of uniformization I would like to see for the php internals APIs. > > About the argument for the lack of info in function signature: > > A simple typedef will solve it, for the good: > > status php_foo(); > > Or something along this line. > > Yes, it will mean yet another large set of changes for ext developers. But > at this point, it may be a good time to do it. hmm, okey so, make the functions which use SUCCESS/FAILURE return php_success type? and maybe also typedef php_success php_status? thanks thanks > > Cheers, > Pierre -- Xinchen Hui @Laruence http://www.laruence.com/