Doc #80397 [Opn]: The documentation on this page is ambiguous about example language

From: Date: Sat, 21 Nov 2020 20:10:41 +0000
Subject: Doc #80397 [Opn]: The documentation on this page is ambiguous about example language
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18144@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80397&edit=1 ID: 80397 Updated by: girgias@php.net Reported by: jacob at jacobthompson dot com Summary: The documentation on this page is ambiguous about example language Status: Open Type: Documentation Problem Package: Documentation problem Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Internals 2 is about the Zend Engine 2 which powered PHP 5, and most of the info is relevant to the early versions of it. More recent internals documentation is best found at https://phpinternalsbook.com and https://www.zend.com/resources/writing-php-extensions Previous Comments: ------------------------------------------------------------------------ [2020-11-21 20:03:53] jacob at jacobthompson dot com Description: ------------ The script example here (https://www.php.net/manual/en/internals2.memory.management.php) fails to mention how to try the example by setting up your own extension with ext_skel.php and adding the function provided in this example. It is also ambiguous about whether the example code is in PHP or c. An experienced developer could probably figure this out with the pointer dereferencing going on, but it would be helpful if the guide was more clear on what language is being used in the examples and how it is integrated into an executable and testable target. Test script: --------------- //The example code that is referenced on the documentation page. ZEND_FUNCTION(zend_leak_bytes) { zend_long leakbytes = 3; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &leakbytes) == FAILURE) { return; } emalloc(leakbytes); } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80397&edit=1

« previous php.doc.bugs (#18144) next »