Skip to content

Web: Dynamic isset/empty on $_GET and $_POST keys in JIT #70

@PurHur

Description

@PurHur

Problem

IssetHelper optimizes isset($_GET['key']) via SuperglobalInit::compileTimeOffsetIsSet when the key is a string literal. Non-literal keys and runtime-populated superglobals need LLVM hashtable offsetIsSet calls.

Errors today:

  • isset() on superglobals only supports a string literal key in this compiler build

VM tests (web_isset_get.phpt) pass; JIT compliance may differ.

Goal

isset($_GET[$param]) and empty($_GET['missing']) work when superglobals are runtime-filled.

Tasks

  • JIT: __hashtable__offsetIsSet for sg_GET / sg_POST globals
  • empty() lowering consistent with isset
  • Remove or gate compile-time-only fast path behind optimization flag
  • PHPT under test/compliance for JIT mode

Depends on

Files

  • lib/JIT/IssetHelper.php
  • lib/JIT/SuperglobalInit.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions