Webastor - Programming Tips and Tricks

Programming language => PHP => Topic started by: Martin on November 17, 2016, 07:04:54 PM

Title: How do I return value from method (int, char) in PHP?
Post by: Martin on November 17, 2016, 07:04:54 PM
Hello, I would like to submit a question about the theme, how do i return value from method (int, char) in php? Thank you for giving me your help as soon as possible.
Title: Re: value from method (int, char) in PHP?
Post by: Emmanuel on January 09, 2018, 06:55:15 PM
Returning a value from a function back to the script involves populating the special, preallocated return_value container. For example, this returns an integer:

PHP_FUNCTION(foo) {
    Z_LVAL_P(return_value) = 99;
    Z_TYPE_P(return_value) = IS_LONG;
}