Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90747 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32418 invoked from network); 20 Jan 2016 22:08:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2016 22:08:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=sean@siobud.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sean@siobud.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain siobud.com designates 104.236.58.159 as permitted sender) X-PHP-List-Original-Sender: sean@siobud.com X-Host-Fingerprint: 104.236.58.159 siobud.com Received: from [104.236.58.159] ([104.236.58.159:51044] helo=siobud.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/17-22511-A5500A65 for ; Wed, 20 Jan 2016 17:08:27 -0500 Received: from SeanLaptop.prodvpn.etsy.com (c-73-8-76-141.hsd1.il.comcast.net [73.8.76.141]) by siobud.com (Postfix) with ESMTPSA id AB6CED78F0; Wed, 20 Jan 2016 22:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=siobud.com; s=mail; t=1453327703; bh=gHy5BJp2E9SezIeGSbzAKFYqwrvQXG6OCCxD4lv/OKY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=lG+K7aho+HP2YmnaZI33Um6itQzSLxDPmoG6bCKLOY/K/XOFdgVpTnPUat3mZ8ndL tXrgbnaHv/fHixkISu5d9PwJ48JCJZJMgADU7/odCPbecoT8ReXKl3hMTQ7vXfOcIM XiO2Nj5TN3vWHo9kUhDNMhyrxRX8CvUv6Q7R+UuE= Date: Wed, 20 Jan 2016 16:07:03 -0600 To: Yasuo Ohgaki Cc: "internals@lists.php.net" Message-ID: <20160120220703.GA16606@SeanLaptop.prodvpn.etsy.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [PHP-DEV] WIKI: phpng-upgrading From: sean@siobud.com (Sean DuBois) On Thu, Jan 21, 2016 at 06:55:41AM +0900, Yasuo Ohgaki wrote: > Hi ZendEngine developers, > > I'm not sure if the wiki page is maintained, but I noticed few errors. > > https://wiki.php.net/phpng-upgrading#strings > has following example. > > - ZVAL_STRING(zv, str, 1); > + ZVAL_STRING(zv, str); > > - ZVAL_STRINGL(zv, str, len, 1); > + ZVAL_STRINGL(zv, str, len); > > - ZVAL_STRING(zv, str, 0); > + ZVAL_STRING(zv, str); > + efree(str); > > - ZVAL_STRINGL(zv, str, len, 0); > + ZVAL_STRINGL(zv, str, len); > + efree(str); > > Since PHP5 has following definition for ZVAL_STRING*() > > #define ZVAL_STRING(z, s, duplicate) do { \ > const char *__s=(s); \ > zval *__z = (z); \ > Z_STRLEN_P(__z) = strlen(__s); \ > Z_STRVAL_P(__z) = (duplicate?estrndup(__s, > Z_STRLEN_P(__z)):(char*)__s);\ > Z_TYPE_P(__z) = IS_STRING; \ > } while (0) > > the example's 0 and 1 are flipped, efree() locations are wrong. > > In https://wiki.php.net/phpng-upgrading#zend_string_api , > it says > > zend_string_init(char *val, int len, int persistent) > > Current definition is > > zend_string_init(char *val, size_t len, int persistent) > > Should I update the doc or is the doc is maintained > elsewhere? > > Regards > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Hi! I tried to get access to that page as well, but didn't have any luck would you mind adding the zend_parse_paramaters changes? 'l' went from 'long' -> 'zend_long' and 's' went from 'int' -> 'size_t'. So many extensions have been ported without this in mind, and it bites in really nasty hard to reproduce runtime ways. thanks!