Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91239 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92841 invoked from network); 16 Feb 2016 21:13:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2016 21:13:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=ericsten@microsoft.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ericsten@microsoft.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain microsoft.com designates 65.55.169.110 as permitted sender) X-PHP-List-Original-Sender: ericsten@microsoft.com X-Host-Fingerprint: 65.55.169.110 mail-bl2on0110.outbound.protection.outlook.com Received: from [65.55.169.110] ([65.55.169.110:53568] helo=na01-bl2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/21-17120-31193C65 for ; Tue, 16 Feb 2016 16:13:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OgPJP8C4DiXi5iBfcK7hRYcwqr/ApAMCdvsKkZULv4k=; b=hT5+QYe+HpCHSLEpRRg+ka9bXt5qUD6G4UUmg/AIW0FB4v3TiPnorZIGjOJn6fNyiQt+rAhsw3OVJB2kDjESX5gpc+CTecLaQuE/ohZwCfUYplWkPlzsPu1zGE8IZPHf+0zVUJe6g44w+8pi6vN+4G3R87OjDXNBZ4HHArW6l+U= Received: from DM2PR03MB446.namprd03.prod.outlook.com (10.141.85.17) by DM2PR03MB446.namprd03.prod.outlook.com (10.141.85.17) with Microsoft SMTP Server (TLS) id 15.1.403.16; Tue, 16 Feb 2016 21:13:51 +0000 Received: from DM2PR03MB446.namprd03.prod.outlook.com ([10.141.85.17]) by DM2PR03MB446.namprd03.prod.outlook.com ([10.141.85.17]) with mapi id 15.01.0403.019; Tue, 16 Feb 2016 21:13:51 +0000 To: PHP Internals Thread-Topic: PHP5x question related to opcode caching & HashTable entries Thread-Index: AdFo/EB4vou899HoQKC5Yv43fZNfxQ== Date: Tue, 16 Feb 2016 21:13:51 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.php.net; dkim=none (message not signed) header.d=none;lists.php.net; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:1::20f] x-ms-office365-filtering-correlation-id: 7776a286-5e80-4832-8691-08d3371611bc x-microsoft-exchange-diagnostics: 1;DM2PR03MB446;5:AOo6eBcjsb1aHeP/WJVH5LsSBXtb8tTq/IopPEPMgX5MhtIyg/6JMRWCP7KubimtWUXM1yZo+tMkRGzJTAUBF8C0x+HGoaV4LIucYUbZckPg5H/XrQTr0YeyP7lKPJwGqkRWWcdrF+tEgfkuUmMx3Q==;24:OOYdZdMLmcwoYKt2rT4buQncCZHnK3Qzqh1C8JHyUY/2paNvBpnSBh7T72HZRaw8iKzWPekgGupiVRvo57C7icjgnLFoG5TKyO562dXJ90w= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB446; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(61426038)(61427038);SRVR:DM2PR03MB446;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB446; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(77096005)(586003)(5008740100001)(5002640100001)(74316001)(86612001)(50986999)(54356999)(2906002)(86362001)(1096002)(5004730100002)(102836003)(6116002)(1220700001)(450100001)(10290500002)(99286002)(2900100001)(92566002)(10090500001)(76576001)(11100500001)(5001960100002)(110136002)(107886002)(33656002)(189998001)(40100003)(122556002)(229853001)(87936001)(10400500002)(5003600100002)(5005710100001)(32563001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB446;H:DM2PR03MB446.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2016 21:13:51.3404 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB446 Subject: PHP5x question related to opcode caching & HashTable entries From: ericsten@microsoft.com (Eric Stenson) Internals Folks-- I'm investigating a problem in WinCache's opcode caching for PHP5x, and I'm= baffled. =20 Could someone please explain the difference between the two following code = fragments? Specifically, what is the difference in the HashTable and Bucke= t entries in C. /* Assume $values is an empty array, and $defaults is populated via Reflect= ionClass::getDefaultProperties(), and definitely contains an element 'Banan= a'=3D>'some string' */ Fragment 1: foreach ($defaults as $key =3D> $value) { $values["${key}"] =3D $value; /* <--- this line */ } var_dump(isset($values['Banana'])); Fragment 2: foreach ($defaults as $key =3D> $value) { $values[$key] =3D $value; /* <--- this line */ } var_dump(isset($values['Banana'])); For scripts cached in WinCache, Fragment 1 works, but Fragment 2 doesn't wo= rk. I've single-stepped thru zend_isset_isempty_dim_prop_obj_handler_SPEC_= VAR_CONST() in the debugger, both cached and un-cached, and it appears that= the Bucket->h value is incorrect in the Fragment 2 case. WinCache's opcode caching code looks like it can't get this wrong; It shoul= d be faithfully copying the Bucket->h value whenever it caches the opcode a= rray. Any help in understanding the difference in what the Zend Core does with th= e two fragments would be very helpful! Thx! --E.