You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal error: Type mixed cannot be marked as nullable since mixed already includes null in $PATH/vendor/datadog/dd-trace/ext/ddtrace.stub.php on line 801
PHP Fatal error: Type mixed cannot be marked as nullable since mixed already includes null in $PATH/vendor/datadog/dd-trace/ext/ddtrace.stub.php on line 811
This can be fixed by changing signature from ?mixed $body = null to mixed $body = null.
Once these errors are fixed, there will be multiple undefined constant errors:
Fatal error: Uncaught Error: Undefined constant "DDTrace\Internal\UNKNOWN" in $PATH/vendor/datadog/dd-trace/ext/ddtrace.stub.php on line 841
Fatal error: Uncaught Error: Undefined constant "UNKNOWN" in $PATH/vendor/datadog/dd-trace/ext/ddtrace.stub.php on line 874
These can be fixed by adding something like that to corresponding namespaces:
const UNKNOWN = 0;
For instance, this would fix the first undefined constant error:
<?php
namespace DDTrace {
const UNKNOWN = 0; // this should fix it
/**
* @var int
* @cvalue DD_TRACE_DBM_PROPAGATION_DISABLED
*/
const DBM_PROPAGATION_DISABLED = UNKNOWN;
....
}
How to reproduce:
Create a test PHP file (eg. test.php) and include the stub file:
These UNKNOWN constants are special placeholders of the arginfo generator (https://github.com/php/php-src/blob/master/build/gen_stub.php). We cannot change these or put UNKNOWN there, as that would have the stub generator create an actual UNKNOWN constant for dd-trace-php. If you look at stubs from php-src itself, you'll also find this UNKNOWN constant there.
I suppose, if you want to actually include the stubs directly, you'll have to define a dummy const UNKNOWN = 0; or similar, right before including.
Bug report
ddtrace.stub.php causes fatal errors in PHP 8:
This can be fixed by changing signature from
?mixed $body = null
tomixed $body = null
.Once these errors are fixed, there will be multiple
undefined constant
errors:These can be fixed by adding something like that to corresponding namespaces:
For instance, this would fix the first undefined constant error:
How to reproduce:
Create a test PHP file (eg. test.php) and include the stub file:
Execute the file from a command line using PHP 8:
PHP version
8.3
Tracer or profiler version
1.4.2
Installed extensions
No response
Output of
phpinfo()
No response
Upgrading from
No response
The text was updated successfully, but these errors were encountered: