- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
- bool(true) bool(true) bool(true)
<?php
$domd=new DOMDocument();
$str = "DOMDocument";
var_dump($domd instanceof $str);
var_dump($domd instanceof ("DOMDocument"));
// ^ is legal.
// V is illegal
// var_dump($domd instanceof "DOMDocument");
$code = '
var_dump($domd instanceof ("DOMDocument"));
';
eval($code);
// the eval hack is for illustration, make it an error at run-time, rather than compile-time.