- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- bool(true)
Parse error: syntax error, unexpected double-quoted string "DOMDocument" in /in/hVE15(12) : eval()'d code on line 2
Process exited with code 255.
<?php
$domd=new DOMDocument();
$str = "DOMDocument";
var_dump($domd instanceof $str);
// ^ 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.