Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37546 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93439 invoked from network); 8 May 2008 19:27:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 May 2008 19:27:43 -0000 Authentication-Results: pb1.pair.com header.from=steph@zend.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=steph@zend.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain zend.com does not designate 64.97.136.129 as permitted sender) X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 64.97.136.129 smtpout0129.sc1.he.tucows.com Solaris 8 (1) Received: from [64.97.136.129] ([64.97.136.129:59086] helo=n064.sc1.he.tucows.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/B0-23700-D2453284 for ; Thu, 08 May 2008 15:27:42 -0400 Received: from sc1-out02.emaildefenseservice.com (64.97.139.2) by n064.sc1.he.tucows.com (7.2.069.1) id 476977050141AEF0 for internals@lists.php.net; Thu, 8 May 2008 19:27:39 +0000 X-SpamScore: 2 X-Spamcatcher-Summary: 2,0,0,06e386157c028847,722188f96ccd4a13,steph@zend.com,-,RULES_HIT:152:355:379:539:540:541:542:543:567:945:988:989:1000:1155:1156:1260:1308:1309:1313:1314:1345:1437:1461:1515:1516:1518:1535:1541:1575:1587:1594:1676:1711:1730:1747:1764:1766:1792:2073:2075:2078:2379:2393:2559:2562:2693:3352:3622:3636:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:4119:5007:6119:6261:7281:7875:7903,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0, MSF:not bulk,SPF:,MSBL:none,DNSBL:none,TSO:0 X-Spamcatcher-Explanation: Received: from foxbox (host86-130-56-54.range86-130.btcentralplus.com [86.130.56.54]) (Authenticated sender: steph.fox) by sc1-out02.emaildefenseservice.com (Postfix) with ESMTP for ; Thu, 8 May 2008 19:27:38 +0000 (UTC) Message-ID: <021601c8b141$bbf64a50$4001a8c0@foxbox> Reply-To: "Steph Fox" To: "internals" Date: Thu, 8 May 2008 20:28:43 +0100 Organization: Zend Technologies MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0213_01C8B14A.1C3E2470" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: allow_call_time_pass_reference From: steph@zend.com ("Steph Fox") ------=_NextPart_000_0213_01C8B14A.1C3E2470 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit Hi all, Following a long and fairly embarrassing exchange of views with one of my php|architect authors, I finally discovered that allow_call_time_pass_reference is still on by default in PHP_5_3 (d'oh). This makes no sense to me because: - it throws an E_DEPRECATED warning, which nobody will see during development because - it's a PHP_INI_SYSTEM|PHP_INI_PERDIR setting that is switched on by default and - on production sites, where it should be switched off, E_DEPRECATED is fairly likely to go unreported - we've been advising people to switch it off for over 8 years Does anyone have a good reason for keeping it switched on by default in PHP 5.3? Like, would switching it off by default break a lot of existing code, given that most users are a bit beyond PHP 3 now? If not, there's a trivial patch attached for main.c and both php.ini-* files. As an aside, by-ref is actually faster than by-value under Windows in my tests, for small amounts of data. That was what you might call an unexpected result - it definitely isn't the case under *nix, or with very large arrays. - Steph ------=_NextPart_000_0213_01C8B14A.1C3E2470 Content-Type: text/plain; format=flowed; name="by-ref-ini.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="by-ref-ini.txt" Index: php.ini-dist=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/php.ini-dist,v=0A= retrieving revision 1.231.2.10.2.22.2.6=0A= diff -u -r1.231.2.10.2.22.2.6 php.ini-dist=0A= --- php.ini-dist 7 Apr 2008 21:24:04 -0000 1.231.2.10.2.22.2.6=0A= +++ php.ini-dist 8 May 2008 18:45:44 -0000=0A= @@ -164,12 +164,12 @@=0A= ; at function call time. This method is deprecated and is likely to be=0A= ; unsupported in future versions of PHP/Zend. The encouraged method of=0A= ; specifying which arguments should be passed by reference is in the = function=0A= -; declaration. You're encouraged to try and turn this option Off and = make=0A= +; declaration. You're encouraged to try and keep this option Off and = make=0A= ; sure your scripts work properly with it in order to ensure they will = work=0A= ; with future versions of the language (you will receive a warning each = time=0A= ; you use this feature, and the argument will be passed by value = instead of by=0A= ; reference).=0A= -allow_call_time_pass_reference =3D On=0A= +allow_call_time_pass_reference =3D Off=0A= =0A= ;=0A= ; Safe Mode=0A= Index: php.ini-recommended=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/php.ini-recommended,v=0A= retrieving revision 1.179.2.11.2.23.2.6=0A= diff -u -r1.179.2.11.2.23.2.6 php.ini-recommended=0A= --- php.ini-recommended 7 Apr 2008 21:24:04 -0000 1.179.2.11.2.23.2.6=0A= +++ php.ini-recommended 8 May 2008 18:46:09 -0000=0A= @@ -104,10 +104,6 @@=0A= ; are emitted for non-critical errors, but that could be a symptom = of a bigger=0A= ; problem. Most notably, this will cause error messages about the = use=0A= ; of uninitialized variables to be displayed.=0A= -; - allow_call_time_pass_reference =3D Off [Code cleanliness]=0A= -; It's not possible to decide to force a variable to be passed by = reference=0A= -; when calling a function. The PHP 4 style to do this is by making = the=0A= -; function require the relevant argument by reference.=0A= ; - short_open_tag =3D Off [Portability]=0A= ; Using short tags is discouraged when developing code meant for = redistribution=0A= ; since short tags may not be supported on the target server.=0A= @@ -213,7 +209,7 @@=0A= ; at function call time. This method is deprecated and is likely to be=0A= ; unsupported in future versions of PHP/Zend. The encouraged method of=0A= ; specifying which arguments should be passed by reference is in the = function=0A= -; declaration. You're encouraged to try and turn this option Off and = make=0A= +; declaration. You're encouraged to try and keep this option Off and = make=0A= ; sure your scripts work properly with it in order to ensure they will = work=0A= ; with future versions of the language (you will receive a warning each = time=0A= ; you use this feature, and the argument will be passed by value = instead of by=0A= Index: main/main.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/main/main.c,v=0A= retrieving revision 1.640.2.23.2.57.2.21=0A= diff -u -r1.640.2.23.2.57.2.21 main.c=0A= --- main/main.c 22 Mar 2008 12:56:16 -0000 1.640.2.23.2.57.2.21=0A= +++ main/main.c 8 May 2008 18:46:21 -0000=0A= @@ -370,7 +370,7 @@=0A= PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, = NULL, php_ini_color_displayer_cb)=0A= PHP_INI_ENTRY_EX("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, = NULL, php_ini_color_displayer_cb)=0A= =0A= - STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference", "1", = PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, = allow_call_time_pass_reference, zend_compiler_globals, compiler_globals)=0A= + STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference", "0", = PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, = allow_call_time_pass_reference, zend_compiler_globals, compiler_globals)=0A= STD_PHP_INI_BOOLEAN("asp_tags", "0", = PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, asp_tags, = zend_compiler_globals, compiler_globals)=0A= STD_PHP_INI_ENTRY_EX("display_errors", "1", PHP_INI_ALL, = OnUpdateDisplayErrors, display_errors, php_core_globals, core_globals, = display_errors_mode)=0A= STD_PHP_INI_BOOLEAN("display_startup_errors", "0", PHP_INI_ALL, = OnUpdateBool, display_startup_errors, php_core_globals, core_globals)=0A= ------=_NextPart_000_0213_01C8B14A.1C3E2470--