Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91010 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7678 invoked from network); 29 Jan 2016 10:47:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2016 10:47:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:37046] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/12-24533-7534BA65 for ; Fri, 29 Jan 2016 05:47:52 -0500 Received: by mail-wm0-f53.google.com with SMTP id l66so48738980wml.0 for ; Fri, 29 Jan 2016 02:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=+EMSbUNTMUekBMvdDk6NZxqPHHM6WHFhNtxf/zha2xk=; b=LL+T8b0QhE5smvddGpGHcPVt4Yd2T6L95IiR/VglgB1RihygUyHke1XQiuV4Pyb9of eGddc3E2JuiATMnTx0VAWk6TzwEvnWLvIo/NOFrT/SRXd4cKTQ5lQvNxmtPi2ubCtjYk Ag+PlmON3hPx0BvDVCG41LrCJil4RbyQ/8rMDWXjsi5b5kSkmxdJF5YO1Td6LBreQwaq +rvN9j2//smdH2XM5pZBI7RbL3IsTROf0YO6mKORfsHG+y39JcqtQyOPuBMfcoJF2ah7 8GSY7NRSEyfup/y+JMZXagzpAzpqPuMerSGbuasOBZXXuWH9hp1YxIKJvnRryzgqoK+9 9+zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=+EMSbUNTMUekBMvdDk6NZxqPHHM6WHFhNtxf/zha2xk=; b=FSNA+MCzC3jqt394zh6JFTS/f3zp7ZISd65JCqKHnCmDDvwRZZlDxOWYsr02U0U4X6 zFs+ICt9PO5JxUYwAPcy7je3SuUB2De8wlipOPem7R9I2iFer6Gk4vwlEA8ybmKkkVr5 qvfb0g2fFcCJZ65aD3+4YvKCK5Y7oXg4tr677KMGlTX4shpOBlJTYvjqMtKxrFIRPVT5 z3bCX+xKEhGZNvN15dusFtL+175/AQ0W/ZkKNLP5ymXflEiM9et/H+D7K04bO/8wxvAc 6B3pC4CQuJcI/JRQImRYZNojCGWkL0eDkqNscexhSTUPQQ3M5U3Zl9umgI+QP4r0uD97 zBXA== X-Gm-Message-State: AG10YOSdRGNHLubcmpQm7FtF+oxsgsoeCvDbNUcFgH063hp1fMOQ6OYU2jIIuzJ8pYjLrw== X-Received: by 10.194.119.161 with SMTP id kv1mr8025853wjb.135.1454064468182; Fri, 29 Jan 2016 02:47:48 -0800 (PST) Received: from [192.168.0.150] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id m206sm6883059wmf.16.2016.01.29.02.47.47 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 02:47:47 -0800 (PST) To: internals@lists.php.net References: Message-ID: <56AB42F7.7080403@gmail.com> Date: Fri, 29 Jan 2016 10:46:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] get_class behavior From: rowan.collins@gmail.com (Rowan Collins) Dan Ackroyd wrote on 28/01/2016 22:35: > ## Refactoring if non-objects are no longer allowed. > > Current code: > echo get_class($result); > > Would need to be changed to: > > if ($result === null) { > echo get_class(); > } > else { > echo get_class($result); > } You appear to be suggesting that "get_class()" should behave differently than "get_class(null)". Normally a function doesn't distinguish between "called with no parameters" and "called with default parameters". I don't know if internal parameter handling (ZPP) works like userland parameters in this respect, but if not impossible this would at least be rather surprising. It also doesn't help with your stated point of using get_class as a callable, since you'd have to know what function it was in order to call it in the right way (although exactly what the use case for that would be, I've no idea). Regards, Rowan Collins -- [IMSoP]