Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82228 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52527 invoked from network); 9 Feb 2015 06:50:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2015 06:50:12 -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.215.43 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.43 mail-la0-f43.google.com Received: from [209.85.215.43] ([209.85.215.43:33812] helo=mail-la0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/60-50460-0A858D45 for ; Mon, 09 Feb 2015 01:50:08 -0500 Received: by labms9 with SMTP id ms9so11450551lab.1 for ; Sun, 08 Feb 2015 22:50:05 -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=KbEQMInWnfddyiis2RMP1jwyZLxugys3Z1/T8EA25Sk=; b=EYSO/Swq1498ISDpO5kjubKytUVulOLtz1rAyga0OTkxU9viZNXasa24pS/8S6JKgV NaNWUaLlIEPJ95DeSrzL5xFPvw1Eo0tYSX8s3vZ+n+AYWo5ReneGVojWrfwiNDyCdR8G sFD504aSaNFwoZdqeuvsSj/RcWl8BWtT0l9pgNY6AWOjKuTzYJ8CP4D6DXtxG8jOFIg4 2CuLwTuO7QBb5jhqsQTlwkLMESyEeBvHT2jsaUFHrEPv4r/eSj7WQXnGATTXcCSuWmKy mGc5FS3lukymE3eUyCaFf4KAonO5rAB7pGc95RM8viUZPzwkqgv3y6RmMqLNEVE6nObo ZqpQ== X-Gm-Message-State: ALoCoQkfCYpRWAgO3mNleb3SACjipi3TjKK9rvZnDEz7O6lCHIkOQZhMJcYXSlGqOlYoQegjx2uteUBfl/5EkWUThyNNC6LSrDiOBk+YdadTa17sioarPEWkJYq0i1cPksgTwYtCngo2CFjO9o8Yhpfzvw0tZ6knkg== X-Received: by 10.112.218.8 with SMTP id pc8mr14569307lbc.16.1423464604843; Sun, 08 Feb 2015 22:50:04 -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 cb5sm1934335lad.3.2015.02.08.22.50.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 22:50:04 -0800 (PST) Received: by mail-lb0-f177.google.com with SMTP id z11so764605lbi.8 for ; Sun, 08 Feb 2015 22:50:03 -0800 (PST) X-Received: by 10.152.29.66 with SMTP id i2mr14902009lah.64.1423464603327; Sun, 08 Feb 2015 22:50:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.28.193 with HTTP; Sun, 8 Feb 2015 22:49:43 -0800 (PST) In-Reply-To: References: <54D3EE95.2080109@lerdorf.com> Date: Mon, 9 Feb 2015 14:49:43 +0800 Message-ID: To: Jan Ehrhardt Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: Annotated PHP 5->7 extension diff From: laruence@php.net (Xinchen Hui) Hey: On Mon, Feb 9, 2015 at 5:06 AM, Jan Ehrhardt wrote: > Rasmus Lerdorf in php.internals (Thu, 05 Feb 2015 17:28:37 -0500): >>We have had quite a number of changes to the extension API and it >>worries me a little bit how long it will take everyone to get their >>extensions ported. We have UPGRADING.INTERNALS which still needs some >>love, but even if that covered everything it is sometimes hard to match >>a bullet point in a long list of changes to actual code. > > UPGRADING.INTERNALS is far from complete. Take for instance the > substantial changes in zend_hash_index_find(_ptr). Look at > PHP_FUNCTION(dba_list) in dba.c. In PHP 5.6 that is > > if (zend_hash_index_find(&EG(regular_list), i, (void **) &le)==FAILURE) > { > continue; > } > > PHP7: > if ((le = zend_hash_index_find_ptr(&EG(regular_list), i)) == NULL) { > continue; > } > > You'll have to use another macro, with a different number of arguments > and a different false test. There is nothing in UPGRADING.INTERNALS on > this. The info on this change can be found in the Wiki: > https://wiki.php.net/phpng-upgrading > > But the wiki on its turn is not complete either. For instance it still > mentions > > ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, > LE_LINK, le_link, le_plink); > > Since the API cleanup interbase does not compile anymore. The reason is > that the API cleanup brought substantial changes in > ZEND_FETCH_RESOURCE2. I guess this command now must be something like > > ib_link = (ibase_db_link *)zend_fetch_resource2(Z_RES_P(link_arg), > link_id, LE_LINK, le_link, le_plink); > > But this is only an educated guess based on looking at changes in other > extensions. At the moment I am struggling with the PHP7 translation of > this block: these are changes are made recently, I've updated the relates section in that wiki. thanks > > #define GET_MOVIE_RESOURCE(ff_movie_ctx) {\ > zval **_tmp_zval;\ > if (zend_hash_find(Z_OBJPROP_P(getThis()), "ffmpeg_movie",\ > sizeof("ffmpeg_movie"), (void **)&_tmp_zval) == FAILURE) {\ > zend_error(E_WARNING, "Invalid ffmpeg_movie object");\ > RETURN_FALSE;\ > }\ > \ > ZEND_FETCH_RESOURCE2(ff_movie_ctx, ff_movie_context*, _tmp_zval, -1,\ > "ffmpeg_movie", le_ffmpeg_movie, le_ffmpeg_pmovie);\ > }\ > > I have tried a lot of things, but nothing works so far... > > An annotated diff would be very welcome! But more or less complete > documentation as well. > > Jan > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Xinchen Hui @Laruence http://www.laruence.com/