Permalink
Browse files

Fix is type op usage with pseudoglobals

Summary: Fixes #8186

Reviewed By: fredemmott

Differential Revision: D7915366
  • Loading branch information...
oulgen authored and fredemmott committed May 9, 2018
1 parent f58f112 commit f6396127d2037883f8717b884fecff738ec4725b
@@ -3291,6 +3291,13 @@ and emit_special_function env pos id args uargs default =
| _ ->
begin match args, istype_op lower_fq_name with
| [(_, A.Lvar (_, arg_str as arg_id))], Some i
when SN.Superglobals.is_superglobal arg_str ->
Some (gather [
emit_local ~notice:NoNotice ~need_ref:false env arg_id;
emit_pos pos;
instr (IIsset (IsTypeC i))
], Flavor.Cell)
| [(_, A.Lvar (_, arg_str as arg_id))], Some i
when not (is_local_this env arg_str) ->
Some (instr (IIsset (IsTypeL (get_local env arg_id, i))), Flavor.Cell)
@@ -0,0 +1,8 @@
<?php
function foo() {
var_dump(is_array($_GET));
var_dump($_GET);
}
foo();
@@ -0,0 +1,3 @@
bool(true)
array(0) {
}

0 comments on commit f639612

Please sign in to comment.