506f21c4b5
Introducing `ZendParamMode` to as a idl flag. We are not consistent with zend on how they do their params for builtins. We cast to the expected data type. They do some checks, and if the checks don't pass they issue a warning and return (usually) `null`. This diff starts us down that path. I'm introducing the param and using it in the places where we were emulating the calling convention in the `f_foo` functions. I'm going to follow up with converting as many as I can and then eventually this becomes the default. I also want this to be applied to php files in systemlib. Many of the conversions are from https://github.com/php/php-src/blob/master/Zend/zend_API.c#L305
17 linhas
235 B
PHP
17 linhas
235 B
PHP
<?php
|
|
|
|
class A {
|
|
private $count = 0;
|
|
public function __toString() {
|
|
return (string) $this->count++;
|
|
}
|
|
}
|
|
|
|
function main() {
|
|
$a = new A;
|
|
var_dump((string)$a);
|
|
var_dump((string)$a);
|
|
var_dump((string) (new A));
|
|
}
|
|
main();
|